summaryrefslogtreecommitdiffstats
path: root/src/corelib
Commit message (Collapse)AuthorAgeFilesLines
* Fix QVector move assignment to return a referenceMarc Mutz2015-07-041-1/+1
| | | | | | | | | | | | ... instead of a copy. This has been there since before Qt 5.0. A quick grep shows it's the only instance of this mistake in Qt. Change-Id: I341df34f67544b8ed719254bd57237a9599efb46 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Merge remote-tracking branch 'origin/5.5' into devLiang Qi2015-07-0135-569/+246
|\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.cpp src/corelib/global/qglobal.h src/corelib/global/qsysinfo.h src/corelib/global/qsystemdetection.h src/corelib/kernel/qobjectdefs.h src/plugins/plugins.pro tests/auto/widgets/itemviews/qlistview/qlistview.pro Change-Id: Ib55aa79d707c4c1453fb9d697f6cf92211ed665c
| * fix build under FreeBSD 10Oswald Buddenhagen2015-06-301-0/+1
| | | | | | | | | | | | | | | | qlockfile_unix.cpp:236:24: error: use of undeclared identifier 'kinfo_getproc' Task-number: QTBUG-46907 Change-Id: I146b5de99b6149df64c116cbdec81a19e352a3a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * Replace MAC OS X with OS XNico Vertriest2015-06-302-3/+3
| | | | | | | | | | | | Task-number: QTBUG-46374 Change-Id: I7bc633ab551740bd328a24b0ccae1d534af47138 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * Bump versionOswald Buddenhagen2015-06-291-2/+2
| | | | | | | | Change-Id: Ide0b1a80ac89b76154ecccbda68398f3a05e1f5d
| * QDate/QTime: fix SiC introduced by adding new non-explicit ctorsMarc Mutz2015-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The new constructors were added in c94d41d9 to help constexpr'ify QDate and QTime. Even though private, they participate in overload resolution and break function pairs overloaded on QDate and int or QTime and int. Mark them explicit. [ChangeLog][QtCore][QDate/QTime] Fixed a minor source-incompatibility between Qt 5.4 and 5.5.0 involving sets of functions overloaded on QTime and some integer or QDate and some integer. Change-Id: I65a09aaca2b083cda90255c24cc72ef51119d3b1 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Apple's 3.6.0svn based clang doesn't support -Winconsistent-missing-overrideGabriel de Dietrich2015-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | That's the version Apple ships with Xcode 6.3.2. We set the threshold to Xcode 7, whose clang version supports the "missing override" warning. Change-Id: Ibcab8a45306120bdcd02ca5b0bb0d1c638cea177 Task-number: QTBUG-46833 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * Merge remote-tracking branch 'origin/5.5.0' into 5.5Liang Qi2015-06-2713-16/+83
| |\ | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qcocoafiledialoghelper.h Manually fixed src/testlib/qtestcase.cpp to return the right type. Change-Id: Id1634dbe3d73fefe9431b9f5378846cb187624e4
| | * Don't document the IsGadget flagThiago Macieira2015-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | There's still some discussion as to whether it's safe to use. Until we're completely sure, don't let users use it. We can always bring it back later. Change-Id: I049a653beeb5454c9539ffff13e5e3e343da0e7d Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@theqtcompany.com>
| | * Doc: document future direction of QCoreApplication::notify()Thiago Macieira2015-06-221-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It will definitely not be called for events outside the main thread, but we haven't decided for the main thread, in Qt 6. [ChangeLog][Future direction notices] In Qt 6, QCoreApplication::notify() will not be called for events being delivered to objects outside the main thread. The reason for that is that the main application object may begin destruction while those threads are still delivering events, which is undefined behavior. Applications that currently override notify() and use that function outside the main thread are advised to find other solutions in the mean time. Change-Id: I27eaacb532114dd188c4ffff13d5a5c8df3bc85b Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * Detect and set Xcode 6.3 clang versionGabriel de Dietrich2015-06-221-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This becomes necessary to avoid compilation errors with Xcode 7 and clang 7.0.0. (Note that its version information doesn't state which LLVM version it's based on, though we suspect it could be 3.7.0svn.) Change-Id: I2bfc7f2b73ca7a61798b123cc2715037028f0e5f Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Doc: Remove link to deprecated QProcess::pid()Kai Koehne2015-06-171-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | QProcess::pid() is deprecated since Qt 5.3. Rather link to it's replacement. Change-Id: Iaea86137a046513809f9f92ff88fe21233adaa34 Reviewed-by: Topi Reiniö <topi.reinio@digia.com>
| | * Version transitionType as a new propertyAlan Alpert2015-06-111-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | It is exposed in the QtQml.StateMachine import, but note that the metaobject version is just incremented (no need to match QtQml.StateMachine, which is in a different module). Change-Id: I50773d9dec5252aa93846b7e5f743958ee838023 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * Fix sizes QStorageInfo returns for invalid drivesIvan Komissarov2015-06-112-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Zero is a legitimate size to be returned by bytesFree/bytesAvailable functions, so change those functions to return some 'invalid' size in case of an invalid drive. This is also consistent with the original version from the Qt Systems framework. [ChangeLog][QtCore][QStorageInfo] Fixed sizes returned for invalid drives. Task-number: QTBUG-45724 Change-Id: I312fba521fdf8d52d7a0ac0e46cacca625775e80 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Compile on 10.7: Disable constexpr supportMorten Johan Sørvig2015-06-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | Apple Clang 3.2 is known bad with broken or partial support. Which version is the first good version is unknown. Change-Id: I1b938281680dde5acbe0e08979444b6055a1cc4e Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * Don't enforce all QMetaType::TypeFlag difference across Qt versionsAlex Blasche2015-06-101-4/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QMetaType::IsGadget was introduced in Qt 5.5 and set when Q_GADGET is used. If an existing Qt 5.4 class was converted to a gadget in Qt 5.5+, the two types would have differing QMetaType::TypeFlags. Such a conversion happened for QGeoCoordinate, QGeoShape, QGeoRectangle and QGeoCircle. There might be other classes too. In principle, the same problem exists for every future addition to QMetaType::TypeFlag too. This patch ensures that new flags are kept in the metatype database and the related qFatal call is not triggered for any flag >= TypeFlag::WasDeclaredAsMetaType. Change-Id: Ibb15daeb28d9a11b7f31658f4219cbca2499213f Task-number: QTBUG-46454 Reviewed-by: Alex Blasche <alexander.blasche@theqtcompany.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| | * Update for the newest Darwin-family operating systems.Jake Petroules2015-06-103-1/+39
| | | | | | | | | | | | | | | | | | | | | Change-Id: I5ea44a720e01e388a8d219a89c5b0ccd8fd23146 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com> Reviewed-by: Liang Qi <liang.qi@theqtcompany.com> Reviewed-by: Jani Heikkinen <jani.heikkinen@theqtcompany.com>
| | * Doc: Update due to renaming QTextStream::readLine() overloadAlexander Volkov2015-06-032-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | readLine() overload was renamed into readLineInto() in 21674735ccd029c17dc8b36211e9b5bc3595ba34. Change-Id: Iebd4c4e42ef4579c02ca38d7e41d00c3032130d8 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| | * Rename QTextStream::readLine(QString *, qint64) into readLineIntoSimon Hausmann2015-06-032-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | As discussed on the development mailing list, the new overload is ambiguous and breaks source compatibility. Therefore this function that is new in 5.5 shall be called readLineInto. Change-Id: I2aecb8441af4edb72f16d0bc6dabf10cdabf32e2 Reviewed-by: Jan Kundrát <jkt@kde.org> Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | Simplify permission flag handling a bitKonstantin Ritt2015-06-252-13/+5
| | | | | | | | | | | | | | | | | | Change-Id: I753f7a398c39e7300821658f27e4813c591eebc3 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * | Make QDir::relativeFilePath() return "." for a path to itself.Christian Kandeler2015-06-241-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The rationale being that the empty string is not a valid path component. [ChangeLog][QtCore][QDir] QDir::relativeFilePath() now returns "." instead of an empty string if the given path is the same as the directory. Change-Id: Ibcf31904b2ae5edf5639d4c2e5ba234365d347fd Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * | Doc: Improve code snippet in QTranslator overviewKai Koehne2015-06-241-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Use translator::load(QLocale(), ...) which loads the a translation mapping the users preferred languages, instead of just hardcoding one. This is arguably the more common (and interesting) case. Also, QPushButton::tr() does place the string in the "QPushButton" namespace, which is just wrong (TM). Change-Id: Id22851556b3f876da3b756b452811e07fc7b173e Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * | QLocale: Fix example return value for uiLanguages()Kai Koehne2015-06-241-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The documentation (correctly) states that the first item in the list is the most preferred one. Anyhow, then it doesn't make much sense to list "en_US" after "en". Change-Id: Ib88e5c97d4329b444d1cb49eeb49eaed2ddedad3 Reviewed-by: Konstantin Ritt <ritt.ks@gmail.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
| * | winrt: don't return invalidated timers in ↵Oliver Wolff2015-06-231-1/+1
| | | | | | | | | | | | | | | | | | | | | QEventDispatcherWinRT::registeredTimers Change-Id: I0dbad7a78080cd8c18893fea8294cf540a5e9e5e Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
| * | Use qthread_win.cpp for WinRT as wellOliver Wolff2015-06-235-483/+61
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since of Windows (Phone) 8.1 most of the desktop's thread functionality is also available, so we might be able to share the code and get rid of the extra implementation for WinRT. Task-number: QTBUG-43837 Change-Id: I0ce907cd94899834527f88c70e1e395bafdb14b3 Reviewed-by: Maurice Kalinowski <maurice.kalinowski@theqtcompany.com>
| * | Disable C++11 thread_local with ICC on OS XThiago Macieira2015-06-221-1/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It appears the ABI is lacking support for this at this point in time, even though __thread works. ICC 15 works, probably by making it an alias to __thread, but neither ICC 16 beta nor Clang work with thread_local. Intel-bug: DPD200371699 Intel-ID: 6000107242 Change-Id: I049a653beeb5454c9539ffff13e639bdb83b8843 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Improve QString doc when using non-spaced numbered place markerSamuel Gaist2015-06-192-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently when a developer uses a string like QString("%1%3%2").arg(x).arg(y).arg(z) he can be bitten by the sequential replacement done by QString. Adding an example with a little explanation should help future Qt user avoid generating buggy strings. Task-number: QTBUG-44044 Change-Id: I81e20af8d9fb2a07e12ec61dcd5bb4544d863777 Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
| * | Make QMetaObject::Connection check its state deeplyThiago Macieira2015-06-192-1/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since Connection can be copied, one copy could be used for disconnecting, but the other's d_ptr wouldn't get updated and would continue to report as still connected. This patch fixes that by making it check the internal state. That is only done after d_ptr is already known to be non-null. Unfortunately, that is the common path: if (connect(sender, &Sender::signal, [] {})) will call an out-of-line function. I don't see a way out. Task-number: QTBUG-46213 Change-Id: I66a35ce5f88941f29aa6ffff13dfb45dca68a350 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
| * | Use the default QLocale for QFileSelector, not the system localeThiago Macieira2015-06-191-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The default locale is the system locale, unless you changed the default with QLocale::setLocale(). If you did that, you probably want it to apply to QFileSelector too. Task-number: QTBUG-45951 Change-Id: I0d4913955e3745b69672ffff13db5a2c7f8b1227 Reviewed-by: Alan Alpert <aalpert@blackberry.com>
| * | fix decoding of file paths in QLockFilePrivate::processNameByPidJoerg Bornemann2015-06-121-3/+3
| | | | | | | | | | | | | | | | | | | | | QFile::decodeName should be used instead of a simple QString::fromUtf8. Change-Id: I76955ab01af55dd373f860f6e3dbffa37e60892c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * | fix unterminated char buffer glitchJoerg Bornemann2015-06-121-3/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | readlink does not append a NUL character to buf. If readlink places PATH_MAX characters into buf, then an unterminated character buffer would have been passed to QString::fromUtf8. Change-Id: Ib1865b8df760fa7da91c3be746dc701a165d93ee Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
| * | Fix less-than comparison for QStandardItem and QSortFilterProxyModel with ↵Friedemann Kleint2015-06-111-2/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | invalid data. Previously, QStandardItem::operator<() returned true when both items had invalid data. With MSVC in debug mode (checked iterators/STL), this triggered an assert in tst_QStandardItem::sortChildren() since that verifies that !(b < a) when a < b: Debug Assertion Failed! Line: 3006 Expression: invalid operator< Introduce a stable sort order for invalid items such that other items are always less than invalid items and comparing invalid items returns false (indicating equivalence). Change-Id: Ica0f0d9f001c86973b1941dbcc1faf282e4c47df Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| * | QCoreApplication::applicationFilePath(): Fix array bounds violation of argv.Friedemann Kleint2015-06-111-5/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Check for argc > 0 before accessing argv[0]. tst_qapplication constructs QApplication(0, 0) and has been observed to crash sporadically. Fix valgrind error: =9845== Conditional jump or move depends on uninitialised value(s) ==9845== at 0x4C2F1BC: strcmp (in /usr/lib/valgrind/vgpreload_memcheck-amd64-linux.so) ==9845== by 0x5DEEFB3: qstrcmp(char const*, char const*) (qbytearray.cpp:262) ==9845== by 0x6011EAA: QCoreApplication::applicationFilePath() (qcoreapplication.cpp:2058) ==9845== by 0x6011D0B: QCoreApplication::applicationDirPath() (qcoreapplication.cpp:2029) ==9845== by 0x5DD285D: QLibraryInfoPrivate::findConfiguration() (qlibraryinfo.cpp:184) ==9845== by 0x5DD32AF: QLibraryInfo::platformPluginArguments(QString const&) (qlibraryinfo.cpp:596) ==9845== by 0x5746A95: init_platform(QString const&, QString const&, QString const&, int&, char**) (qguiapplication.cpp:1017) ==9845== by 0x5747C91: QGuiApplicationPrivate::createPlatformIntegration() (qguiapplication.cpp:1177) ==9845== by 0x5747DDE: QGuiApplicationPrivate::createEventDispatcher() (qguiapplication.cpp:1194) ==9845== by 0x4FAF81D: QApplicationPrivate::createEventDispatcher() (qapplication.cpp:196) ==9845== by 0x600F568: QCoreApplication::init() (qcoreapplication.cpp:768) ==9845== by 0x600F2C4: QCoreApplication::QCoreApplication(QCoreApplicationPrivate&) (qcoreapplication.cpp:689) ==9845== by 0x574594C: QGuiApplication::QGuiApplication(QGuiApplicationPrivate&) (qguiapplication.cpp:570) ==9845== by 0x4FB008A: QApplication::QApplication(int&, char**, int) (qapplication.cpp:569) ==9845== by 0x41148A: tst_QApplication::lastWindowClosed() (tst_qapplication.cpp:561) Change-Id: I2fb324ab63617f14f5f43835154aae339bfa9520 Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
| * | Doc: corrected qdoc syntax errorNico Vertriest2015-06-101-0/+1
| | | | | | | | | | | | | | | | | | Task-number: QTBUG-36985 Change-Id: I8cf79432bcdd497ee11c3f2ed70b11eaac1c0f57 Reviewed-by: Martin Smith <martin.smith@digia.com>
| * | Refactor handling of environment variable QT_WINVER_OVERRIDE.Friedemann Kleint2015-06-101-28/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | Rename variable named "override" and check using qEnvironmentVariableIsSet() to avoid constructing a QByteArray in the default case. Remove DOS-based OS. Change-Id: Ibf348cd74ada5be99b9d2ed7637184a786df8244 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
| * | Fix return value of QWindowsFileSystemWatcherEngine::removePaths().Friedemann Kleint2015-06-091-2/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Previously, the path was removed from list returned (indicating failure to remove) only when the thread's list was empty (last file in directory). Move the statement up so that removal happens when it is found in thread's list. Task-number: QTBUG-46449 Change-Id: Ib79199c731f79357b0e5c17636254fbeb3a754a0 Reviewed-by: Robin Burchell <robin.burchell@viroteck.net>
| * | Added support for Windows 10 in QSysInfo::productVersion()Marcel Krems2015-06-091-0/+4
| | | | | | | | | | | | | | | Change-Id: I9e21ae62eea6c694e0b3b68dfd14264c3ce76246 Reviewed-by: Friedemann Kleint <Friedemann.Kleint@theqtcompany.com>
| * | Fix race condition with QProcess on OSX 10.7Dyami Caliri2015-06-061-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | Closing the forkfd descriptor before disabling the deathNotifier causes a race condition in ~QProcess. This is the same underlying cause as QTBUG-22789. Change-Id: I1cbdedc567fdfa8d95d111827b7bf9994661ecc7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| * | fix usage of wince scopeOswald Buddenhagen2015-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | Fix style issues along the way. Change-Id: Ic6a6de28e198eb0b14c198b802e78845703909b9 Reviewed-by: Joerg Bornemann <joerg.bornemann@theqtcompany.com>
* | | QtCore: Use Q_NULLPTR instead of 0 in all public headersMarc Mutz2015-07-0172-290/+291
| | | | | | | | | | | | | | | | | | | | | | | | | | | This is in preparation of adding -Wzero-as-null-pointer-constant (or similar) to the headers check. Task-number: QTBUG-45291 Change-Id: I0cc388ef9faf45cbcf425ad0dc77db3060c104a8 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Add qHash(QLocale)Marc Mutz2015-06-302-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QLocales can be compared for equality, so qHash should be overloaded, too. [ChangeLog][QtCore][QLocale] Added qHash(QLocale). Change-Id: Ia0fdf1207b842b9bb20b8f9ab0165016915debf4 Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QModelIndex: Fix a nullptr literal 0 that would look odd as nullptrMarc Mutz2015-06-301-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | By dropping it. Found while looking into Task-number: QTBUG-45291 Change-Id: Ie7655d607244aa67219ade465525ec771c87ccf5 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QtCore: make all Q_DECLARE_SHARED types nothrow move-assignableMarc Mutz2015-06-309-27/+23
| | | | | | | | | | | | | | | | | | | | | Excepting QDebug, which doesn't have value semantics. Change-Id: I43757ef7bba4c1f5b6de9144f12b38ce840cd9f9 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Use QVector::reserve() all over the place.Sérgio Martins2015-06-294-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Reduces internal memory fragmentation. The search criteria was: QVector::append(), QVector::push_back(), QVector::operator<<() and QVector::operator+=() calls inside for, do and while loops. Statements inside ifs and out of loops weren't considered. Change-Id: Ie5aaf3cdfac938994e6e5dfa5f51de501ed79a0c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | QWeakPointer: remove misleading Q_DECL_CONSTEXPRMarc Mutz2015-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Adding constexpr there is allowed, because QWeakPointer is a class template. But in 100% of cases, it will be dropped, because the destructor is not trivial. So, don't mislead users and devs to think that any or even all QWeakPointers could ever be constexpr. Change-Id: Ia50aad4d6c4fb724254308150124c666e82ef817 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QCommandLineOption: Q_DECL_NOTHROW -> Q_DECL_NOEXCEPTMarc Mutz2015-06-281-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In IsInvalidName::operator(), marked as _NOTHROW, we're calling qWarning(), which, of course, _can_ throw. We don't care in that case, but then we musn't use _NOTHROW, which causes UB on MSVC, but _NOEXCEPT, which causes std::terminate to be called. Change-Id: I18f74546ea3b388495fdb173d3abd9a162fb78a9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QSharedPointer: destroy LHS on move assignmentMarc Mutz2015-06-271-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Howard Hinnant is right: just swapping may keep a resource alive too long. The problem with replacing swap(other) was that the naïve approach: clear(); swap(other); is not safe for self-assignment. Taking a cue from the default std::swap() implementation, and the copy-swap idiom, a self-assignment-safe version is QSharedPointer moved(std::move(other)); swap(moved); which is to what I changed the implementation now. Change-Id: I589fdae50ae22b95350db8250b02d983dc8487a6 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QList: Introduce constFirst() and constEnd()Sérgio Martins2015-06-272-2/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows to easily prevent detaching in common code like: getList().first() [ChangeLog][QtCore][QList] Added the convenience constFirst and constLast functions. Task-number: QTBUG-46026 Change-Id: I51ecb51fe91fc7d993ad35b5c7392f4da88e5f7b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | QSortFilterProxyModel: Keep invalid index updated on source model sortDaiwei Li2015-06-251-0/+21
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If we have a filter applied that removes all entries, the source model is sorted, and then we remove the filter, QSortFilterProxyModel never emits rowsInserted. This is because it doesn't have the correct source mapping and doesn't update when the filter is removed. Change-Id: I447b2d150e509b128d27f4dabc4e081ca4ef037f Task-number: QTBUG-46282 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | QStateMachine: remove unused qHash(QPointer<T>)Marc Mutz2015-06-241-4/+0
| | | | | | | | | | | | | | | Change-Id: Idae3621d1a3cb961e2d46fd58208829651382c11 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>