Commit Graph

30388 Commits

Author SHA1 Message Date
Kai Koehne
ae93a76c93 Document The Public Suffix List
Change-Id: I3c8b00e04ed30209b0de0927b473ba2b9a4f0c87
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2016-11-23 09:35:35 +00:00
Kai Koehne
6542712dfa Extend documentation for SHA-3 third-party license
Write down which files are under CC0, and which under BSD.

Change-Id: Ifdbfa3393b2a0f0d857e6c569bd105426c0719cb
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2016-11-23 09:35:26 +00:00
Maurice Kalinowski
fca4acbfba Remove wince checks
Windows CE is not supported since 5.6. No need to have checks anymore.

Change-Id: I384bd67e04dec06e83ee69b4ef5dc7dd97888c14
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-23 09:28:03 +00:00
Maurice Kalinowski
2c8c6dd9a4 Fix compilation without QPrinter support
Task-number: QTBUG-56321
Change-Id: Ic77d01431ee58d609eca895d1f2d216042406bc9
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-23 09:27:56 +00:00
Maurice Kalinowski
d20a99c081 winrt: Add printsupport
For WinRT QPrinter and co are disabled in the new configure system.
Still, we need to have printsupport enabled as a module, providing
no printer.

Task-number: QTBUG-56321
Change-Id: I95ce538e8f54073832af551ccf7f981e877a3b25
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-23 09:27:51 +00:00
Maurice Kalinowski
e9fa435652 winrt: Add support for Windows Information Protection
Windows Information Protection is used for splitting corporate and
personal data, requiring connections to be established in a different
way instantiating ThreadNetworkContext.

Usage is enabled via the QT_WINRT_USE_THREAD_NETWORK_CONTEXT environment
variable.

Change-Id: I3aaa097b66fc616d42cd05a1e20bbcb004f6e467
Reviewed-by: James Tong
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-23 09:27:45 +00:00
Edward Welbourne
20017d0b1b Remove some #if 0 blocks from API headers
Noticed in API review for 5.8 release.

Change-Id: I1dd48c676924048c32fab8307868cf61915df131
Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
2016-11-23 09:25:14 +00:00
Edward Welbourne
a32424b46c AreArgumentsNarrowedBase: Correct logic for narrowing connect() casts
The prior test deemed there to be narrowing if source and destination
integral-or-enum types didn't have the same signedness; but all values
of an unsigned source type can be represented in a larger signed
destination type, so there is no narrowing in this case.
Updated QObject test-case to match.

Change-Id: I517a5997adcad70e185d7469a8d26788e463cb75
Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
2016-11-23 09:24:40 +00:00
Liang Qi
38c1057f69 Merge remote-tracking branch 'origin/5.6' into 5.7
This also reverts commit 0d2f0164f4.

Conflicts:
	header.BSD-NEW
	qmake/Makefile.win32
	src/openglextensions/qopenglextensions.cpp
	src/openglextensions/qopenglextensions.h
	src/winmain/qtmain_win.cpp
	src/winmain/qtmain_winrt.cpp
	tools/configure/configureapp.cpp
	util/glgen/qopenglextensions.cpp.header
	util/glgen/qopenglextensions.h.header

Change-Id: If26c6f4111b342378dd88bbdc657e322d2ab6ad8
2016-11-23 09:24:36 +01:00
Andy Shaw
d8857f21ac If there are no available sizes, then fallback to the requested size
In a case like the SVG iconengine there is no available sizes
implementation. However in that case we don't need to provide different
sizes as we can have SVG scale it for us to the one requested. So it is
assumed that with no available sizes implementation that the icon
engine will take care of this for us.

This ensures that SVG files can be used as icons inside the menu on
macOS.

Task-number: QTBUG-40225
Task-number: QTBUG-55932
Change-Id: If01ca582c4c07834e6de16652924e0b7e118c87c
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-23 06:58:05 +00:00
Anton Kudryavtsev
be94fc445a QString: optimize remove(QChar, Qt::CaseSensitivity)
remove(int, int) with O(N) was used in a loop.
We had a quadratic complexity.

Use erase-remove idiom to fix it.

Change-Id: I643a2a75619ec5ea2bf99e48a25f64a7f69ba156
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-23 05:27:05 +00:00
Friedemann Kleint
b5222307af Fix some qdoc-warnings
qtbase/src/corelib/kernel/qdeadlinetimer.cpp:343: warning: Cannot find 'setPreciseRemainingTime(...)' in '\fn' void QDeadlineTimer::setPreciseRemainingTime(qint64 secs, unsigned nsecs, Qt::TimerType type)
qtbase/src/corelib/kernel/qdeadlinetimer.cpp:459: warning: Overrides a previous doc
qtbase/src/corelib/kernel/qelapsedtimer.cpp:86: warning: Unknown command '\ref'
qtbase/src/corelib/global/qglobal.cpp:1184: warning: Undocumented enum item 'MV_WATCHOS_2_2' in QSysInfo::MacVersion
qtbase/src/corelib/global/qglobal.cpp:1184: warning: Undocumented enum item 'MV_WATCHOS_3_0' in QSysInfo::MacVersion
qtbase/src/corelib/global/qglobal.cpp:1184: warning: Undocumented enum item 'MV_WATCHOS' in QSysInfo::MacVersion
qtbase/src/corelib/global/qglobal.cpp:1184: warning: Undocumented enum item 'MV_WATCHOS_2_1' in QSysInfo::MacVersion
qtbase/src/corelib/global/qglobal.cpp:1184: warning: Undocumented enum item 'MV_WATCHOS_2_0' in QSysInfo::MacVersion
qtbase/src/corelib/kernel/qdeadlinetimer.cpp:175: warning: Missing parameter name
qtbase/src/corelib/kernel/qdeadlinetimer.cpp:175: warning: No such parameter 'ForeverConstant' in QDeadlineTimer::QDeadlineTimer()
qtbase/src/corelib/kernel/qdeadlinetimer.h:156: warning: No documentation for 'QDeadlineTimer::remainingTimeAsDuration()'
qtbase/src/gui/painting/qcolor.cpp:796: warning: Undocumented parameter 'name' in QColor::QColor()
qtbase/src/gui/painting/qcolor.cpp:802: warning: Undocumented parameter 'name' in QColor::QColor()

Some errors in QDeadlineTimer remain due to qdoc not fully supporting templates.

Change-Id: Ie7afd91c48048748eeda23c32056583c31fd7490
Reviewed-by: Nico Vertriest <nico.vertriest@theqtcompany.com>
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
2016-11-23 05:24:02 +00:00
Timur Pocheptsov
e2b856d562 QDir::tempPath - use NSTemporaryDirectory on Darwin
Instead of hardcoded "/tmp".

Task-number: QTBUG-57165
Change-Id: I9d3ae157c22ce131281b8279149eea87a26244e8
Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
2016-11-22 19:10:05 +00:00
Jesus Fernandez
53edaf0fb7 Document QMAKE_OBJECTIVE_CFLAGS
Task-number: QTBUG-57264
Change-Id: Iae06d9428d320a99cfd070154ed7bc94ec450b91
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-22 19:08:24 +00:00
Laszlo Agocs
cff48c7845 eglfs: Avoid unexpectedly flushing QPA input events
Flushing all events to ensure that the expose (or other queued events) get
processed right away is dangerous. Instead, pass ExcludeUserInputEvents like
many other platform plugins do. This way queued input events do not get
processed at an unexpected point in time and so do not interfere with modal
dialogs for instance.

Task-number: QTBUG-57229
Change-Id: I9da09e62627d26485fb5a37fc190cb4a4bcb28b6
Reviewed-by: Andy Nichols <andy.nichols@qt.io>
2016-11-22 12:25:37 +00:00
Friedemann Kleint
d377f14fd5 Windows QPA: Detect Windows 10 tablet mode
Add new file for dynamically loading Window 10 Helpers via combase.dll
and add function qt_windowsIsTabletMode() querying
UIViewSettings::get_UserInteractionMode() for "Touch" mode.

The style hint QPlatformIntegration::ShowIsMaximized will then
reflect the tablet mode setting.

Task-number: QTBUG-56831
Change-Id: Ia361dd172fcf0e54fdfc70863c43527f3ea72fe2
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
2016-11-22 11:49:30 +00:00
Marc Mutz
d6c8fab880 QMutex: make sure we try_lock_for no shorter than the duration passed
By templating on the <chrono> types and unconditionally using
duration_cast to coerce the duration into a milliseconds, we
allowed code such as

   mutex.try_lock_for(10us)

to compile, which is misleading, since it's actually a zero-
timeout try_lock().

Feedback from the std-discussions mailing list is that the
wait_for functions should wait for _at least_ the duration
given, because that is the natural direction of variance
(tasks becoming ready to run might not get a CPU immediately,
causing delays), while an interface that documents to wait
_no more_ than the given duration is promising something it
cannot fulfill.

Fix by converting the given duration to the smallest number
of milliseconds not less than the original duration. If that
is not representable in an int, use INT_MAX, emulating the
effect of a spurious wakeup, which are allowed to happen if
the function returns false in that case.

In the above example, the try_lock_for call is now equivalent
to

  mutex.tryLock(1);

The tryLock() docs state that the actual waiting time does
not exceed the given milliseconds, but fixing that is a
separate issue.

Change-Id: Id4cbbea0ecc6fd2f94bb5aef28a1658be3728e52
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-22 11:32:35 +00:00
Marc Mutz
34c2a1dcf0 QFormLayout: fix use-after-free in clearQLayoutItem()
Found by ASan when it should have been found by me in the initial
review...

The old code did, in this order:

1. delete item->layout() (which deletes item, as QLayoutItem::layout()
   is just a dynamic_cast implemented with virtual functions)

2. delete item->widget() (which is correct, but too late, as 'item'
   may have already been deleted; this is the first use-after-free
   bug)

3. delete item->spacerItem() (which is the second use-after-free).

Fix by deleting item->widget() (which may be a no-op), _then_ checking
for a QLayout, deleting all children (but not the layout), and finally
deleting item as a QLayoutItem.

Rename clearQLayoutItem() to clearAndDestroyQLayoutItem() to better
match what it actually does.

Change-Id: Id70a7a137dac5de466ef619f01bfd61dfc150418
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Samuel Gaist <samuel.gaist@edeltech.ch>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-22 11:32:13 +00:00
Kai Koehne
a9af3c8502 win: Show Tech Preview license
Show the tech preview license for commercial users if -confirm-license
is not set. This matches what the configure shell script is doing, too.

Task-number: QTBUG-55676
Change-Id: I69f5553ab53dfcdc14c200e682c024a6cebee8fe
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-22 08:36:49 +00:00
Jesus Fernandez
e1f0e08e9a Add more information for QKeySequence::toString on macOS
The previous documentation said:
"On OS X, the string returned resembles the sequence that is shown in
the menu bar."
That was not completely true because the string returned depends on the
format passed to the function.

Task-number: QTWEBSITE-744
Change-Id: I1b7d9367547326670d1b3a8cfe48f066910f5a10
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2016-11-22 08:12:28 +00:00
Friedemann Kleint
7920cfe46a Fix SCTP API according to Qt conventions
inDatagramMode() -> isInDatagramMode()
maxChannelCount -> maximumChannelCount

Change-Id: Ib64bf52cc3b40354927ee11e3f41d47e84c6d9c4
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-22 07:13:01 +00:00
Andy Shaw
3cd457bdad Handle RemovePath correctly when calling matches()
Change-Id: Ied324a537df127e676fad26b42e658a9d5aeec9b
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-22 07:05:30 +00:00
Oliver Wolff
9f17c24589 Enable constexpr support for Visual Studio 2017
Change-Id: I894789c41cc2c1a327c14d0526e658520d096085
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-22 06:07:25 +00:00
Oliver Wolff
38675e18fc Add support for Visual Studio 2017
Tested with RC

Task-number: QTBUG-57086
Change-Id: I21f56edca3852b52edd2c5fdcce76817141e8d4a
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-22 06:07:23 +00:00
Vyacheslav Koscheev
0a203faa7f Adjust comment to "new" spec name
Change-Id: I58250de09f10637b145a5f43c3764a86e47bce96
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-22 05:39:51 +00:00
Marc Mutz
4bf5a3c885 tst_QFormLayout: Fix UB (invalid enum value) in several functions
The code coerced a -123 into a QFormLayout::ItemFlags, which, however,
being an enum with enumeration values 0..2, only has valid numerical
values 0..3.

Fix by using 3 as the value to represent the invalid enum value, and
store this in a constant so as not to distribute this magic number
all around the test class.

Change-Id: Ie5e93a69ef5a3acdde43030b022e0cce8aec484d
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-22 05:38:45 +00:00
Friedemann Kleint
ad788c1014 tst_qstandardpaths: Disable WOW64 redirection on Windows
The logo (microsoft.windows.softwarelogo.showdesktop.exe) is otherwise
not found.

Change-Id: Ic52329462612a027e2928922a1f9a541dcbc67a3
Reviewed-by: Jesus Fernandez <jesus.fernandez@qt.io>
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-22 05:29:11 +00:00
Timur Pocheptsov
e798d0b18a qnativesocketengine_winrt - do not shadow a variable
We first hide identifier 'hr' and then later we check the one that was never
correctly initialized.

Task-number: QTBUG-57226
Change-Id: Ibbf1bb99aa752c2e4090caf4533dc5f5b71b5e41
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-22 05:05:24 +00:00
Simon Hausmann
d207738245 Fix missing last modification time stamp in qrc content
The time stamp is added at the end of the node information and
consequently this also bumps the version.

Task-number: QTBUG-57182
Change-Id: Ia10e006f28c0b168b2bcd74ed8b7098f84d10af3
Reviewed-by: hjk <hjk@qt.io>
2016-11-22 04:57:02 +00:00
Marc Mutz
3691f7ca0c QFutureInterface: make accesses to 'state' thread-safe
Introduce helper functions switch_{on,off,from_to} to make
the code more readable, and prepare everything for later
optimizations reducing the sizes of critical sections (by
locking the mutex later, or even never).

This commit, however, is only concerned with shutting up
tsan.

In waitForResult(), simplified the code by removing an
unneeded if guard: the condition is checked in the while
loop immediately following in the then-block, and the
local variable declaration that precedes the loop is not
worth guarding.

Change-Id: I24bfd864ca96f862302536ad8662065e6f366fa8
Reviewed-by: David Faure <david.faure@kdab.com>
2016-11-20 15:48:05 +00:00
Peter Seiderer
f1b4bd4790 eglfs: fix eglfs_mali compile for odroid-mali
Avoid duplicated struct fbdev_window definition (introduced by commit
58bed4cda9) by renaming the local
shadow definition to struct shadow_fbdev_window.

Task-number: QTBUG-57156
Change-Id: I72b03f09fc57ddcd0284d6d3554a5658e02b80fc
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
Reviewed-by: Julien Corjon <corjon.j@ecagroup.com>
2016-11-19 21:25:52 +00:00
Kai Koehne
32b99a38c5 PCRE: Document upstream version
Also update copyright.

Change-Id: I42a23701734c2c8d3ae43f70cc69dfb609b3a7a3
Reviewed-by: André Klitzing <aklitzing@gmail.com>
Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
2016-11-19 20:39:47 +00:00
Friedemann Kleint
cb0d8ffdd9 Extend manual test windowflags
Change the main window to contain a QTabWidget and add a log widget
logging relevant events on the top level widgets for testing changes.

In the preview window, add new window flags of Qt 5 and output
geometry, margins and window state in addition.

Change-Id: Icec366223b6c163d58a69034687f3d9323a91533
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-18 18:58:16 +00:00
Kai Koehne
0d2f0164f4 Also release winmain, qopenglextensions under commercial licenses
Add commercial licenses as an alternative to BSD for code that
is statically linked into applications by default. BSD requires
attribution even for commercial customers, which is not intended.

This is a manual backport of parts of change 71404b0be1 in 5.7,
and should be dropped when merging to 5.7.

[ChangeLog][License Changes] Static libraries that are linked
into executables (winmain and qopenglextensions) are
now licensed under BSD _and_ commercial licenses.

Change-Id: I0d33bc09c06548d63b11a39027e9bb12c1b9a915
Reviewed-by: Lars Knoll <lars.knoll@qt.io>
2016-11-18 16:19:56 +00:00
Kai Koehne
4b1c343e5e Doc: Add missing reference to qInfo()
Change-Id: I7438aa8ff9fddf2e0155ffe0d442f96d4d9265d4
Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
2016-11-18 16:19:49 +00:00
Mitch Curtis
f817a995b2 tst_qhooks: test that it's possible to chain multiple hooks together
Chaining hooks together was mentioned by Ossi in the comments of
d953d9a4. This patch justs add a test that verifies that it works, and
also serves as an informal example for developers looking how to do it.

Change-Id: I53a014d5663c289ea0559e0926ed301f4e5110e6
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2016-11-18 15:22:32 +00:00
Marc Mutz
1a3a8cf87b QDeadlineTimer: mark more functions nothrow
Change-Id: I3be9c69b46901311e9150a7f718707d8ff523e9e
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-11-18 07:43:42 +00:00
Edward Welbourne
a56dd0b828 tst_QDateTimeEdit: Use base method, not direct member access
A test was directly accessing the .text member of QDateTimeParser
(which presently has nothing private).  Use the virtual .displayText()
method of this base instead, to let the base have some hope of
data-hiding (maybe, some day).

Change-Id: I8b6e39fba130de56f117bffb2aec346197969c5b
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-18 05:03:43 +00:00
Jake Petroules
db6c31af01 qmake: fix installation of asset catalog files
This strips leading whitespace from asset catalog filenames, which was
causing installation to fail due to incorrectly calculated paths.

Task-number: QTBUG-57090
Change-Id: I80db627262f9d58f4403e2d8ab205bef2113992b
(cherry picked from commit addf1f45f3)
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-17 19:34:21 +00:00
Oswald Buddenhagen
35953be53b fix xcodebuilds without -sdk iphonesimulator
the order of the arguments passed to addExclusiveBuilds() determines the
name of the CONFIG flag which actually enables the mode. that is
historically fixed to iphonesimulator_and_iphoneos and we cannot just
change the order.

to get around this, add a new "overload" of the function which allows
specifying the flag independently from the order of the builds, and make
use of it in ios' resolve_config.prf.

amends d2b4a789c.

Change-Id: Ia3fabea0c0c30beae680b57e75bdcdf35ef6503d
(cherry picked from 59985b3c29)
Reviewed-by: Jake Petroules <jake.petroules@qt.io>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
2016-11-17 19:34:09 +00:00
Allan Sandfeld Jensen
ac384524c8 Speculative fix for tst_QThread::wait2() flakiness
This test fails on Windows occasionally with values just short of 800, the lowest
observed being 791. It is probably rounding somehow to 10ms segments, so allow
it to be up to 10 ms too fast.

Change-Id: Ie28e9f61588b68a9060a006f78eedc3a26d05155
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
2016-11-17 14:23:19 +00:00
Edward Welbourne
658c8370e4 QDateTimeParser: localize variable to avoid shadowing
The outer scope it was in had a later clause with its own pos
variable.

Change-Id: I8d083d3d5935416ef82a78890ed145f02d6d6ded
Reviewed-by: Timur Pocheptsov <timur.pocheptsov@qt.io>
2016-11-17 14:22:44 +00:00
Andy Shaw
bd591064be Use QPersistentModelIndex for storing a model index
QModelIndex is not safe to be used to store an index as it is designed
to be discarded right after use as the index information can change.

Therefore a QPersistentModelIndex should be used instead to store the
index. Subsequently the m_index does not need to be updated whenever
the model changes anymore as this is already done for us.

Task-number: QTBUG-49907
Change-Id: Icc93e410de2821c503ea15a7a1dd9ae32634914e
Reviewed-by: Jan Arve Sæther <jan-arve.saether@qt.io>
2016-11-17 06:48:31 +00:00
Alexander Volkov
48d7db6b31 QtCore: Add missing override
Change-Id: Ifdec31aabdd0371f36abbb382e49f52f5b58ee94
Reviewed-by: hjk <hjk@qt.io>
2016-11-16 22:57:22 +00:00
Lars Knoll
03c1a6ac71 Remove last traces of opengl es 1 support
Change-Id: I3f86d4892ec3235003d34fdcf3f093f1513c821f
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
2016-11-16 22:00:46 +00:00
Marc Mutz
bebbaa43fd Fix warnings in tst_q{table,list}widget
GCC warned:

  tst_qtablewidget.cpp:30:
  tst_qtablewidget.cpp: In member function ‘void tst_QTableWidget::mimeData()’:
  qtestcase.h:66:52: warning: suggest parentheses around assignment used as truth value [-Wparentheses]
       if (!QTest::qVerify(static_cast<bool>(statement), #statement, "", __FILE__, __LINE__))\
                                                      ^
  tst_qtablewidget.cpp:1523:5: note: in expansion of macro ‘QVERIFY’
       QVERIFY(data = table.mimeData(tableWidgetItemList));
       ^~~~~~~

Fix by adding the extra parentheses, as usual.

Change-Id: I2826d7a865b4113b468d5a958ede06e03aa0e278
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-11-16 20:21:50 +00:00
Marc Mutz
8d8991c697 QXbmHandler: don't construct a QByteArray just to find '0x' in text
Even QByteArray::fromRawData() allocates memory.

Instead of QByteArray::contains() and indexOf(), use good ol'
strstr(), like already done elsewhere in the same function.

Apart from the memory allocations saved, this fixes a Coverity error
complaining that indexOf() can return -1. It's a false positive on the
first occurrence, because we didn't call that function unless we know
there is a "0x" in the string, but the second _was_ wrong, because we
applied it on a new buffer, with unknown content.

Coverity-Id: 11262
Change-Id: I18f352c5576e24f89a5c3ef7f2f1b2176f2a235d
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
2016-11-16 19:49:04 +00:00
Sérgio Martins
e655426e7a docs: Reference QLineEdit::hasAcceptableInput() in setValidator()
Easy to miss otherwise and hasAcceptableInput() already references setValidator().

Change-Id: Id2d63050db670ab8f7150d7f76492664751cd2da
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
2016-11-16 19:33:43 +00:00
Friedemann Kleint
33573bf7ea Manual Dialog test: Fix compilation against Qt 4
Change-Id: I79a90cd252e99fb94c0429a3f03eb1ddacab1786
Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
2016-11-16 19:26:12 +00:00
Robin Burchell
094b64fb60 QRawFont: Add a qHash overload
This will be used in QtQuick to avoid costly string manipulation (which in turn
involves memory allocations).

Change-Id: I51a67a4cd97cc576f399483c9c0c13da1e1c6e72
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
2016-11-16 18:13:41 +00:00