Commit Graph

27328 Commits

Author SHA1 Message Date
Marc Mutz
4262f31330 QDaemonThread: replace a function pointer with a lambda
Saves around 0.5KiB in text size on optimized GCC 5.3
Linux AMD 64 builds.

Change-Id: Iaf2664e670a96136031bac67e4012d4f7324eb47
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-17 16:17:29 +00:00
Marc Mutz
66e2643072 QDialogButtonBox: replace a QList copy + pop_front() with mid(1)
Simplifies the code and is also more efficient, because
it copies less data.

Change-Id: I9ad0c372fb4fa6f5818d9d6cb7b7cf35935f8565
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-17 16:17:25 +00:00
BogDan Vatra
efcf1dec49 Say hello to Android Services
This changeset enables running a QCoreApplication from within an Android
Service. The Android Application running can now have a QtActivity or a
QtService, but having both in the same process is not supported.

This patch was based on Cory Slep's patch

[ChangeLog][Android] Qt can now be used to easily create Android Services.

Task-number: QTBUG-37221
Change-Id: I0fd693daaa85b991940ffe9cc41c483022677199
Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
2016-02-17 14:29:58 +00:00
Tor Arne Vestbø
4a7ccf74ff Disable XCTest support in QtTestLib
In recent Xcode versions it doesn't work as expected, and caused build
failures in downstream modules, so we disable it until the cause can
be investigated further.

Change-Id: Ie54c7256a10d73610ec7e481b9d665b75e396365
Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-17 13:12:56 +00:00
Tor Arne Vestbø
d6c8073a34 Revert "Fix shared library framework builds of Qt with a platform suffix."
This reverts commit c4ecb81d6d.

Hard-coding the library suffix into the linker flags was wrong. The
library suffix is handled at runtime with DYLD_IMAGE_SUFFIX, set
as part of the Xcode scheme or during debugging in .lldbinit.

Change-Id: I11907b2755f7f187fb6fa18202813fde9ada4354
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-17 13:06:45 +00:00
Stephen Kelly
bfeb2fdd79 QStandardItemModel: Reset the flags on clear()
Pass modeltest after clear().  Otherwise it fails because more flags
than Qt::ItemIsDropEnabled get returned for the QModelIndex().

Change-Id: I8f11515cc7dc9383f528f785312ffb77b3c2699d
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-17 11:39:13 +00:00
Anton Kudryavtsev
a44d7862c8 QDate: mark getDate() as const.
This method does not modify the object.
Can't change the API, so overload and mark the old function
for removal in Qt 6.

Change-Id: I4aee2bc19209646adc21388375aedd20a09129d0
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-17 11:19:52 +00:00
Friedemann Kleint
56ad625f78 Add attribute Qt::AA_DontUseNativeDialogs.
The attribute can be set to suppress native dialogs for example
for testing purposes.

Task-number: QTBUG-51074
Change-Id: I35611e07e00b7a060f22b49d6ab6f3b8627f8aca
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: J-P Nurmi <jpnurmi@theqtcompany.com>
2016-02-17 10:20:28 +00:00
Ariel Molina
42b39f9827 Add source device information to qDebug output of QTouchEvent
This is a simplistic patch to make it easier to debug touch input when
using multiple physical or virtual devices.

Change-Id: I996237cdce5e0ff0c4a0660dabb0d190679ab585
Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-02-17 05:07:14 +00:00
Gabriel de Dietrich
049fad42a2 QWindow: Make screen warning more informative
Change-Id: Icd7933422e272434370ae6080348de6159d2e725
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
2016-02-17 04:57:53 +00:00
Gabriel de Dietrich
9212727813 QOpenGLExtensionMatcher: Fix possible use of unintialized memory
Some drivers don't support GL_NUM_EXTENSIONS, so we may be reading
random bits from numExtensions.

Change-Id: Ibe61fa6d7c379f3f1428458edd3e0ddba0eb04d7
Task-number: QTBUG-48943
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-02-17 04:57:21 +00:00
Anton Kudryavtsev
a3b8e355fc QListView: fix skipping indexes in selectedIndexes().
Remove spurious increment of i.

Task-number: QTBUG-51086
Change-Id: I4307a6728de1e7f25c8afa31fe2066f92373f3fc
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-17 04:53:16 +00:00
Maurice Kalinowski
5b727576b1 winrt: add logging to platform plugin
Task-number: QTBUG-38114
Change-Id: I24c96bb2e29e1bbfe93dfe45aa764451aa9ddde8
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:52:41 +00:00
Maurice Kalinowski
e7a06c9843 winrt: Fix clipboard
Native implementation was missing and so far it only used the Qt
internal fallback mode.

Unfortunately this does not apply to Windows Phone 8.1.

Task-number: QTBUG-49766
Change-Id: I8cbbb0c843d077d7df1396d673fedeab2799b5a6
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:51:46 +00:00
Maurice Kalinowski
ad16703fa8 Update testdata
Some entries were not updated and tests failed to succeed on platforms
which need to deploy content/testdata.

Change-Id: Ieb2b44c375b04cbaaecc1fb2303cc2478b86a100
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:50:50 +00:00
Maurice Kalinowski
8b0dc80294 winrt: Fix usage of testdata
testdata needs to be deployed to temp and current directory
needs to be set to that directory for the test to succeed.

Change-Id: I2dd023af9073d90afbb4ad60fcfb50bb1af4e159
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-17 04:50:14 +00:00
Anton Kudryavtsev
9baf824e4d QDateTimeParser: de-duplicate calls and cache results
Change-Id: I2e95456146b6ce646e244e962082f2967bcaed42
Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-16 21:38:05 +00:00
Eric Lemanissier
21d19f760c Improve sql allocated cache reuse
This change avoids unnecessary allocation of QSqlCachedResult cache.

Change-Id: Ief592ab05b50f5e328490c504af088ec74d1938f
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-02-16 21:22:19 +00:00
J-P Nurmi
273114582a Add QStyleHints::setTabFocusBehavior() for testing purposes
So far we've been dependent on the focus behavior setting in OS X
system preferences. This change allows us to start testing both
behaviors on any platform.

Change-Id: I9ce004f8b9479f8e722a387b795de16edb166a07
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
Reviewed-by: Liang Qi <liang.qi@theqtcompany.com>
2016-02-16 21:12:49 +00:00
Lars Knoll
0649afd60c Better grouping of configure tests
These tests are not required to build qmake, so move them
together with the other tests.

Change-Id: I191e7552e819e8d68a27da3ac1b5258d57145155
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-16 20:11:44 +00:00
Lars Knoll
b244954f62 Remove leftover from Symbian times
Change-Id: I8b61f327c038fa51935c9990adb8493f5477643f
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
2016-02-16 20:11:38 +00:00
Maurice Kalinowski
6c7c34f219 winrt: Disable tests which connect to localhost
WinRT does not allow do connect to the localhost due to security
constraints and sandboxing. Hence we need to disable those
currently.

Change-Id: Idb8c71397a41e5fa5bad9d618dba1bb389e71b9c
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-16 19:35:10 +00:00
Liang Qi
e19fc4324b Merge "Merge remote-tracking branch 'origin/5.5' into 5.6" into refs/staging/5.6 2016-02-16 19:20:37 +00:00
Milian Wolff
bd35260415 Microoptimize QObject::activate.
This patch removes temporary variables that are not used in all cases.
This reduces the instruction count per iteration for the corresponding
benchmark by 1 or 2.

Before:

********* Start testing of QObjectBenchmark *********
Config: Using QtTest library 5.7.0, Qt 5.7.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.0)
PASS   : QObjectBenchmark::initTestCase()
PASS   : QObjectBenchmark::signal_slot_benchmark(simple function)
RESULT : QObjectBenchmark::signal_slot_benchmark():"simple function":
     21.0065466 instructions per iteration (total: 210,065,466, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(single signal/slot)
RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/slot":
     405.0829559 instructions per iteration (total: 4,050,829,559, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(multi signal/slot)
RESULT : QObjectBenchmark::signal_slot_benchmark():"multi signal/slot":
     405.0812465 instructions per iteration (total: 4,050,812,465, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(unconnected signal)
RESULT : QObjectBenchmark::signal_slot_benchmark():"unconnected signal":
     104.0147348 instructions per iteration (total: 1,040,147,349, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(single signal/ptr)
RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/ptr":
     369.1021099 instructions per iteration (total: 3,691,021,100, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(functor)
RESULT : QObjectBenchmark::signal_slot_benchmark():"functor":
     370.0982862 instructions per iteration (total: 3,700,982,862, iterations: 10000000)
PASS   : QObjectBenchmark::cleanupTestCase()
Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 6036ms
********* Finished testing of QObjectBenchmark *********

After:

********* Start testing of QObjectBenchmark *********
Config: Using QtTest library 5.7.0, Qt 5.7.0 (x86_64-little_endian-lp64 shared (dynamic) release build; by GCC 5.3.0)
PASS   : QObjectBenchmark::initTestCase()
PASS   : QObjectBenchmark::signal_slot_benchmark(simple function)
RESULT : QObjectBenchmark::signal_slot_benchmark():"simple function":
     21.0061664 instructions per iteration (total: 210,061,664, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(single signal/slot)
RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/slot":
     403.0829161 instructions per iteration (total: 4,030,829,162, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(multi signal/slot)
RESULT : QObjectBenchmark::signal_slot_benchmark():"multi signal/slot":
     403.0836305 instructions per iteration (total: 4,030,836,305, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(unconnected signal)
RESULT : QObjectBenchmark::signal_slot_benchmark():"unconnected signal":
     104.0150038 instructions per iteration (total: 1,040,150,039, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(single signal/ptr)
RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/ptr":
     368.0981987 instructions per iteration (total: 3,680,981,988, iterations: 10000000)
PASS   : QObjectBenchmark::signal_slot_benchmark(functor)
RESULT : QObjectBenchmark::signal_slot_benchmark():"functor":
     369.1179429 instructions per iteration (total: 3,691,179,429, iterations: 10000000)
PASS   : QObjectBenchmark::cleanupTestCase()
Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 5975ms
********* Finished testing of QObjectBenchmark *********

Change-Id: Iba3bffbca5b58109816c8b1a7dea0796b18c8785
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-16 18:00:16 +00:00
Milian Wolff
e1538b39bb Share code between const and non-const QMetaObject::cast variants.
Change-Id: I7aad8e5060bb17ebc04fdb137dad3b6d167895a8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-16 17:59:55 +00:00
Marc Mutz
a93ff2c248 Reduce allocations in QSQLiteDriver::open()'s connection options parsing
- Use splitRef() instead of split(), avoiding small temporary
  QStrings.
- Don't remove all spaces before splitting, trim strings at
  the QStringRef level later, where needed. This will reject
  nonsense strings like QSQL_ LITE _BUSY_ TI MEOUT= 1 2 3 that
  were previously (wrongly) accepted.
- Use C++11 range-for loop.

Change-Id: I875c4cf47b7a283ba55783f70c903bb9947e1cd7
Reviewed-by: Mark Brand <mabrand@mabrand.nl>
2016-02-15 23:12:54 +00:00
Liang Qi
0d239d1d92 Merge remote-tracking branch 'origin/5.5' into 5.6
Change-Id: Ic011149c50dcbff3468d8fbdd3069a51ecd8f21c
2016-02-15 19:04:06 +01:00
Andreas Hartmetz
e7bf0edfd4 Add option to disable "session management by closing windows".
That feature is a poor man's session management for applications
that do not implement any specific session management features.
It badly interferes with proper session management support, so
applications must be able to disable it.

This enables fixing applications with
QGuiApplication::quitOnLastWindowClosed() true - the default -
dying too early, before they are enumerated for the list of
applications to restart on session restore, thus preventing them
from being restored. See
https://bugs.kde.org/show_bug.cgi?id=354724

[ChangeLog][QtGui] Qt asking to close windows on session exit as
a fallback session management mechanism has been made optional.
Disabling it fixes session management for applications that
implement full session management. See
QGuiApplication::isFallbackSessionManagementEnabled().

Task-number: QTBUG-49667
Change-Id: Ib22e58c9c64351dea8b7e2a74db91d26dd7ab7aa
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: David Faure <david.faure@kdab.com>
2016-02-15 16:10:20 +00:00
Lars Knoll
c7c7cf636b Remove LGPLv2 as a license option in configure
Instead show LGPLv3 and GPLv2 as valid options for the
open source edition.

Change-Id: Id7a203226428031ec873cbaf106dca14a854f155
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-15 14:55:32 +00:00
Friedemann Kleint
bfb47b39f6 Windows QPA: Fix the signature of the font enumeration callbacks.
Instead of casting the function in the calls to EnumFontFamiliesEx(),
use the correct signature and cast inside the callbacks. Also
avoid unconditionally casting the TEXTMETRIC parameter to
NEWTEXTMETRICEX since according to documentation
NEWTEXTMETRICEX is passed for TrueType fonts only.

Task-number: QTBUG-50804
Change-Id: I0393474ac06000fc3f12d2dbc2a5aa37a6b44849
Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
Reviewed-by: Oliver Wolff <oliver.wolff@theqtcompany.com>
2016-02-15 14:53:49 +00:00
Marc Mutz
8204a4db05 qmake: remove some empty user-defined dtors
They prevent move special member functions from
being synthesized by the compiler.

Change-Id: I90c4a6e286734ef3906ee833826bd3bfbdad3874
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-15 14:45:40 +00:00
Samuel Gaist
58141642b6 Doc: Fixed Qt::TextWordBreak to Qt::TextWordWrap
Change-Id: I0c50eab22c7ffaa7f39111b37979b92fd5c7f35f
Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
2016-02-15 14:22:29 +00:00
Samuel Gaist
018e670a26 OS X: Implement download folder display name query
Up to now, the download folder display name was queried using
FSFindFolder and kDesktopFolderType. Now that NSFileManager can be used
unconditionnaly, the query has been replaced to use NSFileManager.

[ChangeLog][QtCore][OS X] QStandardPaths now returns the correct
display name for the download folder.

Task-number: QTBUG-50262
Change-Id: Ie16c8daea3261a4dd5ca051956fc08d51656e0fa
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2016-02-15 14:22:14 +00:00
David Faure
78b8f7803b QtConcurrentRun: add unittest for polling for isFinished()
I had intermittent failures with this kind of code in my unittests,
not sure why yet. This test seems to pass reliably, apart from
helgrind saying it triggers the known race in QFuture::isFinished,
for which Marc is working on a fix.

Change-Id: I4aabe77566dc1af859a016ffe8a4cce19ddf25c8
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-15 13:53:57 +00:00
David Faure
bbc830ce3e QIcon::fromTheme(): add support for absolute paths.
This allows methods that return an icon name, to sometimes also
return an icon full path (e.g. because the icon was dynamically generated
and stored into a local cache on disk)

Change-Id: Ib01c3955f4b64236463846241d9814b2d0686634
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-15 13:53:54 +00:00
David Faure
e8ed29d679 tst_QTemporaryFile: test value of openMode() after open().
I had a doubt about what it would be, turns out it's ReadWrite.
Turns out it's documented, too :-)

Change-Id: I87c2ffc81aa240ffa88c495fe250b022d7fb3c21
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-15 13:53:51 +00:00
Heiko Becker
c689bcafd3 Search for libsystemd first, fall back to libsystemd-journal
systemd >= 209 merged the individual libraries libsystemd-journal,
libsystemd-login, libsystemd-id128 and libsystemd-daemon into
a single library, libsystemd. To ease the transition one could pass
an option to its build to generate stub libraries and matching
pkg-config files. With systemd >= 229 this option has now been
removed, causing the build to fail when the journald option is
enabled.

Change-Id: I26670f207f1a9e79c16be5ce8c8a49353143c5ba
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-02-15 13:32:21 +00:00
BogDan Vatra
1a358a052e Fix crash when using .NoActionBar theme.
m_activity.getActionBar() returns null when a .NoActionBar theme is
declared in AndroidManifest.xml file

Change-Id: I671891d03913209c3f9f34a6f4dd8894c20de5c2
Reviewed-by: Christian Stromme <christian.stromme@theqtcompany.com>
2016-02-15 13:04:48 +00:00
Anton Kudryavtsev
0668d08b87 QHttpNetworkConnectionPrivate: de-duplicate calls in if-else chains
... and loops.

Every QNetworkConfiguration::bearerType() call produces lock/unlock of mutex.
Fix: cache result.

Every QHttpNetworkRequest::contentLength() call contains internal loop.
Fix: cache result.

Also cache results of QNonContiguousByteDevice::size() and
QHostAddress::protocol().

Change-Id: I01124648b1972f480905433d9b3551c2246e1bde
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-15 12:40:08 +00:00
Peter Kümmel
ab8cc8387f Add qOverload to select overloaded functions
[ChangeLog][QtCore][Global] qOverload added to select
overloaded functions.

Change-Id: I7c9b1b054e6631eca0b5594db59e1202ef552c33
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-15 12:33:24 +00:00
Liang Qi
80bf4bfe3d Merge remote-tracking branch 'origin/5.6.0' into 5.6
Change-Id: I0b190005377a23a91da3563428e223b8a3b18333
2016-02-15 08:09:50 +01:00
Sean Harmer
b725f4e144 Cache results of multiple render target support
Change-Id: I9e706690d4d2ddaae6c84b0e24de7698704e862d
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-02-14 18:13:42 +00:00
Sean Harmer
48ca7f6220 Provide optimised version of QOpenGLFramebufferObject::blitFramebuffer
Profiling shows that the call to glGetIntegerv() in this function that
queries for the currently bound framebuffer is very expensive. It's
the top hit on the CPU when profiling a Qt3D application using a
Scene3D Qt Quick 2 item. The reason it is so expensive is that this
call forces the OpenGL driver to propagate the OpenGL state through
all of the queued commands in order to answer the query. It may
also induce a pipeline stall depending upon the driver implementation.

As this function gets called on the hot path every frame whenever using
a Scene3D item and may also be called in plain Qt Quick when using
ShaderEffect items; the layer property of QQuickItem; or when updating
the Qt Quick glyph cache texture on Core profile contexts, it is very
much worthy of optimization.

This commit adds an overload of the blitFramebuffer() call that allows
the caller to provide a policy that can either:

* keep the existing behavior of restoring the previous framebuffer
  binding,
* restore the default framebuffer, or
* don't restore anything and let the caller be responsible for it.

This will allow consumers such as Qt Quick and Qt 3D to use the
optimised code path. The existing overloads of blitFramebuffer()
retain the current behavior by calling with the policy to restore the
previous framebuffer binding.

Upon making this change, the cost of blitFramebuffer() is massively
reduced. A follow up commit will optimize this further.

Change-Id: I417abb7da916ae5088f6817e4eff8ea02c8c5803
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-02-14 18:13:38 +00:00
Sérgio Martins
e41e034669 Use QVector instead of QList for sizeof(T) > sizeof(void*)
caught with static analyzer which only warns for trivial cases:
- Container must be local
- Container isn't passed to any function, assigned to another
container or assigned to.

Change-Id: I3f3aa73c128a56f067fa8745990977445a495ac4
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-14 16:39:54 +00:00
Sérgio Martins
6139fbeb5f Introduce QHash::equal_range()
Similar to QMap::equal_range().
Will allow to easily fix inefficient code such as:

    foreach (auto value, hash.values(key)) { ... }

[ChangeLog][QtCore][QHash] Added QHash::equal_range()

Change-Id: I6e19e25de632e897ad83d3141d9d07f0313f7200
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-14 06:43:52 +00:00
Marc Mutz
26dca142a7 QtWidgets: use new QRect::transposed()
Change-Id: Idfed0ae6b80e301fd32206b2e6d68054460b76de
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-13 18:18:53 +00:00
Marc Mutz
8ce34c2e81 QRect(F): add transposed()
I didn't add a transpose(), because r = r.transposed() is
perfectly capable of filling that role, and just as
efficient. Existing API mistakes are no excuse to create
more of them.

[ChangeLog][QtCore][QRect/QRectF] Added transposed().

Change-Id: Ic38721e9028496fc9b50f4d4cef2e7a60532eed8
Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-13 18:18:48 +00:00
Marc Mutz
afc7da09ec QRegion: add move ctor
After this change, this was the distribution of calls in
QtGui and QtWidgets when the patch was developed for 5.4:

      QtGui  QtWidgets
move  23     63
copy  23     36

Change-Id: If3f536e52fc242c585e7fa0662049c0657efcc9c
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-13 18:18:32 +00:00
Friedemann Kleint
ac8a3b948d QtGui: Use QImage::constBits()/constScanLine() in non-const contexts.
Prevent potential detaching by using constBits()/constScanLine() instead
of bits()/scanLine().

Change-Id: If03f8d4d3b8ed4c07aed5eff7f580e57ca771919
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-13 08:17:00 +00:00
Andre Somers
0df5c366e5 Use QFlags::setFlag where prudent in qtbase
QFlags::setFlag is most useful to replace explicit constructs like

if (condition) {
   someFlags |= TheConditionFlag;
} else {
   someFlags &= ~TheConditionFlag;
}

with

someFlags.setFlag(TheConditionFlag, condition);

Change-Id: Ie4586681c83e0af812d5bbf14965aad51941a960
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-12 19:32:05 +00:00