summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Check if socketEngine is set before accessing it.Fredrik de Vibe2016-03-042-1/+23
| | | | | | | | | | | | | | | | QTcpServer::addPendingConnection() is protected, so it is possible to add pending connections from a class derived from QTcpServer. This derived class can get a QTcpSocket from somewhere else, in which case d->socketEngine will not be set (or used). Given that it is possible to add pending connections in this scenario, it would make sense to be able to retrieve them as well. [ChangeLog][QtNetwork][QTcpServer] Permit using a QTcpServer with externally created QTcpSocket. Task-number: QTBUG-51288 Change-Id: I830c10f1a881e2bca4e4ad716d8be865e1c27a9f Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Use local result metric instead of global result metric.Milian Wolff2016-03-031-1/+1
| | | | | | | | This is required for a follow-up commit which adds support for reporting multiple results in a single benchmark interation. Change-Id: I8dd7f37ce046cc0f9556be5d0df76f84b82ec1a7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Optimize QMetaObject::activate.Milian Wolff2016-03-031-19/+30
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The code is restructured to only loop over the non-empty connection lists. This can be checked early while the mutex is locked already, thus removing mutex lock/unlock calls that were done previously just to realize the allsignals list is empty and can be skipped. Additionally, at the very end of the loop over the last signal connection list, the mutex was acquired even though it doesn't need to be as we will quit the loop anyways. This patch leverages these facts to remove the mutex locks which alone has a considerable impact on the corresponding signal/slot benchmark. The instruction count goes down by ca. 13%, while cycle count and runtime drop by about 29%. 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": 0.00000362 msecs per iteration (total: 362, iterations: 100000000) 14.05652884 CPU cycles per iteration (total: 1,405,652,884, iterations: 100000000) 21.00585673 instructions per iteration (total: 2,100,585,673, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(single signal/slot) RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/slot": 0.00004709 msecs per iteration (total: 4,709, iterations: 100000000) 183.75943370 CPU cycles per iteration (total: 18,375,943,371, iterations: 100000000) 362.08604759 instructions per iteration (total: 36,208,604,760, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(multi signal/slot) RESULT : QObjectBenchmark::signal_slot_benchmark():"multi signal/slot": 0.00004965 msecs per iteration (total: 4,965, iterations: 100000000) 183.54556242 CPU cycles per iteration (total: 18,354,556,243, iterations: 100000000) 362.07734835 instructions per iteration (total: 36,207,734,835, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(unconnected signal) RESULT : QObjectBenchmark::signal_slot_benchmark():"unconnected signal": 0.00000752 msecs per iteration (total: 752, iterations: 100000000) 30.08781366 CPU cycles per iteration (total: 3,008,781,367, iterations: 100000000) 92.01520465 instructions per iteration (total: 9,201,520,466, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(single signal/ptr) RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/ptr": 0.00005620 msecs per iteration (total: 5,620, iterations: 100000000) 219.24739264 CPU cycles per iteration (total: 21,924,739,265, iterations: 100000000) 327.08675555 instructions per iteration (total: 32,708,675,556, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(functor) RESULT : QObjectBenchmark::signal_slot_benchmark():"functor": 0.00005852 msecs per iteration (total: 5,852, iterations: 100000000) 218.45401359 CPU cycles per iteration (total: 21,845,401,360, iterations: 100000000) 328.08472410 instructions per iteration (total: 32,808,472,410, iterations: 100000000) PASS : QObjectBenchmark::cleanupTestCase() Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 44469ms ********* 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": 0.00000361 msecs per iteration (total: 361, iterations: 100000000) 14.01854817 CPU cycles per iteration (total: 1,401,854,818, iterations: 100000000) 21.00532932 instructions per iteration (total: 2,100,532,933, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(single signal/slot) RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/slot": 0.00003398 msecs per iteration (total: 3,398, iterations: 100000000) 132.52735104 CPU cycles per iteration (total: 13,252,735,104, iterations: 100000000) 314.04965106 instructions per iteration (total: 31,404,965,107, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(multi signal/slot) RESULT : QObjectBenchmark::signal_slot_benchmark():"multi signal/slot": 0.00003448 msecs per iteration (total: 3,448, iterations: 100000000) 133.63623046 CPU cycles per iteration (total: 13,363,623,046, iterations: 100000000) 314.04952237 instructions per iteration (total: 31,404,952,238, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(unconnected signal) RESULT : QObjectBenchmark::signal_slot_benchmark():"unconnected signal": 0.00000747 msecs per iteration (total: 747, iterations: 100000000) 29.02349389 CPU cycles per iteration (total: 2,902,349,390, iterations: 100000000) 92.01088221 instructions per iteration (total: 9,201,088,222, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(single signal/ptr) RESULT : QObjectBenchmark::signal_slot_benchmark():"single signal/ptr": 0.00004350 msecs per iteration (total: 4,350, iterations: 100000000) 167.83581885 CPU cycles per iteration (total: 16,783,581,885, iterations: 100000000) 279.06426656 instructions per iteration (total: 27,906,426,657, iterations: 100000000) PASS : QObjectBenchmark::signal_slot_benchmark(functor) RESULT : QObjectBenchmark::signal_slot_benchmark():"functor": 0.00004337 msecs per iteration (total: 4,337, iterations: 100000000) 170.45074743 CPU cycles per iteration (total: 17,045,074,743, iterations: 100000000) 280.06267229 instructions per iteration (total: 28,006,267,229, iterations: 100000000) PASS : QObjectBenchmark::cleanupTestCase() Totals: 8 passed, 0 failed, 0 skipped, 0 blacklisted, 33228ms ********* Finished testing of QObjectBenchmark ********* Change-Id: I6f79fd68ae7a07d9b439ca047bf1f53c83751d45 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Enable support for ref-cycles perf counter in QtTestLib.Milian Wolff2016-03-033-4/+13
| | | | | | | | | | | | The ref-cycles counter corresponds to the monotonic timestamp counter that can be read using the RDTSC assembler instruction. Using it instead of the default cycles counter is useful as it removes the effect of dynamic frequency scaling on the measurement. [ChangeLog][QtTest] The ref-cycles perf counter can now be used. Change-Id: Id7d56576db362706c20f9a399e5acea35ee799f2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtOpenGL/plugins/platformsupport: use new QRegion::begin()/end() instead of ↵Marc Mutz2016-03-0221-91/+61
| | | | | | | | | | rect() Saves e.g. ~900b and ~2900b in text size in QtOpenGL and XcbQpa libs, resp., on optimized GCC 5.3 Linux AMD64 builds. Change-Id: Id904689164ca32df41118a23747c70048d8e6604 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* QtWidgets: use new QRegion::begin()/end() instead of rect()Marc Mutz2016-03-0210-54/+33
| | | | | | | Saves ~600b in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: Ib542a128982fc53638780945014d903f2cbee9c3 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Fix QTextEdit/QQuickTextEdit undo bug - Part #2Dan Cape2016-03-022-6/+20
| | | | | | | | | | | | | | | | | | | | | | If a user selected the text "foo" and typed "bar", upon pressing undo, the text would change to "b". This is incorrect and does not match the functionality of QLineEdit or the default behaviours of Windows/OSX/Ubuntu. This was fixed by a change made to always merge two sequential inserts if they are not part of the same block. Previously the selection delete and the "b" were part of one edit block and "ar" was part of another. With this change, the selection delete and "bar" are part of the same edit block. Unit test changes are part of a separate review (Part #1) since they required changes in qtdeclarative. [ChangeLog][QtGui][Important Behavior Changes] Fixed QTextEdit to match undo functionality of QLineEdit to group two sequential inserts into one undo action. Task-number: QTBUG-38825 Change-Id: I76bf30e331e3526277c3e0ade58cf95b611fc117 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@theqtcompany.com>
* QAbstractSocket::flush(): remove manual polymorphismAlex Trotsenko2016-03-015-20/+21
| | | | | | | | ... by making a function in the private class virtual. Change-Id: I45c25c6c59511a8e8821ca96b0cf28cbf1b2f267 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Markus Goetz (Woboq GmbH) <markus@woboq.com>
* Report correct font underline position on OS XEskil Abrahamsen Blomfeldt2016-03-012-0/+8
| | | | | | | | | | | | Text was sometimes drawn without a proper gap between the baseline and underline. [ChangeLog][Text][OS X] Fixed underline position. Change-Id: I9b28d1ac39e18e8d98de92b354a1d635100853a9 Task-number: QTBUG-33708 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Use correct underline thickness on OS XEskil Abrahamsen Blomfeldt2016-03-012-0/+10
| | | | | | | | | | While the calculated underline thickness would be approximately correct for many fonts and sizes, it was sometimes incorrect, e.g. for 18 pt Helvetica. Found while investigating QTBUG-33708. Change-Id: Ic1d8f2d809c02235d8f15f0414536e04c2a7b844 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
* Use correct decoration for fallback font enginesEskil Abrahamsen Blomfeldt2016-03-011-2/+6
| | | | | | | | | | | The font engine itself specifies the line thickness, underline position etc. so we need to pass in the correct one, not the multi engine (which will just return whatever engine #0 prefers.) Change-Id: I2b2b92e7881df8a8310aedbc6efa304c3210c095 Task-number: QTBUG-33708 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* Merge "Merge remote-tracking branch 'origin/5.7' into dev" into refs/staging/devLiang Qi2016-03-0194-307/+885
|\
| * Merge remote-tracking branch 'origin/5.7' into devLiang Qi2016-03-0194-307/+885
| |\ | | | | | | | | | Change-Id: Ic7aaa06f4a14b1aed61faa1a6e7f527ee0eeb96b
| | * SSSE3 optimized store of 24-bit formatsAllan Sandfeld Jensen2016-02-294-14/+93
| | | | | | | | | | | | | | | | | | | | | | | | Using shuffle and align storing our quint24 format can be done much faster. This in particular improves conversions to RGB888. Change-Id: I179748706a33a43fd6f60f5c40287317418c8867 Reviewed-by: Gunnar Sletta <gunnar@sletta.org>
| | * Remove lib/fonts symlinking from configureLaszlo Agocs2016-02-291-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | The fonts directory is removed in 5.7. Avoid creating a broken symlink. Change-Id: I95d1970737f54810006c084436411fc95743f72d Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-02-2937-170/+456
| | |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qprocess/tst_qprocess.cpp Change-Id: Ib6955eb874b516b185b45d6c38cec646fbaa95f4
| | | * Track target widget when wheel events are receivedGabriel de Dietrich2016-02-299-24/+74
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This issue is reproducible on OS X when using a Magic Mouse or a combination of Magic Trackpad and regular mouse. In these cases it's possible to start a scrolling gesture on one widget and move the mouse cursor over another widget. Although we send the wheel event phase information, we never made any use of it. This means that a widget would start scrolling even though it never received a ScrollBegin event. In this patch, we make sure the scrolling cycle is respected and that once a widget starts scrolling, it'll be recieving all the wheel events until a ScrollEnd event reaches the application. For those input devices not supporting a proper phase cycle, we introduce a new (undocumented) phase value, NoScrollPhase. If the wheel event phase is NoScrollPhase, then we ignore the current scroll widget and proceed as usual. This value is the default for wheel events. It's up to the platform plugin to set the proper phase value according to the data received from the OS. Finally, we fix a few of QWheelEvent constructors to properly initialize the phase and source properties. Task-number: QTBUG-50199 Change-Id: I3773729a9c757e2d2fcc5100dcd79f0ed26cb808 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | | * Update QMAKE_LIB in win32-g++ mkspecBoris Pek2016-02-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | `ar' tool from latest binutils shows warning: ar error: `u' modifier ignored since `D' is the default (see `U') Warning message includes word "error" so QtCreator processes it as error in UI. `ar' command-line option `u' might be dropped safely because it is unnecessary. Option `c' is added to suppress extra `ar' warnings. Other build systems are also affected. For example, automake: https://bugzilla.redhat.com/1155273 Change-Id: Ia378b720503d93b0c0c12ae7a5f38f4d7c32eee5 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | | * tst_QDialog::snapToDefaultButton(): Do not check on exact cursor position ↵Friedemann Kleint2016-02-261-12/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | unless hint is set. Given the flakyness of cursor positioning, loosen the check to only verify that the cursor is outside the window. The hint is only active on Windows depending on a system setting. Task-number: QTBUG-51516 Change-Id: I474d251cc41e68f182baf8dba84eaf38d914d7ee Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | | * QPlatformWindow::screenForGeometry(): Do not call mapToGlobal() on top level ↵Friedemann Kleint2016-02-261-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | geometry. Use mapToGlobal() only for foreign windows passing relative coordinates. Amend change 9915630d0886434e8984904b1cadedc81dc78ca0. Task-number: QTBUG-50206 Task-number: QTBUG-51320 Change-Id: Idee60cc8ea8004c0355ce78a00f807798836b49c Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | | * Remove a mis-placed QSKIP().Edward Welbourne2016-02-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It made us skip the rest of the test, not just the small set of sub-tests that were conditioned by the if () in whose else it sat. Change-Id: I5e914e0aeb9d5ba44b21966d071aaccbc590365d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| | | * tst_qguimetatype::flags(): port to QTypeInfoQueryMarc Mutz2016-02-261-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QTypeInfoQuery was introduced for 5.6 to decouple isStatic and isRelocatable so old code continues to work. But since this test still uses !isStatic to mean trivially-relocatable, it will fail as soon as one of the checked types is marked as Q_RELOCATABLE_TYPE instead of Q_MOVABLE_TYPE. Incidentally, such a change is in the pipeline for Qt 5.7/5.8, so fix the test by porting to QTypeInfoQuery. Do this in 5.6, because that's when QTypeInfoQuery was introduced. Change-Id: I06f815f26ca9b430e124c4a2f8de2a729999762b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | | * Win: Prevent crash in qt_message_fatal()Kai Koehne2016-02-261-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The source argument can be nullptr, e.g. if debug information has been stripped out. Task-number: QTBUG-51195 Change-Id: Ie229c82278c420200cad33c19e8c3f52ab7f12c3 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | | * Windows Accessibility: Fix warnings as shown by Qt Creator's Clang based ↵Friedemann Kleint2016-02-265-59/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | code model. Introduce C++ casts and add some conversions. Where possible, increase const-correctness. Remove trivial conversion function BSTRToQString(). Task-number: QTBUG-50804 Change-Id: I1820d4693db8bc0dfa6c4a5fecd768cf64a4405c Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | | * Windows Accessibility: Refactor code creating COM arrays.Friedemann Kleint2016-02-261-18/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Introduce a convenience function for allocating arrays and use algorithms. Task-number: QTBUG-50804 Change-Id: Iead75f8297923fd13efcfc7987f76262777d074b Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | | * Fix potential crash in QWindowsIA2Accessible::QueryInterface().Friedemann Kleint2016-02-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QWindowsIA2Accessible does not implement IAccessibleRelation (found when replacing the C-style casts by static_cast<>). Remove the corresponding branch. Task-number: QTBUG-50804 Change-Id: I80901634044f85e413666f34b91be2e6ad70da91 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | | * Windows QPA: Apply scaling when fixing maximized/frameless geometry.Friedemann Kleint2016-02-261-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-8361 Task-number: QTBUG-51327 Change-Id: I590702df8f6313701fe69d0873657c6af53fee16 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| | | * Fix QHighDpi::fromNative(QRect, QScreen *, QPoint).Friedemann Kleint2016-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Call fromNative() instead of toNative(). Task-number: QTBUG-46615 Change-Id: I1e648a2680126d1f560e71573f7346b053fe676b Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | | * Windows QPA: Fix scrolling down with mouse wheel.Friedemann Kleint2016-02-261-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use GET_WHEEL_DELTA_WPARAM() instead of HIWORD and casting. Fix breakage introduced by b20548f9999d8c111268f3f2287c0801c6c5cbb0 . Change-Id: I11bd97d73c12d72e824e3f769e9c402975f27d48 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | | * QWindowsTheme: Run SHGetFileInfo() in a thread.Friedemann Kleint2016-02-264-12/+165
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows 10: SHGetFileInfo() (as called by item views on file system models has been observed to trigger a WM_PAINT on the mainwindow for totally obscure reasons, causing a recursive repaint. Suppress this by running it via QThreadPool. Task-number: QTBUG-45298 Task-number: QTBUG-48823 Task-number: QTCREATORBUG-14888 Change-Id: I7479102b9b8fb0771681260298c3d735e66f220f Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| | | * QScreen::grabWindow(): Scale the coordinates.Friedemann Kleint2016-02-262-3/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The coordinates need to be scaled before calling QPlatformScreen::grabWindow() On return, set a devicePixelRatio on the pixmap. Adapt the QWidget test to scale the grabbed pixmaps. Fixes pixeltool displaying the wrong part of the screen when High DPI scaling is in effect. Task-number: QTBUG-46615 Change-Id: I12de7df0da669230cf0fae74f4a42d43f061d5ff Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | | * QMacPrintEngine: Really set the printer resolutionKai Pastor2016-02-252-3/+29
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As already reported in 2009 (Qt 4.6) QPrinter never actually set the printer resolution. This change adds the necessary call to PMPrinterSetOutputResolution (available since OS X 10.5). [ChangeLog][QtPrintSupport][OS X] QMacPrintEngine now really sets the printer resolution. Task-number: QTBUG-7000 Change-Id: I3e851b62e1a7ed78564a8a6fd576b0a18d7eff63 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com>
| | | * Add missing initializations in QWheelEventJan Arve Sæther2016-02-251-3/+6
| | | | | | | | | | | | | | | | | | | | Change-Id: I77f014934b97aa6729d568996f0e6c03feb44588 Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
| | | * Fix QDBusPlatformMenu::menuItemAt()J-P Nurmi2016-02-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Other platform menu implementations check that the index is not out of bounds, so make QDBusPlatformMenu::menuItemAt() do the same. Change-Id: I1d2e42681f2dbfff8b80044141d620bddbc3b6aa Task-number: QTBUG-51372 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com>
| | | * QWindow: Use scaling when calling QPlatformWindow::mapTo/FromGlobal().Friedemann Kleint2016-02-251-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The platform window API uses native pixels. Task-number: QTBUG-50206 Change-Id: I1385d34bb0eacd61d77cad483e2a863d129ed129 Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com>
| | | * QSqlDriver::sqlStatement: documentation fixMark Brand2016-02-241-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I12bd612c48020594b5377b04aeccc51f7c4be53d Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Vyacheslav Grigoryev <armagvvg@gmail.com>
| | | * Remove legacy from tst_qprocess.cppJoerg Bornemann2016-02-241-8/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The windows.h include is not needed, the enums are properly known to the metaobject system nowadays, and qprocess_p.h already has a QT_NO_PROCESS guard. Change-Id: I6bbdce19f097feb8260c51a29425279049aa0192 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | | * tst_QProcess: Transform loop into additional test rowsJoerg Bornemann2016-02-241-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Do not use a loop to execute similar but separate tests in tst_QProcess::softExitInSlots. Use separate test rows with distinguishable data tags instead. This way we can deduce from CI output which part of this test failed. Change-Id: Ic9bc996f2ced11b2bb1c33c1970e64937d860976 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| | | * QPixmap: check data ptr in isQBitmap()Anton Kudryavtsev2016-02-242-1/+10
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Task-number: QTBUG-51271 Change-Id: I670e074ced1217d2614fa334eb365e40ef80b8b1 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | QtTest: eradicate all Q_FOREACH loopsMarc Mutz2016-02-293-9/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 ramge-for loops. In one case, I took the liberty to remove a useless if(isEmpty()) check around a for loop. Now that we don't use Q_FOREACH anymore, we don't incur the copy for empty containers anymore. Left the indention of the loop level to avoid code churn. Saves 1.8KiB in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I1b1fb34847f6a631f0d580fd5261c7f5fed8475c Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | QVector: preserve capacity in clear()Marc Mutz2016-02-2912-21/+31
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is what std::vector implementations usually do, because it minimizes memory fragmentation and useless allocations since no user will call clear() unless she intends to append new data afterwards. Fix calls to resize(0) that show how existing code tried to work around the issue. Adjust test. Port from QVERIFY(==) to QCOMPARE as a drive-by. [ChangeLog][QtCore][QVector] clear() now preserves capacity. To shed capacity, call squeeze() or swap with a default-constructed QVector object, see the documentation for an example. Change-Id: I9cebe611a97e027a89e821e64408a4741b31f1f6 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * | QtWidgets: eradicate Q_FOREACH loops [rvalues]Marc Mutz2016-02-289-22/+41
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by replacing them with C++11 range-for loops. This is the simplest of the patch series: Q_FOREACH took a copy, so we do, too. Except we don't, since we're just catching the return value that comes out of the function (RVO). We can't feed the rvalues into range-for, because they are non-const and would thus detach. Saves 2.2KiB in test size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I914aa20fe65577b2e32ea7ea89d51a8d003a57ba Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | QtWidgets: eradicate Q_FOREACH loops [QVarLengthArray, std containers]Marc Mutz2016-02-282-4/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Q_FOREACH over a QVarLengthArray or std containers is a particularly bad idea (because of the deep copy that Q_FOREACH then performs). Use C++11 range-for (without qAsConst(), because neither QVLA nor std containers are CoW). Saves 5.7KiB in text size on optimized GCC 5.3 Linux AMD64 builds. Change-Id: I4c1fb0b488bb08726912528b559840a45c1397df Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | QtWidgets: prevent detach attempts from first()/etc. use [dialogs, kernel, ↵Marc Mutz2016-02-2614-42/+51
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | util, widgets] The algorithm used was: - If possible, just declare the container const - Otherwise, for first()/last(), use constFirst()/constLast() and for front()/back(), to not destroy the use of the STL API subset, use qAsConst() Did some caching of function returns here and there, and converted one 0 to nullptr as a drive-by. Also saves almost 4KiB in text size on optimized GCC 4.9 Linux AMD64 builds. Change-Id: I04b7bfd68dc85c22de247cb65a310e1cbbca1e8c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | Fix warnings about constructor initialization order in tst_QObject.Friedemann Kleint2016-02-261-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | tst_qobject.cpp: In constructor 'DispatcherWatcher::DispatcherWatcher(QEventLoop&, int*, int*)': tst_qobject.cpp:5871:10: warning: 'DispatcherWatcher::m_statusAboutToBlock' will be initialized after [-Wreorder] tst_qobject.cpp:5870:10: warning: 'int* DispatcherWatcher::m_statusAwake' [-Wreorder] tst_qobject.cpp:5815:5: warning: when initialized here [-Wreorder] tst_qobject.cpp:5870:10: warning: 'DispatcherWatcher::m_statusAwake' will be initialized after [-Wreorder] tst_qobject.cpp:5869:17: warning: 'QEventLoop* DispatcherWatcher::m_eventLoop' [-Wreorder] Amends change c5d49725779292a04fed599eb7f508d334ffc5c3. Task-number: QTBUG-18434 Task-number: QTBUG-32859 Task-number: QTBUG-36434 Change-Id: I03a9c872469334741a26b4dc1783a36d48f1556f Reviewed-by: Paolo Angelelli <paolo.angelelli@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | qmake: restore nothrow move special membersMarc Mutz2016-02-261-0/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The user-defined copy assignment, copy constructor and dtor inhibit the move special member functions. Implement them manually. Change-Id: I0d38d7cf6c9611e13b5b081d734d01d6fe4d5276 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | ItemModels: replace QLatin1String with QStringLiteralAnton Kudryavtsev2016-02-262-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... wherever it allocates memory. Since the string literal is used in more than one function, to avoid duplication of .rodata, wrap the QStringLiteral in an inline function. Change-Id: If4fca7443b3150b1c8360c850da32f5c567c1065 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * | QCocoaKeyMapper - correctly update key layoutsTimur Pocheptsov2016-02-251-7/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QCocoaKeyMapper has 2 bugs: - fails to update layouts even if input source changed - while looking for the possible keys it clears bits for neededMods thus making later shortcut match impossible Change-Id: Ie230b973acd5ca6f50b97ca4901ede61b581d273 Task-number: QTBUG-50865 Reviewed-by: Andy Shaw <andy.shaw@theqtcompany.com> Reviewed-by: Morten Johan Sørvig <morten.sorvig@theqtcompany.com> Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com>
| | * | Add We-mean-it comment to qnetworkdatagram_p.h.Friedemann Kleint2016-02-251-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Fix warning: WARNING: qtbase/src/network/kernel/qnetworkdatagram_p.h does not have the "We mean it." warning Change-Id: I65fc2dc9129b194b08865e3486fae4d0cad3f3d3 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * | Improve QCOMPARE output of char comparisonsAllan Sandfeld Jensen2016-02-251-1/+47
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Make actual and expected values of char tests more useful by using C syntax. This means we can actually read non-printable characters. Task-number: QTBUG-51294 Change-Id: I031e15916a2882c0499b6217ae1649d4eea09eb4 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>