summaryrefslogtreecommitdiffstats
path: root/tests/auto/corelib/kernel/qcoreapplication/tst_qcoreapplication.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Change license for tests filesLucie Gérard2024-02-041-1/+1
| | | | | | | | | | | | According to QUIP-18 [1], all tests file should be LicenseRef-Qt-Commercial OR GPL-3.0-only [1]: https://contribute.qt-project.org/quips/18 Pick-to: 6.7 Task-number: QTBUG-121787 Change-Id: I9657df5d660820e56c96d511ea49d321c54682e8 Reviewed-by: Christian Ehrlicher <ch.ehrlicher@gmx.de>
* Fix sending deferred delete events when posted before outermost loopMikolaj Boc2023-06-091-1/+28
| | | | | | | | | | | | | | | | | | | | | QDeferredDeleteEvent has the loopLevel field, which is a sum of scope and loop levels found at posting. In sendPostedEvents however, it is impossible to only use this information to find delete events posted before the outermost loop (which should be handled by any loop) based solely on this information, as the scope level essentialy removes the information on loop level. Break the loopLevel in two, storing both loop and scope levels in QDeferredDeleteEvent, so that we can check whether an event was posted before the outermost event loop (for which we need to compare only the loop level). QDeferredDeleteEvent was also made private as it should - it is an implementation detail that wasn't hidden properly. Change-Id: I0a607a0bd3a2deb5024acad67f740dbf4338574c Reviewed-by: Morten Johan Sørvig <morten.sorvig@qt.io> Reviewed-by: Mikołaj Boc <Mikolaj.Boc@qt.io>
* tst_QCoreApplication: ensure that theMainThread has expected statesThiago Macieira2023-04-261-3/+37
| | | | | | | | | | | | | | | | | | The expected states are: - nothing sets theMainThread before main() - theMainThread is reset when the last QObject (the QCoreApplication in the test) is destroyed The GUI version of this test appears to leak a lot of QObjects. By the time this function runs, theMainThread's QThreadData still has a refcount of 66 on Linux/XCB. The Windows non-GUI version also failed. Neither situation was investigated to see why objects are getting leaked. Pick-to: 6.5 Change-Id: Idd5e1bb52be047d7b4fffffd17507d9e6ef08743 Reviewed-by: Marc Mutz <marc.mutz@qt.io> Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Port from container::count() and length() to size() - V5Marc Mutz2022-11-031-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a semantic patch using ClangTidyTransformator as in qtbase/df9d882d41b741fef7c5beeddb0abe9d904443d8, but extended to handle typedefs and accesses through pointers, too: const std::string o = "object"; auto hasTypeIgnoringPointer = [](auto type) { return anyOf(hasType(type), hasType(pointsTo(type))); }; auto derivedFromAnyOfClasses = [&](ArrayRef<StringRef> classes) { auto exprOfDeclaredType = [&](auto decl) { return expr(hasTypeIgnoringPointer(hasUnqualifiedDesugaredType(recordType(hasDeclaration(decl))))).bind(o); }; return exprOfDeclaredType(cxxRecordDecl(isSameOrDerivedFrom(hasAnyName(classes)))); }; auto renameMethod = [&] (ArrayRef<StringRef> classes, StringRef from, StringRef to) { return makeRule(cxxMemberCallExpr(on(derivedFromAnyOfClasses(classes)), callee(cxxMethodDecl(hasName(from), parameterCountIs(0)))), changeTo(cat(access(o, cat(to)), "()")), cat("use '", to, "' instead of '", from, "'")); }; renameMethod(<classes>, "count", "size"); renameMethod(<classes>, "length", "size"); except that the on() matcher has been replaced by one that doesn't ignoreParens(). a.k.a qt-port-to-std-compatible-api V5 with config Scope: 'Container'. Added two NOLINTNEXTLINEs in tst_qbitarray and tst_qcontiguouscache, to avoid porting calls that explicitly test count(). Change-Id: Icfb8808c2ff4a30187e9935a51cad26987451c22 Reviewed-by: Ivan Solovev <ivan.solovev@qt.io> Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
* Fix return value of qGlobalPostedEventsCount()Marc Mutz2022-05-181-11/+6
| | | | | | | | | | | | The unsigned return value was very un-Qt-ish, and, indeed, tst_QCoreApplication just stored the result in ints. Port to qsizetype, being the type of the expression that the function calculates. Task-number: QTBUG-103532 Change-Id: I95a81a686439b0686faad7a430adeaab66dc9e8d Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Make qGlobalPostedEventsCount() auto-test-exported-onlyMarc Mutz2022-05-181-0/+2
| | | | | | | | The only in-tree user outside QtCore is tst_QCoreApplication, guard the (single) test function there with QT_BUILD_INTERNAL. Change-Id: Ibc87ba76f2135cd8283acd75318f80a95e4b5c45 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Remove manual declarations of qGlobalPostedEventsCount()Marc Mutz2022-05-181-4/+1
| | | | | | | | | ... in favor of including qabstracteventdispatcher_p.h, where needed. Keeps the code DRY. Change-Id: I5bee2e653cb29ffac2601ff03c952a4b3adbdb9c Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Use SPDX license identifiersLucie Gérard2022-05-161-28/+3
| | | | | | | | | | | | | Replace the current license disclaimer in files by a SPDX-License-Identifier. Files that have to be modified by hand are modified. License files are organized under LICENSES directory. Task-number: QTBUG-67283 Change-Id: Id880c92784c40f3bbde861c0d93f58151c18b9f1 Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Jörg Bornemann <joerg.bornemann@qt.io>
* Repair tst_qcoreapplication to not segfault on AndroidAndreas Buhr2022-02-151-2/+2
| | | | | | | | | | | | | | tst_qcoreapplication.cpp is used both in tst_qcoreapplication and tst_qguiapplication. To distinguish these two compilations, the define QT_GUI_LIB was used. This led to an error on Android, where Qt::Gui is always linked, because the Qt Android Platform Plugin needs it. This patch introduces the preprocessor define QT_QGUIAPPLICATIONTEST which is to be used only in the compilation of tst_qguiapplication. This is then used instead of QT_GUI_LIB. Change-Id: Ifa5bfacb197d68365288c1da85573106515fc6c2 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Replace QtTest headers with QTestDavid Skoland2020-12-221-1/+1
| | | | | | | | | | | Complete search and replace of QtTest and QtTest/QtTest with QTest, as QtTest includes the whole module. Replace all such instances with correct header includes. See Jira task for more discussion. Fixes: QTBUG-88831 Change-Id: I981cfae18a1cabcabcabee376016b086d9d01f44 Pick-to: 6.0 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Another round of replacing 0 with nullptrAllan Sandfeld Jensen2020-10-071-3/+3
| | | | | | | | | This time based on grepping to also include documentation, tests and examples previously missed by the automatic tool. Change-Id: Ied1703f4bcc470fbc275f759ed5b7c588a5c4e9f Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* QAbstractEventDispatcher: change event dispatcher timer interval to qint64Liu Yang2020-09-211-1/+1
| | | | | | | | | Resolve remaining Qt6 TODO [ChangeLog][QtCore][QAbstractEventDispatcher] The signature of the abstract virtual registerTime function now takes a qint64 value for the interval parameter. Change-Id: I10166ad5cfb455edc404d465a3731ff094a8977e Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* QEventDispatcherWin32: create internal window on constructionAlex Trotsenko2020-09-161-0/+40
| | | | | | | | | | | | | | | | | When QCoreApplication object is instantiated, creation of the internal message window is delayed until QEventDispatcherWin32::processEvents() is called or socket/event notifier is registered. But, if the user uses a native event loop, posted events are not delivered and timers do not work. This problem was fixed in a4ac4b326318ed9034466305222280ed8d1651b5 for QWindowsGuiEventDispatcher in the same way. So, the risk of regression is minimal. Change-Id: I7bbb721d96046f64d21a7b0e553e46798b37189c Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Friedemann Kleint <Friedemann.Kleint@qt.io>
* Remove most compiler warnings about missing overridesLars Knoll2020-09-111-17/+17
| | | | | | | | | | | | Remove around 1000 compiler warnings about missing overrides in our auto tests. This significantly reduce the compiler warning noise in our auto tests, so that one can actually better see the real problems inbetween. Change-Id: Id0c04dba43fcaf55d8cd2b5c6697358857c31bf9 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io>
* Deliver Quit event when calling QCoreApplication::quit()Tor Arne Vestbø2020-09-071-0/+66
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Instead of QCoreApplication::quit() directly calling exit(0), which would leave QGuiApplication and client code out of the loop, we now send the Quit event, and let it pass through event delivery, before finally ending up in QCoreApplication::event(), where we call exit(0). This has the advantage that QGuiApplication can ensure all windows are closed before quitting, and if any of those windows ignore the close event the quit will be aborted. This aligns the behavior of synthetic quits via QCoreApplication::quit() with spontaneous quits from the platform via QGuiApplicationPrivate::processApplicationTermination. Clients who wish to exit the application without any event delivery or potential user interaction can call the lower level exit() function directly. [ChangeLog][QtGui] Application termination via qApp->quit() will now deliver Quit events to the application, which in turn will result in application windows being closed as part of the application quit, with an option to cancel the application quit by ignoring the close event. Clients who explicitly want to exit the application without any user interaction should call QCoreApplication::exit() explicitly. Task-number: QTBUG-45262 Task-number: QTBUG-33235 Task-number: QTBUG-72013 Task-number: QTBUG-59782 Change-Id: Id4b3907e329b9ecfd936fe9a5f8a70cb66b76bb7 Reviewed-by: Volker Hilsheimer <volker.hilsheimer@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* Get rid of hasPendingEvents() and flush()Lars Knoll2020-09-061-4/+0
| | | | | | | They are unused. Change-Id: I77383f2be45551401ed9c2f88285511134cc8b0d Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Remove winrtOliver Wolff2020-06-061-6/+1
| | | | | | | | | Macros and the await helper function from qfunctions_winrt(_p).h are needed in other Qt modules which use UWP APIs on desktop windows. Task-number: QTBUG-84434 Change-Id: Ice09c11436ad151c17bdccd2c7defadd08c13925 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@qt.io>
* Port from QAtomic::load() to loadRelaxed()Giuseppe D'Angelo2019-06-201-11/+11
| | | | | | | | | | | | | | | 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>
* Fix warnings & deprs in tst_qcoreapplication and tst_qguiapplicationShawn Rutledge2019-06-051-1/+1
| | | | | | | | | | | | | | | | | | | | | | It's perhaps best to ensure that functions we are deprecating shall no longer be used in tests. Also, fix the "0 as nullptr" warnings. Change-Id: I2f22c9b9482e80fa120bcd728ec269198a36678f Reviewed-by: Richard Moe Gustavsen <richard.gustavsen@qt.io>
* fix out-of-bounds access on trailing percent sign in tr() argumentOswald Buddenhagen2019-01-141-0/+6
| | | | | | | | | | | | tr() recognizes %n and %Ln. it offers no way to escape lone percent signs, which implies that they must be interpreted verbatim, which is what the code actually does. except that it would run off the end if the % appeared at the end of the string. Fixes: QTBUG-57171 Done-with: Mateusz Starzycki <mstarzycki@gmail.com> Change-Id: Icf81925c482be1ea66ec8daafb3e92ad17ea7fab Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@gmx.de>
* Modernize the "thread" featureUlf Hermann2018-08-171-2/+2
| | | | | | | | | | Add it to configure.json and replace all occurrences of QT_NO_THREAD with QT_CONFIG(thread). Add conditions for other features that depend on thread support. Remove conditions where we can use the QMutex and QThreadStorage stubs. Change-Id: I284e5d794fda9a4c6f4a1ab29e55aa686272a0eb Reviewed-by: Eskil Abrahamsen Blomfeldt <eskil.abrahamsen-blomfeldt@qt.io>
* Replace Q_DECL_OVERRIDE with override where possibleKevin Funk2017-09-191-2/+2
| | | | | | | | | | | | | | | | Remaining uses of Q_DECL_OVERRIDE are in: src/corelib/global/qcompilerdetection.h src/corelib/global/qglobal.cpp doc/global/qt-cpp-defines.qdocconf (definition and documentation of Q_DECL_OVERRIDE) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: Ib9b05d829add69e98a86238274b6a1fcb19b49ba Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* winrt: Fix tst_qcoreapplicationOliver Wolff2017-05-111-4/+9
| | | | | | | | | | | On winrt, the default application version is determined by its manifest file. The template's default version is 1.0.0.0. Additionally addRemoveLibPaths should not fail if libraryPaths only contains currentDir. Change-Id: Ifdd517f1bfe2fdf641f3d728ebe1fa144df1a8ca Reviewed-by: Maurice Kalinowski <maurice.kalinowski@qt.io>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-03-131-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network.pro mkspecs/features/mac/default_post.prf src/corelib/io/qfilesystemengine_win.cpp src/corelib/io/qprocess.cpp src/corelib/io/qprocess.h src/corelib/io/qprocess_p.h src/corelib/io/qprocess_unix.cpp src/corelib/io/qprocess_win.cpp src/corelib/thread/qmutex.cpp src/platformsupport/fontdatabases/windows/windows.pri src/plugins/platforms/eglfs/eglfsdeviceintegration.pro tests/auto/corelib/io/io.pro Change-Id: I8a27e0e141454818bba9c433200a4e84a88d147e
| * Use QT_CONFIG(library) instead of QT_NO_LIBRARYUlf Hermann2017-03-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | For the windows file system engine, we add an extra macro to use library loading if configured to do so, but avoid it on WinRT, as none of the symbols would be found. We also QT_REQUIRE_CONFIG(library) in the library headers and exclude the sources from the build if library loading is disabled. This, in turn, makes it necessary to clean up some header inclusions. Change-Id: I2b152cb5b47a2658996b6f4702b038536a5704ec Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* | Provide sensible defaults for QCoreApplication::applicationVersionJake Petroules2017-01-121-0/+35
|/ | | | | | | | | | | | | | | | [ChangeLog][QtCore] QCoreApplication::applicationVersion now defaults to an appropriate platform-specific value. On Windows, it defaults to the PRODUCTVERSION parameter of the VERSIONINFO resource for classic desktop apps, and the version attribute of the application package manifest for Univeral Windows Platform apps. On Apple Platforms (macOS, iOS, tvOS, watchOS), it defaults to the CFBundleVersion property of the information property list (Info.plist) file. On Android, it defaults to the android:versionName attribute of the AndroidManifest.xml manifest element. On other platforms, the default remains an empty string. Task-number: QTBUG-57715 Change-Id: I26f83dd00737e06f4321cf962aa5fab8398104ec Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QtCore: Remove Windows CE.Friedemann Kleint2016-03-301-1/+1
| | | | | | | | | Remove QSysInfo::WV_CE_5/6 enumeration values, #ifdef sections for Q_OS_WINCE and wince .pro file clauses in library, examples and tests. Task-number: QTBUG-51673 Change-Id: Ib63463445f3a26e04d018b193e4655030002f5f9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Updated license headersJani Heikkinen2016-01-211-18/+13
| | | | | | | | | | | | | From Qt 5.7 -> tools & applications are lisenced under GPL v3 with some exceptions, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new GPL-EXCEPT header instead of LGPL21 one (in those files which will be under GPL 3 with exceptions) Change-Id: I42a473ddc97101492a60b9287d90979d9eb35ae1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.6' into devLiang Qi2015-10-141-5/+0
|\ | | | | | | | | | | | | | | | | Conflicts: tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/io/qprocess/tst_qprocess.cpp tests/auto/corelib/tools/qversionnumber/qversionnumber.pro Change-Id: Ia93ce500349d96a2fbf0b4a37b73f088cc505c6e
| * Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-5/+0
| |\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: qmake/doc/src/qmake-manual.qdoc src/corelib/tools/qstring.h src/gui/image/qimagereader.cpp src/network/access/qnetworkaccessmanager.cpp src/tools/qdoc/doc/examples/examples.qdoc src/widgets/accessible/qaccessiblewidgetfactory_p.h src/widgets/doc/qtwidgets.qdocconf Change-Id: I8fae62283aebefe24e5ca4b4abd97386560c0fcb
| | * Fix tst_QGuiApplication for embedded platforms using eglfs QPAPasi Petäjäjärvi2015-09-101-5/+0
| | | | | | | | | | | | | | | | | | | | | | | | Disable input and cursor for QGuiApplication instances used in autotest to initialize it properly. Change-Id: I78dc9b776269c082c20f244a51f858289129275d Reviewed-by: Laszlo Agocs <laszlo.agocs@theqtcompany.com>
* | | Fix building with QT_NO_LIBRARYUlf Hermann2015-09-301-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If QT_NO_LIBRARY isn't set we cannot test QCoreApplication's library path functions and none of the plugin and library related tests are applicable. Also, examples that rely on dynamic plugin loading for their core functionality obviously don't work. Change-Id: I2d381ee1bc8d944e1181557895a7e92a364fd778 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | | tests/corelib: Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b).Friedemann Kleint2015-08-191-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | | | - Replace Q[TRY]_VERIFY(pointer == 0) by Q[TRY]_VERIFY(!pointer). - Replace Q[TRY]_VERIFY(smartPointer == 0) by Q[TRY]_VERIFY(smartPointer.isNull()). - Replace Q[TRY]_VERIFY(a == b) by Q[TRY]_COMPARE(a, b) and add casts where necessary. The values will then be logged should a test fail. Tests from corelib/tools were omitted in this change. Change-Id: I4c8786d33fcf429d11b2b624c7cd89c28cadb518 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Selectively update library paths when creating QCoreApplicationUlf Hermann2015-07-201-0/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We force a recreation of the library paths with added information on construction of QCoreApplication. This way we can find plugins in the application directory which only becomes known when QCoreApplication is created. When the user changes the library path we create a new list of the manually modified library paths and recalculate it from the delta of original vs. modified paths when QCoreApplication is created. The upsides of this approach vs. keeping an explicit delta are: * We don't need to introduce a separate data structure to hold the added/removed status for delta items or the information that the whole list got replaced. * The lists never get larger than the the real library paths. An explicit delta would have to record all modifications. * I don't think the delta replay algorithm we would have to do anyway could be made much more compact than the one this change introduces. Of course, if the user actually changes anything, the list is duplicated. Considering that this is a rarely used function and that we would have to save some extra information anyway, I think we can live with this. Task-number: QTBUG-38598 Change-Id: I3bfbbd1be62dd5804dcc7ac808b053428a4e3149 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Add a way for auxiliary threads to handle events without CoreAppThiago Macieira2015-07-181-0/+50
|/ | | | | | | | | | | | | | 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>
* Autotest: Check where global event filters get runThiago Macieira2015-06-191-0/+55
| | | | | | | | Global (application-level) event filters are supposed to be run only in the main thread, so ensure that it is the case. Change-Id: I27eaacb532114dd188c4ffff13d5a17d991b8bd2 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Don't overwrite applicationName if already set.David Faure2015-05-091-0/+16
| | | | | | | | | | | | My commit 6c973dee2cb1686ea32657 broke the case where setApplicationName is called before the QCoreApplication constructor. Fixed and added autotest. Task-number: QTBUG-45283 Change-Id: If7bdb0d82be50b50a95a04027f5f9d7143c1a7ac Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Shawn Rutledge <shawn.rutledge@digia.com> Reviewed-by: Giuseppe D'Angelo <giuseppe.dangelo@kdab.com>
* Make QCoreApplication::applicationName available after app destruction.David Faure2015-03-051-4/+9
| | | | | | | | | | | | | | | | Calling applicationName() in the destructor of a global static (e.g. via QLockFile) was working when calling setApplicationName explicitly but otherwise it would suddenly return an empty string. This led to inconsistencies, the application name switching from non-empty to empty at saving-on-destruction time. There was already a global static, used when setting the app name explicitly before construction. Use it now to store the app name in all cases (explicitly set, or fallback). Change-Id: I71d3a0c40158f8bfd022c385b198346a2594b1cb Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Update copyright headersJani Heikkinen2015-02-111-7/+7
| | | | | | | | | | | | | | | | | | Qt copyrights are now in The Qt Company, so we could update the source code headers accordingly. In the same go we should also fix the links to point to qt.io. Outdated header.LGPL removed (use header.LGPL21 instead) Old header.LGPL3 renamed to header.LGPL3-COMM to match actual licensing combination. New header.LGPL-COMM taken in the use file which were using old header.LGPL3 (src/plugins/platforms/android/extract.cpp) Added new header.LGPL3 containing Commercial + LGPLv3 + GPLv2 license combination Change-Id: I6f49b819a8a20cc4f88b794a8f6726d975e8ffbe Reviewed-by: Matti Paaso <matti.paaso@theqtcompany.com>
* Windows: Allow for passing a modified argv to QCoreApplication.Friedemann Kleint2015-02-051-4/+3
| | | | | | | | | | | | | | | | | Check by comparing __argc/__argv whether a modified argv was passed to QCoreApplication. If that is the case, build QCoreApplication::arguments() from that argv instead of using the command line. [ChangeLog][Important Behavior Changes][QCoreApplication] On Windows, QCoreApplication::arguments() now returns a list built from argv on Windows as well if a modified argv was passed to the class' constructor. Task-number: QTBUG-30330 Task-number: QTSOLBUG-184 Change-Id: I2498bb554130e7bfaeada3aebe786dfdd0eb534d Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@theqtcompany.com>
* Update license headers and add new license filesMatti Paaso2014-09-241-19/+11
| | | | | | | | | - Renamed LICENSE.LGPL to LICENSE.LGPLv21 - Added LICENSE.LGPLv3 - Removed LICENSE.GPL Change-Id: Iec3406e3eb3f133be549092015cefe33d259a3f2 Reviewed-by: Iikka Eklund <iikka.eklund@digia.com>
* Base tst_QGuiApplication on tst_QCoreApplication to increase GUI ED coverageTor Arne Vestbø2013-10-011-45/+37
| | | | | | | | | | The QCoreApplication test has quite a few test cases that we would like to exercise using the GUI event-dispatcher. Instead of duplicating the tests for the GUI dispatcher, we inherit tst_QCoreApplication, which also lets us add extra tests that are specific to tst_QGuiApplication. Change-Id: Ib411457131b8d3fed871f682c1c0568577f6127d Reviewed-by: Gabriel de Dietrich <gabriel.dedietrich@digia.com>
* Expose QTest::currentAppName() and remove hard-coded argv[0] in testsTor Arne Vestbø2013-09-261-16/+16
| | | | | | | | Except where we're actually testing QCoreApplication::applicationName() and friends. Change-Id: I25514884c11f43a4f82b1f818f822dc3d79f69a3 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Fix dead lock in the Qt event handlingOlivier Goffart2013-07-101-0/+28
| | | | | | | | | | | | | | | The deadlock is caused because the QEvent is destroyed while holding the event list mutex. And the QEvent may have a custom destructor that will re-enter the event handlng code. The QScopedPointer that should destroy the event must be created after the MutexUnlocker. Regression introduced by commit f9035587b98ac5dc9491e642b8ec84470ec03f0e Task-number: QTBUG-31606 Change-Id: I6b2cbc2656eacdec61b641886953f00bf5b3ff36 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* tst_qcoreapplication: Remove QT_DISABLE_DEPRECATED_BEFORE=0Debao Zhang2013-04-121-1/+1
| | | | | Change-Id: I6d5098ff57293171b5ddd3a58c53718cbbc8e4bf Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clear the current thread data for the main threadThiago Macieira2013-03-051-0/+12
| | | | | | | | | | | | | | | | | | | | | | | | This avoids crashes accessing deleted memory when creating a QObject after the last QObject had been deleted, like a qDebug() in global destructors. ==41000== Invalid read of size 4 ==41000== at 0x5F01ED5: bool QBasicAtomicOps<4>::ref<int>(int&) (qatomic_x86.h:208) ==41000== by 0x5F01309: QBasicAtomicInteger<int>::ref() (qbasicatomic.h:147) ==41000== by 0x5F24051: QThreadData::ref() (qthread.cpp:100) ==41000== by 0x614A984: QObject::QObject(QObject*) (qobject.cpp:681) ==41000== Address 0x6ee73f0 is 0 bytes inside a block of size 152 free'd ==41000== at 0x4A0736C: operator delete(void*) (vg_replace_malloc.c:480) ==41000== by 0x5F240BF: QThreadData::deref() (qthread.cpp:109) ==41000== by 0x6113F6B: QCoreApplicationData::~QCoreApplicationData() (qcoreapplication.cpp:268) The comment right above the change in qthread.cpp looks eerily similar to the problem I'm trying to fix. However, the actual change that introduced the change is not in the Qt public history, so we can't know for sure what the problem was then. Change-Id: I0dba895b041fe6cf81e6f8939ca85035cd00aad1 Reviewed-by: Olivier Goffart <ogoffart@woboq.com>
* Update copyright year in Digia's license headersSergio Ahumada2013-01-181-1/+1
| | | | | Change-Id: Ic804938fc352291d011800d21e549c10acac66fb Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* Test: remove QSKIP in tst_QCoreApplication::argcCaroline Chao2012-10-161-3/+6
| | | | | | | | Instead omit the whole test when Q_OS_WIN is defined since the test is invalid on this platform. Change-Id: Idb77df96b0c2a223cddbfffb4e24c6d1f5d33dfb Reviewed-by: J-P Nurmi <jpnurmi@digia.com>
* Change copyrights from Nokia to DigiaIikka Eklund2012-09-221-24/+24
| | | | | | | | Change copyrights and license headers from Nokia to Digia Change-Id: If1cc974286d29fd01ec6c19dd4719a67f4c3f00e Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Sergio Ahumada <sergio.ahumada@digia.com>
* Make the event notification on Windows be mandatory in all dispatchersThiago Macieira2012-05-041-0/+5
| | | | | | | | | | | | | This way, QWinEventNotifier will work on all Windows systems, not just with the default event dispatcher. Other dispatchers (other than QWin32EventDispatcher) are permitted, so the class should not abort just because of that. If a dispatcher really doesn't want to implement this, they need to implement the virtuals to do nothing, possibly print a warning. Change-Id: I2c132bcde95b9d5941c8906a0fcd2ad964087772 Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>