summaryrefslogtreecommitdiffstats
path: root/src
Commit message (Collapse)AuthorAgeFilesLines
* printsupport: Pass large type by const-refSérgio Martins2015-07-201-2/+2
| | | | | | | sizeof() is 144 bytes on x86_64 Change-Id: I11fbb3c37353aafa209cea388cfc505f9645a1bb Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QDirModel: remove pointless user-defined QDirNode destructorMarc Mutz2015-07-201-1/+0
| | | | | | | | | | The clearing of 'children' is already performed by the 'children' destructor, and the presence of the user-defined QDirNode destructor inhibits the move special member functions for QDirNode. Change-Id: Ie8025e7a2c4b1a8c0b691deda0e49b517f8a6ed5 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* QVectorND: mark as primitive, not just movableMarc Mutz2015-07-203-3/+3
| | | | | | | | | | | | | Every bit combination is a valid object, so the correct type classification is primitive, not just movable. This is BC, because it just changes whether the default ctor and dtor are run or not, and these types don't care. Change-Id: Ifbfa83128778744f15a086a65c8be1ce01a58820 Reviewed-by: Sean Harmer <sean.harmer@kdab.com>
* qqnxinputcontext: Add support for EnterKeyTypeKai Uwe Broulik2015-07-194-2/+33
| | | | | Change-Id: I03b9d70b9bb05cd28fdcbb076764a2e1d9e3e0e3 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Mark QDBus{ObjectPath,Signature,Variant} shared-come-qt6Marc Mutz2015-07-191-12/+19
| | | | | | | The compiler-generated move operations are ok. Change-Id: Ida994b52e3ee6ce75afd50133e61488b94464eee Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* platformsupport/dbustray: mark some types as movableMarc Mutz2015-07-191-0/+2
| | | | | | | At least on is already held in QVector. Change-Id: Ifa29d924315a9d397bd591ae548f199dcefa03a4 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* platformsupport/dbusmenu: fix uses of inefficient QListsMarc Mutz2015-07-191-5/+10
| | | | | | | | | | | | | These types are larger than a void*, so holding them in QLists is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by marking them movable, and holding in a QVector instead. Change-Id: I74b2ce327d6aee60e2cc3463ce09453a4305bba7 Reviewed-by: Dmitry Shachnev <mitya57@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QVector: add an rvalue overload of push_back/appendMarc Mutz2015-07-193-2/+52
| | | | | | | | | | This is low-hanging fruit, for two reasons: 1. The implementation is dead-simple (unlike, say, in QList). 2. It's completely transparent to the QVector user (unlike, say, emplace_back, which can only be used inside an ifdef). Change-Id: Iaf750100cf61ced77aa452f0e4e3c4ec36b29639 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QVector: in append(), if we take a copy, then move, not copy from the copyMarc Mutz2015-07-191-3/+3
| | | | | | | Replaces one copy ctor / assignment with a move ctor / assignment. Change-Id: I56768db9904283a9be7c87f624a557a64557bc8f Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QIconLoader: don't make QIconDirInfo::type a bit-fieldMarc Mutz2015-07-191-1/+1
| | | | | | | | | | | | | It doesn't save any space, is not required for ABI compat (because it's private API), generates more code to extract the field, and triggers a bug in older GCCs when synthesizing a move constructor for this type: src/gui/image/qiconloader_p.h:64:8: error: invalid conversion from 'unsigned char:4' to 'QIconDirInfo::Type' [-fpermissive] src/corelib/tools/qvector.h:641:13: note: synthesized method 'QIconDirInfo& QIconDirInfo::operator=(QIconDirInfo&&)' first required here Change-Id: I61e886566b67c7a18a318a3d026dc762600f8ab4 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QtGui: Pass types with copy-ctor or dtor by const-refSérgio Martins2015-07-198-13/+13
| | | | | | | | | ... except if the function is a ctor, callers pass rvalues, and the type has a fast move ctor. In that case, keep passing by-value and qMove() into place. Change-Id: I2c0be7d4436327834ddee0531c51c5af352ac74c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* QZip*: return FileInfo by valueMarc Mutz2015-07-191-11/+10
| | | | | | | | | Makes for much more readable callers, and, d/t NRVO, isn't less efficient than the old code, either. Transparently enables moves when QVector should get them, at some point, too. Change-Id: I77327cf665272b80277deaaa6dd2ee9c00806464 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QZip*: don't hold QZipReader::FileInfo in QListMarc Mutz2015-07-192-5/+5
| | | | | | | | | | | FileInfo is larger than a void*, so holding them in a QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Change-Id: I772177c5ac544a5fecce2368f628148308ef260f Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up QZipReader::FileInfoMarc Mutz2015-07-192-39/+7
| | | | | | | | | | | | | - don't define special member functions if the compiler-generated ones are just fine (inhibits move semantics) - implement all remaining methods inline - unexport - remove unused (and, to add insult to injury, never init'ed) d-pointer. This is private API. No need for a d-pointer, much less an unused one. Change-Id: I6979cb5103a361c0313c252d3bf7073a3c47addd Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com>
* QArrayDataPointer: make move semantics consistent with other containersMarc Mutz2015-07-191-5/+6
| | | | | | | | | | | | | That is: - nothrow default constructor - nothrow move constructor - nothrow move assignment operator - nothrow swap - as a generic container, destroy lhs contents immediately on move-assignment. Change-Id: I6ec2b9451d3a0ddb63a97ea84504bc7f87d8d34d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSet/QQueue/QStack: use compiler-generated special member functionsMarc Mutz2015-07-194-13/+8
| | | | | | | | They do the right thing (except move special member functions on MSVC, but that's MSVC's problem). Change-Id: I699e1be83c0568821f8c6b84394a2713bb22e8e7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedPointer: add move construction, assignment from compatible shared ↵Marc Mutz2015-07-191-0/+17
| | | | | | | pointers Change-Id: I772c568055c9bed6eb627ad35dba300925fc0fde Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusVariant: add ctor taking QVariant&&Marc Mutz2015-07-191-0/+3
| | | | | Change-Id: Ia25c4bd6294955b0e8ea5ecc0c62719423542e84 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Containers: destroy previous state on move-assignment immediatelyMarc Mutz2015-07-195-5/+6
| | | | | | | | | | | | | | | | [ChangeLog][QtCore] All generic containers (with the exception of QVarLengthArray, but including QSharedPointer) destroy the previous state as part of a move-assignment now. Previously, they would dump it into the right-hand-side object. Note that this is only true for the generic containers. Other implicitly-shared types, as well as the non-generic containers QString, QByteArray, etc. still just swap the contents with the right-hand-side object when move-assigned into, and, for performance reasons, this will not change in the forseeable future. Change-Id: I1f1c684e85400b77bd2e7fba65bde2dce6c1bdde Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QSharedPointer: mark some internal API nothrowMarc Mutz2015-07-191-4/+4
| | | | | Change-Id: I871c86406b2c25df9a7834a997caf8a792d353a0 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QList: mark const variants of begin()/end() noexceptMarc Mutz2015-07-191-45/+45
| | | | | | | | | Plus some other trivial functions. Drive-by change: 0 -> Q_NULLPTR (public header) Change-Id: Ic3fca2950e4c5143eb90bd119da113fe64e48032 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusConnection: declare as shared-come-Qt6Marc Mutz2015-07-191-1/+7
| | | | | | | Requires adding member-swap and (at least in my copy) move operations. Change-Id: I1b638a81e4a41f467e69e352806524039e7b9f27 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Add missing ↵Marc Mutz2015-07-191-0/+1
| | | | | | | Q_DECLARE_OPERATORS_FOR_FLAGS(QDBusConnection::ConnectionCapabilities) Change-Id: I659ccc00129d20bbae08b277a291d81c6ede80be Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix nullptr literal 0s which would look odd as nullptrMarc Mutz2015-07-1915-34/+34
| | | | | | | | | | | | | These all invoke the QFlags<>(Zero *) ctor, which is designed to accept a 0, but no other int. But in doing so, it requires passing a nullptr literal, and 0 is not a nullptr literal accepted under -Wzero-as-null-pointer-constant or similar warnings. Fix by using the QFlags::QFlags() ctor instead. Task-number: QTBUG-45291 Change-Id: I73f9c9f4de11eeb1ba04ace6c7121d17510ea29f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtPrintSupport: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-193-6/+6
| | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I6f591a42a8e8ea471d27666eb1cbc77b572b3e0d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtGui: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-1940-119/+119
| | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I72ab40b21a9499b53a639564fa45884de17b6c98 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtNetwork: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-1917-28/+28
| | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I9a05d375d2d9d3ed56079ad024c89a08a290619b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileSystemModel: reserve() a QListMarc Mutz2015-07-191-1/+3
| | | | | | Change-Id: I136c24382a869ef92446dbe79bfd6a64273e55c6 Reviewed-by: Sérgio Martins <sergio.martins@kdab.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
* Testlib: Remove overload qCompare(bool, int, ...).Friedemann Kleint2015-07-191-8/+0
| | | | | | | | | | | It was added for NokiaX86 / RVCT compilers and may produce unexpected results with g++, where it matches for qCompare(int, enum). Task-number: QTBUG-47260 Change-Id: Ia29b9ae289c6df579a923aef6eb67e46db0b1120 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com> Reviewed-by: Jason McDonald <macadder1@gmail.com>
* QDBusMessage: declare as shared-come-Qt6Marc Mutz2015-07-181-0/+6
| | | | | | | | | | Requires adding member-swap and (at least in my copy) move assignment. Since the type does not contain a d == nullptr state, a move constructor isn't yet possible. Change-Id: Iad6939fa30f214591eab1fdf30a2cf1423ffb32a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusError: declare as shared-come-Qt6Marc Mutz2015-07-181-0/+15
| | | | | | | Requires adding member-swap and (at least in my copy) move operations. Change-Id: I4284484b1f520eb2d9036b993a5b5b70aaea0af9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusArgument: declare as shared-come-Qt6Marc Mutz2015-07-181-0/+7
| | | | | | | Requires adding member-swap and (at least in my copy) move operations. Change-Id: I0b32c387809c972203c94677616fe0a52143ec3b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QItemSelection: declare as shared-come-Qt6Marc Mutz2015-07-181-1/+5
| | | | | Change-Id: I07fe36777f8e64c4551243b5dfc3273f1783e954 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark QPixmapCache::Key as shared for Qt 6.Marc Mutz2015-07-181-0/+1
| | | | | Change-Id: I37819cfd8a56d364336640146dbead2e1a454787 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QFileSystemModel: avoid sibling() callsMarc Mutz2015-07-182-11/+6
| | | | | | | | | | | | | | | | ...by allowing to pass the column to the Private::index() overloads. Because Private::index() always returns an index in column 0, callers that needed a different column used QModelIndex::sibling() to adjust the column of the returned index. But that calls QAIM::sibling(), which calls both QFSM::index() and ::parent(). Simply allowing to pass the column number instead of hard-coding 0 avoids that heavy detour. Change-Id: I8895b3d102d576ba291333cf61075b7263f96b9d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: David Faure <david.faure@kdab.com>
* QIODevice: remove superfluous memberAlex Trotsenko2015-07-182-11/+1
| | | | | | | | In current implementation, d->firstRead doesn't provide any performance improvement. Change-Id: I5d6e765a7d49cb546998b2c3e908e3c5600e70b1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Introduce Q_DECLARE_SHARED_NOT_MOVABLE_UNTIL_QT6Marc Mutz2015-07-181-2/+11
| | | | | | | | | | | | | ... with classical semantics, meaning movable-come-Qt6, and complex-until-then. Whether or not we want a new flag for movable-except- in-QList is an orthogonal question, and should not hold back the slew of commits that introduce use of this macro. Change-Id: I3a6be08c314fcd7f3315af138625c38196debda5 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: Use Q_NULLPTR instead of 0 in smart pointer headersMarc Mutz2015-07-183-27/+27
| | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Not caught by the headersclean check, because they are in template code. Task-number: QTBUG-45291 Change-Id: I7294404225a19a1c58f91e6e47a9d650179ea83c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QByteArray: document {const_,}{reverse_,}iteratorMarc Mutz2015-07-181-2/+24
| | | | | | | | | The reverse_ ones were missing, and the non-reverse ones were marked \internal. But why should they not be documented? Change-Id: I5ffbfc1def8dcac3f4a771883152ffbcca3d745d Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusObjectPath: add ctor taking QString&&Marc Mutz2015-07-181-0/+3
| | | | | | | | The new constructor cannot be marked nothrow, because it calls non-nothrow doCheck(); Change-Id: I4e5b33c58125091644573ed84e715c7fa946ae09 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QDBusSignature: add ctor taking QString&&Marc Mutz2015-07-181-0/+3
| | | | | | | | The new constructor cannot be marked nothrow, because it calls non-nothrow doCheck(); Change-Id: I732fac7a07d46a3ff3be0e4e56de72dd19090737 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark some QCUPSSupport enums as primitiveMarc Mutz2015-07-181-0/+5
| | | | | | | | They are held in QVariants. No need to allocate them on the heap. Change-Id: I7829acbed94fd5b37079df670b0aa2d09613c73c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Mark QDBusSlotCache{,::Data} sharedMarc Mutz2015-07-181-0/+11
| | | | | | | The compiler-generated move operations are ok. Change-Id: Iec0fed49d52ace5ca7dae2c7ee53d717a283f15a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* forkfd: use wait4 to get the process status instead of waitidThiago Macieira2015-07-182-26/+34
| | | | | | | | wait4 gives us the struct rusage contents for us, which may contain interesting data for other users of forkfd (not Qt, though). Change-Id: Iee8cbc07c4434ce9b560ffff13cb4aa28e18e790 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* Add a way for auxiliary threads to handle events without CoreAppThiago Macieira2015-07-1812-12/+76
| | | | | | | | | | | | | | Long-lived threads started by Qt itself can now receive events even if QCoreApplication hasn't been created. This is required in all threads we start that will handle events, unless we're sure that the thread will exit before the global application object begins destruction. Otherwise, those threads will have race conditions dealing with the event delivery system trying to call the QCoreApplication::notify() virtual while the object is being destroyed. Change-Id: I27eaacb532114dd188c4ffff13d4ad2a4bb443e6 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Make the event delivery go through some more static functionsThiago Macieira2015-07-183-16/+33
| | | | | | | | | | | | | | | | This commit makes QCoreApplicationPrivate::checkReceiverThread, notify_helper, and sendThroughObjectEventFilters be static functions, since they only deal with global data or the parameters only. Making notifyInternal would have been binary incompatible (it's called from inline functions QCoreApplication::sendSpontaneousEvent and QCoreApplication::sendEvent), so instead add a new static notifyInternal2 and mark the older function deprecated and to be removed in Qt 6. Change-Id: I27eaacb532114dd188c4ffff13d59fe3b0661489 Reviewed-by: Albert Astals Cid <albert.astals@canonical.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Add a macro to disable use of potentially dangerous QProcess APIs.Jake Petroules2015-07-172-0/+29
| | | | | Change-Id: Id1ac19b1f4077ec2ea6f998883653e58ff77a8b6 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* QStyleSheetStyle: don't hold ButtonInfo in QListMarc Mutz2015-07-171-5/+7
| | | | | | | | | | | | | | | | | | | | ButtonInfo is larger than a void*, so holding them in a QList is needlessly inefficient. Worse, the code could come to depend on the fragile property of (inefficient) QLists that references to elements therein never are invalidated. Fix by holding it in QVector. Also reserve() the vector, even though we can't tell the size exectly. It's a short-lived vector. When appending, add an optimistic qMove(). I would have liked to use std::vector instead, but QRenderRule, thus ButtonInfo, isn't nothrow-move-constructible, because of missing move constructors on QBrush and QFont, among others. Change-Id: I89164f4ed5745498093102f022a7ef32186e8045 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Remove a silly note from QFileDialog::getOpenFileNames documentationGiuseppe D'Angelo2015-07-172-15/+0
| | | | | | | | | | | I can't possibly understand the meaning of the note, especially given the snippet. (However ,it has been there since Qt 3, so perhaps it refers to some weird QValueList behavior?) Change-Id: I952e9a7cb687b94cfccb927eb359b635804f4ade Reviewed-by: Martin Smith <martin.smith@digia.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Make CONFIG += c++11 by default not disable GNU extensionsThiago Macieira2015-07-172-6/+6
| | | | | | | | | | | | | | | | | | | Prefer -std=gnu++11 unless strict_c++11 is defined. You can enable strict C++11/C++14 mode by using CONFIG += strict_c++ That is enabled for Qt's own code, so we we don't accidentally use GNU extensions in portable code. There's no support for strict C++98 mode (that is, the -ansi option). [ChangeLog][qmake] By default, GNU extensions are now enabled with Clang, GCC and ICC even in C++11 and C++14 modes. To disable the GNU extensions, add to your .pro file: CONFIG += strict_c++. Change-Id: Ib056b47dde3341ef9a52ffff13ef14de2169bef5 Reviewed-by: Kai Koehne <kai.koehne@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>