summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel
Commit message (Collapse)AuthorAgeFilesLines
...
| | * macOS: Allow overriding NSKeyValueObservingOptions for QMacKeyValueObserverTor Arne Vestbø2019-07-182-6/+9
| | | | | | | | | | | | | | | Change-Id: I6dc0f7c542ccfb768c1cd8688168c415e2c8a087 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | QResource: deprecate isCompressed()Thiago Macieira2019-07-161-1/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Current codebases assume isCompressed() implies ZlibCompression, since there was no compressionAlgorithm() getter. In order to force codebases to change, deprecate isCompressed() and force handling of the algorithm. The replacement API is being introduced in 5.14, which is why the warning is being emitted in 5.15 only. Change-Id: Ief874765cd7b43798de3fffd15a9f5d978951ea5 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
* | | Qt6: Fix uninitialized meta objects on WindowsThiago Macieira2019-07-163-11/+40
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Windows has a problem relating to cross-DLL variable relocations: they are not supported. Since QMetaObject's link to the parent class is done via a pointer, every QMetaObject in a DLL or in the EXE that derives from a class from another DLL (such as QObject) will be dynamically initialized. This commit changes the meta object pointers in QMetaObject::d from raw pointers to a wrapper class SuperData, which is almost entirely source- compatible with the pointer itself. On all systems except for Windows with Qt 6, it's binary compatible with the current implementation. But for Windows with Qt 6, this commit will store both the raw pointer and a pointer to a function that returns the QMetaObject, with one of them non-null only. For all meta objects constructed by moc, we store the function pointer, which allows the staticMetaObject to be statically intialized. For dynamic meta objects (QMetaObjectBuilder, QtDBus, QtQml, ActiveQt), we'll store the actual raw pointer. [ChangeLog][QtCore][QMetaObject] Some internal members of the QMetaObject class have changed types. Those members are not public API and thus should not cause source incompatibilities. The macro QT_NO_DATA_RELOCATION existed in Qt 4 but was called Q_NO_DATA_RELOCATION and only applied to Symbian. It was removed in commit 24a72c4efa929648d3afd95b3c269a95ecf46e57 ("qglobal: Remove symbian specific features"). Task-number: QTBUG-38876 Fixes: QTBUG-69963 Change-Id: Id92f4a61915b49ddaee6fffd14ae1cf615525e92 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io>
* | | QAbstractMetaCallEvent: fix compilation with out feature.thread on ClangMarc Mutz2019-07-141-2/+7
| | | | | | | | | | | | | | | | | | | | | | | | Clang warns that the private field semaphore_ is unused, and is correct, of course. Change-Id: Ic1372cedd3f4b2facca9f6f6be398d26f406b379 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Introduce QT_NO_LINKED_LIST and mark QtBase (almost) free of itMarc Mutz2019-07-121-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | QLinkedList is still used in several tests. Add exceptions for these subdirs. Change-Id: I50ccd2a0892129d4a47aa4e2400211690da9a82d Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* | | Merge remote-tracking branch 'origin/5.13' into devQt Forward Merge Bot2019-07-121-1/+1
|\| | | | | | | | | | | Change-Id: Icaabf08f9af539ddf844d96bc9c3a2d09408ba8a
| * | doc: Enable a declaration for qdocMartin Smith2019-07-101-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | A declaration of fromStdVariant() was not visible to qdoc because it was ifdef'ed out. This update ensures that qdoc sees the declaration. Change-Id: I4b00a895aa61175296ec80806b43311eff4f25ca Reviewed-by: Paul Wicking <paul.wicking@qt.io>
* | | Port some trivial cases from QMutex to QRecursiveMutexMarc Mutz2019-07-061-1/+1
| | | | | | | | | | | | | | | | | | | | | In all of these cases, the effect of the change is local to one file. Change-Id: I3bda3aadee3b42e7797183c2330183390b92d1f2 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-051-0/+2
|\| | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf qmake/generators/makefile.cpp Change-Id: Ifb2633a69d0bf8cdf12d799c6259beefc279c49e
| * | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-07-031-0/+2
| |\| | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf Change-Id: I936be3c0df2b9845ff6a85eb3d4442cdabe63d37
| | * Mark QObject::deleteLater() as \threadsafeMarc Mutz2019-07-031-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Because it is. It's just QCoreApplication::postEvent(), which is thread-safe. It also _has_ to be, because we recommend to use deleteLater() to delete QObjects that live in another thread: Quoting the ~QObject() docs: > Warning: Deleting a QObject while pending events are waiting to be delivered > can cause a crash. You must not delete the QObject directly if it exists in > a different thread than the one currently executing. Use deleteLater() > instead, which will cause the event loop to delete the object after all > pending events have been delivered to it. If deleteLater() is not thread-safe, it cannot be used for one of its intended purposes. Change-Id: I333d506b42bdfcdff00fe6cefa234c21865625a6 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | qtlite: Fix build with -no-feature-commandlineparserMikhail Svetkin2019-07-032-0/+6
| | | | | | | | | | | | | | | | | | | | | Change-Id: Ie7b7b119073691c0d3b6358f876298fc86cfe9e9 Reviewed-by: Tasuku Suzuki <tasuku.suzuki@qbc.io> Reviewed-by: Timo Aarnipuro <timo.aarnipuro@qt.io> Reviewed-by: Kari Oikarinen <kari.oikarinen@qt.io>
* | | Remove hook handling code from QEventDispatcherWin32Joerg Bornemann2019-07-022-46/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since commit 6a7cea64 qt_GetMessageHook is effectively a no-op, and we can remove the complete hook handling code. Change-Id: I90383c0c09c2b0f1d715872de5f9519a879d9bae Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com> Reviewed-by: Oliver Wolff <oliver.wolff@qt.io>
* | | Merge "Merge remote-tracking branch 'origin/5.13' into dev"Liang Qi2019-07-011-5/+2
|\ \ \
| * | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-07-012-6/+3
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/network/ssl/qsslsocket_openssl.cpp src/platformsupport/vkconvenience/qvkconvenience.cpp Change-Id: I97ce6ed185f7fdad8102cc58d3cfec0119fd7bb4
| | * | QTranslator: simplify QString byte-swapping codeThiago Macieira2019-06-281-5/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | No need to check QSysInfo, just use qFromBigEndian. On big-endian systems, it does the memcpy for us. Change-Id: I1004b4b819774c4c9296fffd158fe3aa5ff0a287 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
| | * | Fix Clang warning about applying operator|| to non-booleanThiago Macieira2019-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | qmetatype_p.h:111:412: error: use of logical '||' with constant operand [-Werror,-Wconstant-logical-operand] Change-Id: Iac6ae11e29bd4169bae9fffd15a117d576a95adb Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-251-6/+6
| | |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qstorageinfo_unix.cpp src/network/ssl/qsslsocket_openssl.cpp Change-Id: Ibc9ce799bef62d60d616beaa9fbde8ebeadfbc20
| | * | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-201-0/+4
| | |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/gui/painting/qdrawhelper.cpp src/network/ssl/qsslsocket_openssl.cpp src/widgets/styles/qstylesheetstyle.cpp Change-Id: Ibe1cd40f46a823c9e5edbe0a3cd16be1e1686b17
* | | | | QAccessibleWidget: fix UB (invalid cast)Marc Mutz2019-07-011-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Casting an object to a subclass that is not the dynamic type of the object constitutes undefined behavior. Fix by befriending QObject. Change-Id: Ib70dbef9095df31a6d89449d82a02cef9fccd348 Reviewed-by: Frederik Gladhorn <frederik.gladhorn@qt.io>
* | | | | QTypeModuleInfo: fix clang '-wconstant-logical-operand' warningsYulong Bai2019-07-011-1/+1
|/ / / / | | | | | | | | | | | | | | | | Change-Id: Ia73e4ffbabd5db67063584a7e53966da53133689 Reviewed-by: Jędrzej Nowacki <jedrzej.nowacki@qt.io>
* | | | rtems: Fix missing some ernno definesMikhail Svetkin2019-07-011-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | By default RTEMS does not support linux extensions for errno. Enable it for build. Change-Id: I43b346794b99ac0ed339bfbe6e39684071615503 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Ryan Chu <ryan.chu@qt.io>
* | | | Remove unused qmutexpool_p.h includesMarc Mutz2019-06-291-1/+0
| | | | | | | | | | | | | | | | | | | | Change-Id: Ic5f56b12953f2e42d94f6e6c14fac166c0c75539 Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | | QObject: deprecate the undocumented userData() featureMarc Mutz2019-06-291-0/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... and schedule it for removal in Qt 6. This appears to have come to some fame on the internet, so better add a deprecation warning before we remove it in Qt 6. Change-Id: I42d91d933f47dfd2d8d54c92358e9e46ced6bf21 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | | QObject: fix allocation of IDs for the undocumented userData() featureMarc Mutz2019-06-291-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This appears to have come to some fame on the internet, so better fix the implementation before we remove it in Qt 6. Change-Id: Ia37ca89105b13bea1ffcdce8b2e8cd957b7bd108 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Port from implicit to explicit atomic pointer operationsMarc Mutz2019-06-294-24/+24
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code used the implicit conversions from QAtomicPointer<T> to T* and vice versa. The semantics of these differ from the ones std::atomic uses, so we're going to deprecate these, like we did for load() and store(), too. This patch fixex some users of these APIs before we deprecate them. Change-Id: I0a88bb1c359392538bb64b511bfc62381a56a468 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Introduce Q_NAMESPACE_EXPORTGiuseppe D'Angelo2019-06-282-3/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A recurring problem with the Q_NAMESPACE macro is that it declares an object (staticMetaObject) in the surrounding namespace. That object lacks any export/import qualification to make it usable with shared libraries. Introduce therefore another macro to work around this issue, allowing the user to prefix the object with an exporting macro, f.i. like this: Q_NAMESPACE_EXPORT(Q_CORE_EXPORT) The old macro can simply then be rewritten in terms of this new one, supplying an empty export macro. Note that NOT passing an argument to a macro expecting one is well defined behavior in C99 -- the macro will expand an empty token. Of course, MSVC doesn't like this and emits warnings. As a workaround, use a variadic macro. [ChangeLog][QtCore] Added the new Q_NAMESPACE_EXPORT macro. It can be used just like Q_NAMESPACE to add meta-object information to a namespace; however it also supports exporting of such information from shared libraries. [ChangeLog][Potentially Source-Incompatible Changes] Prefixing Q_NAMESPACE with an export macro may no longer work. Use the new Q_NAMESPACE_EXPORT macro for that use case. Fixes: QTBUG-68014 Change-Id: Ib044a555ace1f77ae8e0244d824ec473550f3d8e Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | | | Port from implicit to explicit atomic integer operationsMarc Mutz2019-06-282-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The old code used the implicit conversions from QAtomicInteger<T> to T and vice versa. The semantics of these differ from the ones std::atomic uses, so we're going to deprecate these, like we did for load() and store(), too. This patch fixex some users of these APIs before we deprecate them. Change-Id: I4877276581757cd57e042efea8296fe535a493d1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | Merge remote-tracking branch 'origin/5.12' into devLiang Qi2019-06-252-6/+10
|\ \ \ \ | | |_|/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/gui/painting/qdrawhelper.cpp src/gui/text/qdistancefield.cpp src/gui/text/qdistancefield_p.h src/network/ssl/qsslsocket_openssl.cpp src/plugins/platforms/android/qandroidinputcontext.cpp src/widgets/styles/qstylesheetstyle.cpp Done-With: Timur Pocheptsov <timur.pocheptsov@qt.io> Change-Id: Ia7daad21f077ea889898f17734ec46303e71fe6b
| * | | move ENDSESSION_* compat defines to before they are actually usedRolf Eike Beer2019-06-131-6/+6
| | |/ | |/| | | | | | | | | | | | | | | | | | | This commit amends 144d33df72e5ca905b1d64134784923d5c. Change-Id: Ic6bc475c9d8c3bb727ee209dbab437a18e219b6d Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
| * | Fix bogus setAttribute setter warningMichal Klocek2019-06-191-0/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Since e9e16c74643 running webengine application you can get warning "Attribute Qt::AA_ShareOpenGLContexts must be set before QCoreApplication is created." WebEngine set shared open gl context on qt_call_pre_routines, so when QCoreApplicationPrivate init() runs. Fixes: QTBUG-76391 Change-Id: I5fc146ed70054b0c1597fe06615cea2d7a8969d8 Reviewed-by: Kai Koehne <kai.koehne@qt.io>
* | | QtCore: use new QLatin1String::arg()Marc Mutz2019-06-032-7/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Saves ~600B in text size on optimized GCC 9.1 Linux AMD64 builds. Change-Id: I12f4e7c8d28af9549b481859bc96a155aeb6f15c Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Mårten Nordheim <marten.nordheim@qt.io>
* | | QObject: fix memory order on load/store of signal spy callback setMarc Mutz2019-06-201-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | QSignalSpyCallbackSet is a set of pointers, so when we store a pointer to it for later dereferencing, we need to use a release fence for the store and a corresponding acquire on load, lest the two don't synchronize with each other and we end up with a data race. Amends a65752c71bd25bbb66bf33d3a82f7901419c5d95. Change-Id: Ic2983d76237c5c5b00eb2a3575b10beb84d57190 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-2016-186/+186
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Semi-automated, just needed ~20 manual fixes: $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)load\(\)/$1loadRelaxed\(\)/g' -i \{\} + $ find \( -iname \*.cpp -or -iname \*.h \) -exec perl -pe 's/(\.|->)store\(/$1storeRelaxed\(/g' -i \{\} + It can be easily improved (e.g. for store check that there are no commas after the opening parens). The most common offender is QLibrary::load, and some code using std::atomic directly. Change-Id: I07c38a3c8ed32c924ef4999e85c7e45cf48f0f6c Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | Convert uses of QTime as a timer to QElapsedTimerEdward Welbourne2019-06-141-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2297f61efa5adf9ea5194c7f3ff68574cbcf452c Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* | | Run prebuilt android test APKsBogDan Vatra2019-06-135-9/+63
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | androidtestrunner now checks is the apk is build and if it is, it will skip the build phase. Now we can build the apks in parallel (which takes most of the time) and run them sequentially. This way running tests on Android is much faster. Change-Id: I82f34723ac08f7728cc0daab3366e03821335eed Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* | | QObject/QWidget::setParent: add assertions to prevent loopsGiuseppe D'Angelo2019-06-072-0/+26
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | It is perfectly possible to accidentally create a parent/child loop. This can happens by direct means (a->setParent(b); b->setParent(a);), or some more subtle means, e.g. class MyClass : public QObject { MyClass() : QObject(this) {} }; Since this is UB, add a few robustness checks to make sure the code above crashes right away (at least in debug builds). Change-Id: I6583c8514b4c1f8a90677b04c77b8e8f0c15dba3 Reviewed-by: Liang Qi <liang.qi@qt.io> Reviewed-by: Sérgio Martins <sergio.martins@kdab.com>
* | | Merge remote-tracking branch 'origin/5.13' into devLiang Qi2019-06-145-9/+105
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp qmake/generators/unix/unixmake2.cpp src/corelib/thread/qthread_unix.cpp tests/auto/corelib/tools/qsharedpointer/tst_qsharedpointer.cpp Change-Id: I1df0d4ba20685de7f9300bf07458c13376493408
| * | doc: Fix tr() documentation issueMartin Smith2019-06-132-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The declaration of tr() in the Q_OBJECT macro interferes with the tr() declaration in the QObject class. This update fixes that bug by resetting QT_TR_FUNCTIONS to be empty and by ensuring that the tr() declaration in class QObject is seen by clang when qdoc is running. Change-Id: If55339fc417f3eee1a1e1ce3df75a18af443d630 Task-number: QTBUG-75864 Reviewed-by: Paul Wicking <paul.wicking@qt.io>
| * | Merge remote-tracking branch 'origin/5.13.0' into 5.13Liang Qi2019-06-111-0/+5
| |\ \ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/wasm/qwasmintegration.cpp src/plugins/platforms/wasm/qwasmintegration.h Change-Id: Idf4c7936513fb1f21daa8f6105b8545f13447bb8
| | * | wasm: make idealThreadCount() work on all threadsMorten Johan Sørvig2019-05-081-0/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | navigator.hardwareConcurrency can be accessed from the main thread only. Read and cache the value on QCoreApplication initialization. Change-Id: I731f7f356ce106c7107977783d4b763326af06b6 Reviewed-by: Lorn Potter <lorn.potter@gmail.com>
| * | | Merge remote-tracking branch 'origin/5.12' into 5.13Qt Forward Merge Bot2019-06-112-0/+86
| |\ \ \ | | | |/ | | |/| | | | | Change-Id: Ic7c790602e4ac3f4a0d3d4630441b28cf76f75fc
| | * | macOS: Introduce QMacKeyValueObserver and use in theme and styleTor Arne Vestbø2019-06-072-0/+86
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I2d21c883628933543ae5a66b694ff7503119bc4a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
| * | | Merge remote-tracking branch 'origin/5.12' into 5.13Liang Qi2019-06-071-8/+8
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/generators/makefile.cpp src/plugins/platforms/cocoa/qcocoaintegration.h src/plugins/platforms/cocoa/qcocoaintegration.mm Done-With: Jörg Bornemann <joerg.bornemann@qt.io> Change-Id: I5a61e161784cc6f947abe370aab8f2971a9cbe78
| | * | Rename QMacScopedObserver to the more fittingly QMacNotificationObserverTor Arne Vestbø2019-05-291-8/+8
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I1d8280fe88871572a3a27e612de49717b3b9ef77 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* | | | Remove a few usages of deprecated APIShawn Rutledge2019-06-131-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | Change-Id: I94bad0b8d3891c6b4a55178836cfff2a4312e330 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | | | QWeakPointer: use an alternative work-round for internalData() usersMarc Mutz2019-06-112-2/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The previous work-around fails, probably because of cross-dependencies. E.g. we have this in QtScXml: In file included from /home/qt/work/install/include/QtCore/qsharedpointer.h:48:0, from ../../src/scxml/qscxmltabledata_p.h:55, from ../../src/scxml/qscxmltabledata.cpp:40: /home/qt/work/install/include/QtCore/qsharedpointer_impl.h:687:12: error: ‘QPointer’ does not name a type; did you mean ‘pointer’? friend QPointer<X> ^~~~~~~~ pointer /home/qt/work/install/include/QtCore/qsharedpointer_impl.h:689:23: error: ‘QSmartPointerConvertFunctor’ in namespace ‘QtPrivate’ does not name a template type friend QtPrivate::QSmartPointerConvertFunctor<QWeakPointer>; ^~~~~~~~~~~~~~~~~~~~~~~~~~~ To fix, grand friendship only to a non-template class with a templated static method that returns internalData(). This fixes most users, except in qmetatype.h, which does not include qsharedpointer.h. In order to use the non-template class in there, we need to delay its name lookup to instantiation time. We do this by artificially making it a dependent name, by using a class template that inherits from our befrieded class. Change-Id: I12b427f1fe9503df819ea5436d780972d6402e68 Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | | | QMetaType: fix an is_pod test that C++11 brokeMarc Mutz2019-06-121-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | C++11 allows non-POD-types in unions, so the test didn't test anything. Use a static_assert over std::is_pod instead. Change-Id: Ida7ef0551ae6ae07357a987a409294d2a386be2f Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io>
* | | | Move away from using 0 as a pointer constantAllan Sandfeld Jensen2019-06-077-74/+82
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Cleans up most of corelib to use nullptr or default enums where appropriate. Change-Id: Ifcaac14ecdaaee730f87f10941db3ce407d71ef9 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | | rtems: Fix detection bad file descriptorMikhail Svetkin2019-06-051-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | RTEMS does not support poll/select and etc for files and fcntl(fd, F_GETFD) can not say that. Change-Id: If5ad160cd81e347fac72d2bafcb5b5bb815ed059 Reviewed-by: Ryan Chu <ryan.chu@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>