summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* QScoped(Array)Pointer: canonicalize swappingMarc Mutz2016-05-041-11/+9
| | | | | | | | | | | | | | | | | | | | This includes: - have nothrow member-swap - have ADL non-member swap - not specialize qSwap or std::swap Also prevent QScopedPointer <-> QScopedArrayPointer swaps by overloading swap (both member and non-member) on QScopedArrayPointer. It's not 100% safe, but it's what we're doing elsewhere (QMulti(Map,Hash), say). That's technically a SiC change if users expected (qualified) std::swap to invoke QScopedPointer::swap(), but those users were doing it wrong to begin with, and they now get a compile-error instead of silent pessimization, because generic std::swap() doesn't work on QScopedPointer, due to lack of copy (and thus move) semantics. Change-Id: I3ab5c1668722a2c8ccafc16f57310ce8d4bffbd6 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtNetwork: eradicate Q_FOREACH loops [rvalues]Marc Mutz2016-05-0417-25/+46
| | | | | | | | | | | | | ... 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. Change-Id: I42c9c44d948ab1512a69d42890187bc3cf2d7e58 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Support color font rendering for freetype engineJian Liang2016-05-034-127/+288
| | | | | | | | | | | | | | | | | | This patch mainly do two things: 1) Support color bitmap font for freetype fontengine. This partially based on Corentin Jabot's patch 2) Support ARGB opengl glyph cache when workaround_brokenFBOReadBack is true (It is always true under Android). Some code refactor has been done in QOpenGLTextureGlyphCache. This patch also bump the minimal required freetype version to 2.2 [ChangeLog][General][Freetype] Support color font rendering Task-number: QTBUG-35156 Change-Id: I35aae5f98ba9a27b70a48db3f2647fc070c39c33 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Fix plugin name for eglfs' GBM backendLaszlo Agocs2016-05-031-1/+1
| | | | | | | | | | In 5.7 the Gbm prefix was added but the .pro file was not updated. This breaks static builds. Task-number: QTBUG-53136 Change-Id: I37af46ff768bf8c1dc9269892db25d61b76c0376 Reviewed-by: Dominik Holland <dominik.holland@pelagicore.com> Reviewed-by: Louai Al-Khanji <louai.al-khanji@qt.io>
* Tune fast-exit for signal activation for QML.Erik Verbruggen2016-05-032-11/+20
| | | | | | | | | | | | | When using QML, it quite often happens that only the QML engine is connected to a signal, and no C++ handlers. By splitting up the fast-exit case and handling QML separately, we can prevent a call to QThread::currentThreadId, and locking+unlocking the mutex. On x86 this saves ~130 instructions according to valgrind. Change-Id: I947fe42afe351922339ac982a6d498bc2f7b5192 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Fix MinGW 5.3.0 build of ANGLEOliver Wolff2016-05-022-4/+9
| | | | | | | | | | | | | | D3D11_QUERY_DATA_SO_STATISTICS is no part of d3d11sdklayers.h and thus not covered by the ANGLE_MINGW32_COMPAT define. The struct is defined in d3d11.h and will be available in an upcoming version of MinGW (see https://sourceforge.net/p/mingw-w64/mingw-w64/ci/a0cd5afeb60be3be0860e9a203314c10485bb9b8/ ). As soon as the MinGW version that includes the change is known, the __MINGW32__ check should be replaced by a proper version check. Change-Id: I774f24432b375fdf9c559449f266cc04a4905275 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Add Qt::ImInputItemClipRectangle support to widgetsJan Arve Saether2016-05-023-2/+15
| | | | | | | | Let widgets respond to ImInputItemClipRectangle inputMethodQuery and notify about potential changes with QInputMethod::update() Change-Id: I01b2c53273df207d26107b237a7096fe53d1b0a5 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Add QInputMethod::inputItemClipRectangle()Jan Arve Saether2016-05-022-0/+18
| | | | | | | | This property allows a convenient way of getting notified about changes in the input item clipped rectangle, similar to QIM::cursorRectangle(). Change-Id: I26bf97eeb1f5ef1b7d3aafb03565023091d6df3d Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Add ImInputItemClipRectangleJan Arve Saether2016-05-022-0/+4
| | | | | | | | | | | This rectangle represents the "effective" visual rectangle of the input item, excluding any areas obscured due to clipping. Note: The effective visual rectangle will not be influenced by overlapping items. Change-Id: I234176161dcfb9c236124e33ae510a0b01fe6dc3 Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@theqtcompany.com>
* Merge "Merge remote-tracking branch 'origin/5.6' into 5.7" into refs/staging/5.7Liang Qi2016-05-0238-135/+265
|\
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-04-2938-135/+265
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qml_module.prf mkspecs/features/qt_common.prf src/gui/text/qzip.cpp src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/windows/array.h src/testlib/qtestcase.cpp src/widgets/dialogs/qfilesystemmodel.h Change-Id: Ie41c5868415b81f7693c80e045497035504bb210
| | * Fix scroll regression near scroll-view endsAllan Sandfeld Jensen2016-04-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Fix regression in a7b0cb467ca5c4a9447d049910c9e3f0abc5897c which caused it to be hard to start scrolling at the ends of a scroll-view if using fine grained scrolling events. Change-Id: I55f3210150b993281545c3ad5a7356d892fa30b5 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * Make it clear that QObject::tr() falls back to QString::fromUtf8()Sérgio Martins2016-04-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | The reference to trUtf8() made it even more confusing, so remove it. It's redundant and deprecated anyway. Change-Id: I9921297160db3660bb5099692bbfdaf6e85637aa Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| | * qstyle: Make image description match the image.Sérgio Martins2016-04-281-2/+2
| | | | | | | | | | | | | | | | | | | | | The image shows 9 combo boxes, not 8. Change-Id: If229332e1708f624ad9f50fab0b78c011d94f31e Reviewed-by: Martin Smith <martin.smith@theqtcompany.com>
| | * QPdf: Force miter limit into valid rangeKai Pastor2016-04-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Miter limits below 1.0 are not valid in PDF and trigger an error in the Reader. This change enforces a minimum miter limit of 1.0, and it adds a manual test for producing a PDF file demonstrating this issue. Task-number: QTBUG-52641 Change-Id: I1c78b1c4a44579e95e1cddfb459926d304e60165 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * Unhide QObject::parent() from QFileSystemModel and QIdentityProxyModelAlexander Volkov2016-04-282-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It was hidden by overridden parent(const QModelIndex &) methods. See also 63b5082ea8e3e750af986f815474f7207006cb46 (Unhide QObject::parent() from QAbstract{Table,List}model). Change-Id: I8b6d4d4175e4d43ff269eaeb0b2b1a9fb8f44bab Task-number: QTBUG-45393 Reviewed-by: Milian Wolff <milian.wolff@kdab.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * QtDBus: finish all pending call with error if disconnectedWeng Xuetian2016-04-284-6/+42
| | | | | | | | | | | | | | | | | | | | | | | | | | | libdbus will send a local signal if connection gets disconnected. When this happens, end all pending calls with QDBusError::Disconnected. Task-number: QTBUG-51649 Change-Id: I5c7d2a468bb5da746d0c0e53e458c1e376f186a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * winrt: Refactor pointer device handling to support penMaurice Kalinowski2016-04-281-30/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In addition to pen events being handled as tablet events, we create touch events. Same principle is used on other platforms as well. This allows devices as Surfaces to use the pen with Qt applications. Furthermore, the first update event does not have to be a press event, as in a pen has proximity values describing a move without touch, but also the HoloLens uses touch points as permanent pointer devices. They all send an exit event once released or out of range. Hence, clean up the internal touchpoint hash when the touch device is gone, not on release. Task-number: QTBUG-38681 Change-Id: I38acaa034a3cfe224098bfa36bfead5428f4db16 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | * winrt: Fix memory leak for file readingMaurice Kalinowski2016-04-281-3/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | IInputStream::ReadAsync might create a separate buffer to fill in data. Passing a buffer with GetAddressOf() can cause a memory leak of the size of data to be read. Instead, pass a separate buffer pointer and continue to use this one after the async operation. This way, the OS can decide whether to switch buffers or not, keeping ref counting in sync. Task-number: QTBUG-52961 Change-Id: I9dfb627287142355ebcf74ca52427b4e8108e8d1 Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
| | * Fix clang developer build due to -Winconsistent-missing-overrideSérgio Martins2016-04-281-8/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | The existing code keeps the overrides from each base class together, so also move them to the correct group after adding Q_DECL_OVERRIDE. Change-Id: I5d89fb4e7f9454ab0c9c6383f8245e64b95e84e9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Use C++11 alignas() for Q_DECL_ALIGN, if possibleThiago Macieira2016-04-281-0/+5
| | | | | | | | | | | | | | | Change-Id: Ifea6e497f11a461db432ffff144863d4ed69a212 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Fix QArrayData::allocate() to guard against integer overflowsThiago Macieira2016-04-281-3/+10
| | | | | | | | | | | | | | | | | | | | | The proper solution with qCalculateBlockSize will come for Qt 5.7. Change-Id: Ifea6e497f11a461db432ffff14490788fc522eb7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Fix clipping of wave underline decoration on certain fontsAllan Sandfeld Jensen2016-04-271-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Limit the height of the the wave-pixmap so that fillRect doesn't clip it. At the same time the precision of the generated wave-pixmap is improved so it better fits the requested radius. Task-number: QTCREATORBUG-15851 Change-Id: If754387b20ab7b015857ecb0a0e8fe16de1d728a Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * Micro optimization to QFontconfigDatabaseKonstantin Ritt2016-04-271-12/+12
| | | | | | | | | | | | | | | | | | | | | | | | Do not set WritingSystem supported just to unset it afterwards; test in-place and fallback gracefully. Change-Id: I6910019c08fcf3909b924c27271547aae2ea0ff1 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * Get rid of requiresOpenType() helperKonstantin Ritt2016-04-271-14/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is already an array of writing systems for which GSUB|GPOS table is required (also rename it from "openType" to "capabilityForWritingSystem", to reflect its meaning). Change-Id: I7cfd4a80d5ca13f9312b3644b2bd738d6015c71c Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * Query FC_CAPABILITY once per patternKonstantin Ritt2016-04-271-2/+3
| | | | | | | | | | | | | | | Change-Id: I5f1219d5a476f1bd09e8c01847fe886f342b28a0 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * Check for required capability only when FC_CAPABILITY is availableKonstantin Ritt2016-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | If, by some reason, querying FC_CAPABILITY has failed, believe FC_LANG unconditionally. Change-Id: Idf94150359dff555f2a50ccaf146722407f43477 Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
| | * QFileDialog: Fix single-click activationPalo Kisa2016-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In QFileDialogPrivate::_q_enterDirectory() the QStyle::styleHint() for QStyle::SH_ItemView_ActivateItemOnSingleClick was called w/o the widget. By such usage the possible StyleSheet setting was ignored, e.g. "QAbstractItemView { activate-on-singleclick: 1; }". Task-number: QTBUG-50871 Change-Id: I7a32c4841db7113f32c3823581c2becc1677e3cc Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * QCocoaMenu: Have the menu delegate return the right amount of itemsGabriel de Dietrich2016-04-271-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In some cases we move menu items around, therefore we should not rely on QCocoaMenu::items() being the actual items inside the menu. But, since the NSMenu is updated before hand, we can rely on NSMenu.numberOfItems instead. Change-Id: Icd4497beca4f52a6d38408eeaa2e6ec71b579685 Task-number: QTBUG-52931 Reviewed-by: Timur Pocheptsov <timur.pocheptsov@theqtcompany.com> Reviewed-by: Eike Ziller <eike.ziller@qt.io> Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * testlib: added env QTEST_FUNCTION_TIMEOUT for single test function timeoutLiang Qi2016-04-271-1/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a regression with 5.5, it causes some customer test functions crash. d3d10cf2 introduced the 5 minutes timeout. The timeout could be changed after this. Task-number: QTBUG-52402 Change-Id: I8940bbde5004b4d888732b551274f079ddf20563 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
| | * QSslSocket: remove unused variable in q_X509Callback()Marc Mutz2016-04-261-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | It's been unused ever since it was added in bba86a01c9828d03b1564984a08561d62686d329. Change-Id: I6d5bc27a0744d37f873245c92a4e6ba8fc90c062 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| | * QString: Fix UBs (signed overflow) in hashed string searchMarc Mutz2016-04-261-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Similar change to 390ea21873cf229447c2dcaea85a40e472fab03c, but more extensive because the hash variables were not, yet, of unsigned type. This brings the three hashed string search algorithms in QtBase (in QString, QByteArray and QByteArrayMatcher) in line again. Found by UBSan, fixing the following bunch of errors: tools/qstring.cpp:3080:38: runtime error: left shift of negative value -1291179264 tools/qstring.cpp:3081:42: runtime error: left shift of negative value -1291179264 tools/qstring.cpp:3091:13: runtime error: left shift of 73 by 26 places cannot be represented in type 'int' tools/qstring.cpp:3091:13: runtime error: left shift of negative value -1255957171 tools/qstring.cpp:3091:13: runtime error: signed integer overflow: 1783052986 - -1207959552 cannot be represented in type 'int' tools/qstring.cpp:3097:37: runtime error: left shift of negative value -1298753576 tools/qstring.cpp:3098:41: runtime error: left shift of negative value -1298753576 tools/qstring.cpp:3107:13: runtime error: left shift of negative value -1508912760 tools/qstring.cpp:3158:38: runtime error: left shift of negative value -677037574 tools/qstring.cpp:3159:42: runtime error: left shift of negative value -677037574 tools/qstring.cpp:3169:13: runtime error: left shift of negative value -1657715810 tools/qstring.cpp:3173:38: runtime error: left shift of negative value -677037574 tools/qstring.cpp:3174:42: runtime error: left shift of negative value -677037574 tools/qstring.cpp:3183:13: runtime error: left shift of negative value -1657715810 Change-Id: I1436eb61369919df9fe34251f863dd54fb58af98 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Silence MSVC warnings when using certain std algorithmsMarc Mutz2016-04-2610-14/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The MSVC STL warns when passing naked pointers as non-bounded iterators to algorithms such as std::equal and std::copy, in an attempt to inform users that the range specified by that iterator has an implicit minimum size that the caller of the algorithm must ensure is met: warning C4996: 'std::_Equal1': Function call with parameters that may be unsafe - \ this call relies on the caller to check that the passed values are correct. To \ disable this warning, use -D_SCL_SECURE_NO_WARNINGS. See documentation on how to \ use Visual C++ 'Checked Iterators' When building Qt, as well as when building user projects with qmake (cf. 0a76b6bc7f98900ea884cd10ccca1a332e5bdba5), we globally disable this warning (with -D_SCL_SECURE_NO_WARNINGS), but since we started using STL algorithms in public headers (e.g. in qvector.h), users get this warning in their own projects now, unless they, too, define said macro. But such a requirement is against the Qt policy to have headers that are warning-free as much as possible. The suggested way of fixing this warning is to wrap the naked pointer in a stdext::unchecked_array_iterator before passing it to the algorithm, cf. examples in https://msdn.microsoft.com/en-us/library/ttcz0bys%28v=vs.120%29.aspx or, together with the capacity-made-explicit, in a stdext::checked_array_iterator. To avoid ifdefs for platforms that don't have these extensions (which, incidentally, for the unchecked case, includes MSVC 2012), wrap the calls in macros. The end game here is to drop -D_SCL_SECURE_NO_WARNINGS, at least for public headers, even though this commit also adds the wrapper to implementation and private header files. An alternative to the wrapper would have been the version of std::equal that takes four iterators. However, that is a C++14 library feature, while this version of Qt still needs to compile with a C++98 compiler, and, more importantly, there isn't, and never will be, a corresponding 4-iterator version of std::copy. Task-number: QTBUG-47948 Done-with: Stephen Kelly <steveire@gmail.com> Change-Id: I1bbab257fb5f1c5042939c382a412b596112ff26 Reviewed-by: Stephen Kelly <ske@ableton.com>
| | * Windows QPA/High DPI: Scale accessibility coordinates.Friedemann Kleint2016-04-262-4/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | Use High DPI when interfacing with the Accessibility API. Task-number: QTBUG-52943 Task-number: QTBUG-50991 Change-Id: Ica4489222dca5d58864172470e634f709deb69f8 Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * OSX: mark mouse events from tablet devices as synthesizedShawn Rutledge2016-04-262-6/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is equivalent to d7db6c6c1944894737babf3958d0cff1e6222a22 on the xcb platform. Task-number: QTBUG-51617 Change-Id: I837a764c8382244307ba6aa02bd8bde12bd08bff Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io>
| | * QZipReader - test that QFile::open was, indeed, successful.Timur Pocheptsov2016-04-261-4/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | Coverity, CIDs 10917, 10918. This fix looks like purely cosmetic and unneeded: we check f->error() after f->open(). Unfortunately, f->open() can fail without setting an error (if you provided an invalid mode). Change-Id: Idbfcb9305b3f004e5e425cb6076b41e193b8d473 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
| | * Change scroll and text areas to respect native wheel focus ruleMarko Kangas2016-04-263-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtWidgets][QAbstractScrollArea,QTextEdit,QPlainTextEdit] Changed focus to Qt::StrongFocus. That respects platforms' native guidelines. Task-number: QTBUG-52559 Change-Id: I2aa25d25bbc15facce85ceb7d4a4c1d0ac7df962 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Add missing initializersTimur Pocheptsov2016-04-251-0/+2
| | | | | | | | | | | | | | | | | | | | | Coverity, CIDs: 10724, 10725. Data member _iterator is not initialized. Change-Id: I0c94f5cef031e208aab1687209282fae0317f0ab Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| | * xcb: Fix drag and drop to applications like Emacs and Chromium.Urs Fleisch2016-04-251-11/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Drops without matching time stamp do not work. I have fixed the issue by reanimating the findXdndAwareParent() function (adapted to XCB) and using it to find a matching transaction if all else fails. Task-number: QTBUG-45812 Change-Id: Ibca15bbab02ccf2f25280418e9edf36972ebf9a0 Reviewed-by: Błażej Szczygieł <spaz16@wp.pl> Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@theqtcompany.com>
* | | QDateTime: use default ctor to create invalid objectAnton Kudryavtsev2016-04-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Don't perform some internal init functions. Change-Id: I9986e7a8adab35499aea804d1019012547aefd5d Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QDateTimeParser: enable RVO in format()Anton Kudryavtsev2016-04-301-4/+1
| | | | | | | | | | | | | | | | | | Change-Id: I3d9f84d03519b2b8fb37c7d2e773e68bc4b9a1d3 Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Don't bother asking if Linux supports a monotonic clock: it doesThiago Macieira2016-04-301-1/+5
| | | | | | | | | | | | | | | | | | Change-Id: Id5480807d25e49e78b79ffff144a0e61bd001dff Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* | | Decompress QResources only when needed.Volker Krause2016-04-301-9/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In particular, just creating a QFileInfo (or a QDirIterator, which uses QFileInfo internally) no longer triggers decompression. This doubles the performance when using a QDirIterator/QFile combo for loading a bunch of files. Change-Id: I7f53354e890ad6360693b7848d21a0cd5d595628 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Android: Bring back the useful public varsBogDan Vatra2016-04-301-5/+35
| | | | | | | | | | | | | | | Change-Id: I2e4acb12ed376ed8afad72abdd10243549413feb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | QWidgetTextControl: only show cursor when having focusRichard Moe Gustavsen2016-04-302-6/+18
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Commit d3dcc6f introduced a regression to QTextEdit, leaving it to always show the cursor regardless of focus. The reason is that QTextArea used to toggle visibilty by setting the cursor blink rate. What it really wanted to do was to set cursor visibility explicit. This patch implements function setCursorVisible, and updates the places that used to call setBlinkingCursorEnabled to instead call setCursorVisible (where it makes sense). Change-Id: I58ea965178d4faaf5b09f6f6a37a37d5e8b99c97 Reviewed-by: Jan Arve Sæther <jan-arve.saether@theqtcompany.com>
* | | Android: Fix style extract on Android NBogDan Vatra2016-04-301-1/+8
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-52744 Change-Id: If53a76929f3bc903573917cfd968431532817ace Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | xcb: support nested paint operations in remote scenariosLouai Al-Khanji2016-04-292-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Recent changes to the xcb platform plugin added logic to paint to a server-side X Pixmap when the MIT-SHM extension is unavailable. Those changes also added logic to keep track of the dirty areas that need to be flushed to the server from the backing store when the backing store is flushed to a window. Because a single QRegion was used to track those areas, nested paint operations no longer accurately tracked all the dirty areas. Consider: void Widget::paintEvent(QPaintEvent *) { QPainter p1(this); for (int i = 0; longRunningOperationInProgress(); i++) { QPixmap pixmap(size()); QPainter p2(&pixmap); p2.drawText(pixmap.rect(), i & 1 ? "Working." : "Working.."); p2.end(); QBackingStore *bs = backingStore(); bs->beginPaint(rect()); p1.drawPixmap(0, 0, pixmap); bs->endPaint(); bs->flush(rect(), windowHandle()); } p1.fillRect(rect(), Qt::red); p1.drawText(rect(), "Done!"); } While this code could be restructured, it is a common pattern in legacy Qt applications which cannot be easily changed. Change-Id: I3b919266abe41c96a584cb02f41cafac3f9d1d7c Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | qDBusInterfaceFromMetaObject: avoid quadratic complexity.Anton Kudryavtsev2016-04-291-3/+8
|/ / | | | | | | | | | | | | | | | | | | Don't use QString::prepend() in the loop. Just compose temp string by appending, and then prepend whole temp string. Change-Id: I6efb2d20e03f6a3526103d3a9494d5d1b0fbbf81 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Edward Welbourne <edward.welbourne@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Change some members of QFontEngineFT::Glyph to shortJian Liang2016-04-292-7/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Some color bitmap fonts will have a size greater than 127 pixels, areMetricsTooLarge() will return true(its advance exceed 127) for these fonts and we are unable to render these fonts since QFontEngineFT::loadGlyph() will simply do nothing if areMetricsTooLarge() return true. To support bitmap font whose size is between 128 and 255, we change x,y,advance of QFontEngineFT::Glyph to short variable to make areMetricsTooLarge() return false, in this way we will be able to render such color bitmap fonts. Change-Id: I9ab244b14884cdde91040a462f2fbca650b91289 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | DBus: use QStringRef to optimize memory allocationAnton Kudryavtsev2016-04-285-39/+60
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Replace substring functions that return QString with corresponding functions that return QStringRef where it's possible. Create QString from QStringRef only where necessary. Add overloaded functions with QStringRef arg in QDBusUtil: - isValidUniqueConnectionName() - isValidMemberName() - isValidPartOfObjectPath() Change-Id: I4a24a298702728ba7d3a65c39e25c3a9c759e07f Reviewed-by: Marc Mutz <marc.mutz@kdab.com>