Commit Graph

27206 Commits

Author SHA1 Message Date
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
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
Paolo Angelelli
c5d4972577 Fix for deferredDelete() bug when calling the glib loop directly
This patch makes sure that all events posted using Qt on top of the
GLib event loop have the loopLevel counter incremented.
This is done since Qt depends on the fact that all deleteLater() calls
are issued within the scope of some signal handler (in other words,
triggered by the chain sendEvent() -> notifyInternal2()).
There is a side effect though: in the conditions affected by this
patch, that is deleteLater()s issued within a glib event handler for
example, manually calling processEvents() or sendPostedEvents() with
or without the QEvent::DeferredDelete flag has the same effect, and
deferred deleted events are always processed.
While this is not a currently working feature which the patch breaks,
this side effect seems to be difficult to avoid without separating
sendPostedEvents() and processEvents() into a public and a private
method, in order to detect when they are manually called.
Such change could perhaps be done for Qt6.
An autotest for QTBUG-36434 is also included.
Autotesting for QTBUG-32859 seems to be more challenging in this
respect, due to its dependency on GLib.

Task-number: QTBUG-18434
Task-number: QTBUG-32859
Task-number: QTBUG-36434
Change-Id: Ib89175aa27c9e38bca68ae254d182b2cd21cf7e9
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2016-02-12 19:06:11 +00:00
Friedemann Kleint
9915630d08 QPlatformWindow::screenForGeometry(): Use mapToGlobal().
QPlatformWindow::mapToGlobal() should be used to obtain global coordinates
for foreign/embedded windows. They do not have a parent QWindow, but the
geometry passed in might be local to their native parent window.
For normal top-level windows, this is a no-op.

Task-number: QTBUG-50206
Task-number: QTBUG-41186
Change-Id: I00889b28db69ae65057f48b9e74bd4d8cfffa136
Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
2016-02-12 18:57:19 +00:00
Friedemann Kleint
966e893151 Windows QPA: Prefer const-versions of API where applicable.
Ensure no detaching occurs by using Container::constFirst()
and QImage::constScanLine().

Change-Id: Ie197d795d9329de8be76ed388ba2c71ccf201f5c
Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
2016-02-12 18:57:00 +00:00
Tor Arne Vestbø
9daeb6fe9d Generalize iOS simulator and device exclusive build
Preparation for Apple tvOS support, which shares a lot with the iOS
platform.

Change-Id: I543d936b9973a60139889da2a3d4948914e9c2b2
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-12 18:43:31 +00:00
Marc Mutz
7f48655fb8 QTextFrame::iterator: restore nothrow move special members
The user-defined copy assignment and copy constructors
inhibit the move special member functions.

We cannot do something about it in Qt 5, because the
class is exported (which it shouldn't be), and because
making it trivially-copyable might change how it is
passed to functions by value, so we need to supply all
the missing member functions manually.

Change-Id: Ic710b449f6abd386449fa6df71e8bc9bd0f98d2b
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-12 18:29:54 +00:00
Marc Mutz
6ffb0bdf60 QXmlStream*: make nothrow move assignable and -constructible
Unfortunately, we cannot rely on Q_DECL_EQ_DEFAULT, so I
needed to code the special member functions by hand.

The 'reserved' field is pretty useless, since the
existing ctors didn't initialize it, but just in
case someone finds a way how to store information
in there, deal with the field in the usual way:
set to nullptr in the move ctor and swap in the
move assignment operator.

Also schedule all this for removal again come Qt 6
(then without the reserved field).

This amends a83be780ae,
which only dealt with QXmlStreamAttribute.

Change-Id: I6898e5d0423c9519f7c07d23e2c6d2700508151e
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-12 18:29:50 +00:00
Marc Mutz
d06b4ca9a1 QBitmap: restore nothrow move special members
The user-defined dtor inhibits the move special member
functions.

We cannot do something about it in Qt 5, because the
class is exported (which it shouldn't be), and because
it's polymorphic (which it also shouldn't be), so we
need to supply all the missing member functions manually.

Add a note to remove the inheritance from QPixmap in Qt 6.

Change-Id: I86a1a3fe7b84247b3e604cb008aa17bb673c8468
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-12 18:29:46 +00:00
Maurice Kalinowski
62984d8918 Fix input pane usage on Windows 10 IoT Core
Running on Raspberry Pi casting to IInputPane2 fails with E_NO_INTERFACE
as there is no input pane available for the device.
However, if E_NO_INTERFACE is returned from the lambda, then deletion of
the ComPtr holding the AsyncAction in runOnXamlThread() crashes
somewhere deep internally of Release().

As we do not check for the return value anywhere, avoid the crash by
returning S_OK instead.

Change-Id: Icd38ec482b365285a482e5ff792ec1b4f13317d5
Reviewed-by: Andrew Knight <andrew.knight@intopalo.com>
Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
2016-02-12 18:03:53 +00:00
Sérgio Martins
70fb36e4bd docs: State that QMap::equal_range() returns an open-ended interval
Change-Id: If31dd078aeb92e479db8c1f0a5e58e56b549b5f6
Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-12 17:26:55 +00:00
Timur Pocheptsov
22d075fef0 Cocoa integration - suppress excessive dragginUpdated messages
Our abstract item views are using a timer before starting autoscroll.
Constant dragginUpdated (re)starts this timer again and again and it
actually never times out (== no autoscroll). It looks like  a bug in Cocoa since 10.11,
they test: respondsToSelector:@selector(wantsPeriodicDraggingUpdated:) with
':' at the end, though they need a method without parameters; as a result
QTBUG-32761 was re-introduced.

Let's make them happy and respond to this selector also (never gets called
actually).

Change-Id: I3b7bb0a455124f84c97fc350f69486bf0fc5d5fc
Task-number: QTBUG-32761
Reviewed-by: Jake Petroules <jake.petroules@theqtcompany.com>
2016-02-12 16:46:48 +00:00
Joerg Bornemann
707068bd66 Remove Windows CE build hacks from QWindowsPipeWriter
Those were added in ancient times to make QWindowsPipeWriter compile
on Windows CE. It was never used though.

Change-Id: Ica71b182f7ee4e47d9e33638d78475842b2ecdff
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-12 16:46:16 +00:00
Joerg Bornemann
3cf4c492c2 Document QWinOverlappedIoNotifier restrictions
Change-Id: I13cd14c29ddaf4c7423d672b0551081f87d8726b
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
2016-02-12 16:46:10 +00:00
Marc Mutz
448e9fdb57 Enable NRVO in QJsonObject::keys()
... for poor compilers (such as GCC).

The test (!d) was changed to match what other
member functions test for, e.g. toVariantHash().

Change-Id: I85aee0df6e50da3623ad0afce24abb586e0bd1bc
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-12 16:33:04 +00:00
Błażej Szczygieł
8dc55367ca QtGui: Avoid rgba64->rgba32 conversion on every pixel in gradient
Convert rgba64 color table to a new rgb32 color table only once. Use
this cache when required.

This patch can 2x speed up gradient painting using 32bit color format.

Task-number: QTBUG-50930
Change-Id: I9212e01e397c2e0127cdf3070cc49880a2d8df88
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@theqtcompany.com>
2016-02-12 16:20:36 +00:00
Anton Kudryavtsev
94f5ed11a1 QStringListModel: optimize container usage.
- don't call QList::removeAt() in loop. Just call erase() with two iterators.
- don't re-evaluate QList::count() because of result is already cached.

Change-Id: I4b3596df4a388f1d39b523c27decad612044cec6
Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
2016-02-12 14:15:10 +00:00
J-P Nurmi
5be4f95d95 Fix QFileSelectorPrivate::addStatics()
It must clear the previously cached sharedData->staticSelectors,
or else QFileSelectorPrivate::updateSelectors() does nothing and
the newly added static selectors end up being ignored.

Change-Id: If6997664629199be9f00de64c5dd01de2bf0a044
Reviewed-by: Mitch Curtis <mitch.curtis@theqtcompany.com>
2016-02-12 14:10:29 +00:00
Ariel Molina
2ee7541616 Optionally force delivery of TUIO pseudo touch events
TUIO is not a standard "device" as the first application takes
exclusive ownership, this patch makes it deliver the events to the root
window when the app is not focused, allowing for interactive
application development on simulators running on the same desktop.
To force delivery set the environment variable
QT_TUIOTOUCH_DELIVER_WITHOUT_FOCUS to 1

Change-Id: I157f59982a1b2025ef8efdf709fe40c78339c1b4
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-02-12 04:08:43 +00:00
Marc Mutz
10742cf894 QtGui: eradicate Q_FOREACH loops [const-& returns]
... by replacing them with C++11 range-for loops.

The function QObject::children() returns by const-reference,
so they can be passed to range-for without further changes.

Change-Id: I8cd2921165c45020914dd3a23b1f18b519fe7900
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 23:18:44 +00:00
Marc Mutz
37a933c2b1 QtGui: eradicate Q_FOREACH loops [needing qAsConst()]
... by replacing them with C++11 range-for loops.
To avoid detaches of these mutable Qt containers,
wrap the container in qAsConst().

Change-Id: I90fd517ad542ef92034403c15ebb8300a56ac693
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
2016-02-11 23:18:39 +00:00
Marc Mutz
d09cfe04b8 QtGui: eradicate Q_FOREACH loops [already const]
(or trivially marked const) ... by replacing them
with C++11 range-for loops.

Change-Id: I3cce92b9d77a3ff96fad877d1d989145e530646f
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 23:18:35 +00:00
Ariel Molina
3fa7035b53 Fixed bug preventing parsing of unbundled TUIO messages
Unbundled TUIO messages were being ignored. TUIO protocol
defaults to bundled but states it should work with any
Open Sound Control (OSC) implementation. Unbundled handling
was already in place, just fixed the logic to make it work.

Change-Id: I6d91449bd2069ac891e493fb7f50c010bcc3e8be
Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
2016-02-11 23:12:59 +00:00
Marc Mutz
257cc69bed Optimize string building in QImage::text()
- Don't iterate over QMap::keys(), but directly
  over the map, saving a temporary QList and
  double lookups.
- Always append the item separator, and chop
  it off once at the end, which allows to
  fold the separator into the existing string
  builder expression.

Change-Id: Ibd20ea292695098e0fc575025b1827a75aabfd1e
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
2016-02-11 19:26:11 +00:00