summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qcoreapplication_p.h
Commit message (Collapse)AuthorAgeFilesLines
* Updated license headersJani Heikkinen2016-01-151-14/+20
| | | | | | | | | | | From Qt 5.7 -> LGPL v2.1 isn't an option anymore, see http://blog.qt.io/blog/2016/01/13/new-agreement-with-the-kde-free-qt-foundation/ Updated license headers to use new LGPL header instead of LGPL21 one (in those files which will be under LGPL v3) Change-Id: I046ec3e47b1876cd7b4b0353a576b352e3a946d9 Reviewed-by: Lars Knoll <lars.knoll@theqtcompany.com>
* Merge remote-tracking branch 'origin/5.5' into 5.6Liang Qi2015-10-021-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | 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 two data races in QThread/QThreadDataDavid Faure2015-09-221-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | * theMainThread is written by the main thread and read by QThreadData::~QThreadData() (any managed thread) * QThreadData::thread is written by QThread::~QThread (in the parent thread) and read+written by QThreadData::~QThreadData (in the managed thread). This can happen because QThreadData is refcounted so the managed thread (which derefs it) races with the parent thread (which sets it to 0). Change-Id: I72de793716391a0937254cda6b4328fcad5060c7 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Add a way for auxiliary threads to handle events without CoreAppThiago Macieira2015-07-181-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | 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-181-3/+3
|/ | | | | | | | | | | | | | | | 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>
* 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: Reintroduce copy of argv.Friedemann Kleint2015-02-101-1/+2
| | | | | | | | | | | | | | Since argc/argv is modified by QCoreApplication-derived classes, a copy of the original arguments is needed for comparison. This fixes a crash in Qt Quick 2 tests (which use the -qmljsdebugger=<port> argument) introduced by dff18b8e80609da91bf9e9134967dcf0d23eca9e . Task-number: QTBUG-30330 Change-Id: Ic145ac923e0a7c504ab16602c8686268e4fd9700 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Simon Hausmann <simon.hausmann@theqtcompany.com>
* Windows: Allow for passing a modified argv to QCoreApplication.Friedemann Kleint2015-02-051-3/+2
| | | | | | | | | | | | | | | | | 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>
* Remove friends of QEvent.Friedemann Kleint2014-05-181-0/+1
| | | | | | | | Introduce function to set the spontaneous flag to QCoreApplicationPrivate to solve a few cases. Change-Id: I7c1f1f3644defe00deea9cecb244ca258afd5b94 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Setting QT_NO_DEBUG should not remove symbolsLars Knoll2014-03-211-2/+0
| | | | | | | | | | | | | | Removing symbols when defining QT_NO_DEBUG is a bad idea. In this case it means that you can't compile corelib as a release build and widgets as debug without getting an undefined symbol. Instead leave the method in the release build, but simply don't call it. Change-Id: I50426aefd62e82bccd933323aa0f67c6e5294961 Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Prevent foolish use of setuid when using Qt.Richard J. Moore2014-01-071-0/+1
| | | | | | | | | | | | | | | | In order to prevent people from shooting themselves in the foot, abort if we're running setuid. This behavior can be disabled by calling QCoreApplication::setSetuidAllowed(true) in order to support legacy code. [ChangeLog][QtCore][Important Behavior Changes] Running Qt applications that are setuid has been prevented. If you really need to do this then you can call QCoreApplication::setSetuidAllowed(true) before creating the QCoreApplication instance. Change-Id: I992a9a0cd8420693d438852a05666e3dbb2c9d6a Reviewed-by: Olivier Goffart <ogoffart@woboq.com> Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com> Reviewed-by: Lars Knoll <lars.knoll@digia.com>
* QCoreApplication: Add static setter for application file path.Friedemann Kleint2013-11-261-1/+3
| | | | | | | | | | | | | | | In cases where QGuiApplication is instantiated by a library embedded into another application via some plugin mechanism (for example, Active X controls built using Qt), the QPA platform plugin and other plugins cannot be found next to the application executable. In this case, the library should set the application file path to its deployment location such that plugin paths are set accordingly, the directory is added to the path and qt.conf is found, should it exist. Task-number: QTBUG-34989 Change-Id: I4a53104b5121a8d26751129912f999228be45dfd Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Don't cache QCoreApplication::appName.Robin Burchell2013-10-311-1/+0
| | | | | | | | | | | This isn't a hot codepath, there is no gain to doing this. It introduces unnecessary bloat (see e.g. https://www.webkit.org/blog/2826/unusual-speed-boost-size-matters/) and complicates boosting Qt application startup in cases where argv[0] is overwritten. Change-Id: I55b2b98b0de6b06fe7a049de262f3e19936b73db Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* QPA: Fix event dispatcher dependent operations in platform integrationLaszlo Agocs2013-10-071-0/+1
| | | | | | | | | | | | | | | | | | 999e5162ec3e86c9cb84c3ec95dfd0ba4b21277f breaks QPlatformIntegration implementations that perform tasks in their constructor that rely on the event dispatcher. For example creating a QSocketNotifier is not possible anymore since the event dispatcher is created later on. This is fixed by introducing an additional virtual in QPlatformIntegration that gets called after createEventDispatcher(). Two broken platform plugins have been identified so far: eglfs is creating socket notifiers to read events from input devices and xcb's input context plugins may use dbus. Both are updated accordingly. Task-number: QTBUG-33768 Change-Id: I5badb623958a52ab5314ff93dd7d60061f5df70a Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* Don't assume QCoreApplication::applicationName() will never changev5.2.0-alpha1Tor Arne Vestbø2013-09-251-0/+1
| | | | | | | | | Tests will typically create multiple QCoreApplications, some of them with different argv[0] than others, so we can't use a static variable to keep the cached application name. Change-Id: Icd97527730558944473a71373326b4a82f1b7cf7 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Clean up evaluation license logicTor Arne Vestbø2013-07-051-1/+1
| | | | | | | | | | | | | | | | | | Instead of storing the application type as a uint, we use the enum provided by QCoreApplicationPrivate. The former resulted in a few cases of wrong logic where the values got mixed up, such as always printing the QtCore console warning, even for GUI applications. The qt_eval_is_supported function has been refactored to return enums instead of magic values, to make the logic easier to read. The same goes for qt_eval_days_left, which now only concerns itself with the number of days left. qt_eval_is_expired() has been added to use for easy checking of expiration date. Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Change-Id: Ia0e85b2103f790a7e02e0d6e567a477b3145fcb9 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@digia.com>
* add QCoreApplication to bootstrap libOswald Buddenhagen2013-03-141-14/+32
| | | | | | | | | | | this required making it compile with QT_NO_QOBJECT. of course this disables anything related to threading and event processing. needed for bootstrapping qmldevtools (qmlmin, lupdate) Change-Id: I6f8bd3996ac7b6eee49a5b8a55143d358abe35ee Reviewed-by: Joerg Bornemann <joerg.bornemann@digia.com> Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@digia.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>
* Remove QApplication::type() and make QCoreApplication::Type internalJ-P Nurmi2012-11-231-0/+5
| | | | | | | | | | | | These Qt3 legacy application types do not match the application types available in Qt5. Thus, the decision was to kill the confusing and mostly useless type enum. Use for example qobject_cast instead to find out the application type. Task-number: QTBUG-28093 Change-Id: Ia8cf7c3ea98a3cea27f74760d62e519ea10bce9f Reviewed-by: Lars Knoll <lars.knoll@digia.com> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Re-revert "Delay creation of the process manager"Thiago Macieira2012-10-151-2/+0
| | | | | | | | | | | | | | | This reverts commit daba2c507ad42c66dafa6a29cffa94e9641e0c58, re-applying commit d9c06bf25210b3d0b31ee6126e57bcb82c292da1, because the change was accidentally brought back in commit eae8fb85997d82ecec0743ba3e470681129bff41. There's a potential deadlock when a QProcess is created while a QCoreApplication is instantiated but never executed, or if the main thread waits() for the child thread. Task-number: QTBUG-27260 Change-Id: I9e0fdc0341b3063de90979377bac35f2a827b260 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@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>
* Provide public API for native event filtering, moved up from QPA.David Faure2012-07-201-2/+0
| | | | | | | | | | | | | | | | | | The previous API was hard to use (global function, no type safety, manual chaining), and confusing (app vs dispatcher split only made sense on Windows). Installing and removing out of order would have the risk of setting back a dangling pointer (crash). Meanwhile QPA added type safety, and this new API models the QObject::installEventFilter API for ease of use. The virtual method is in a new interface, QAbstractNativeEventFilter. QPA was even calling the dispatcher event filter with QPA-private event classes, which made no sense (refactoring leftover from when the code was in the dispatcher). Now the QPA plugins trigger the qcoreapp event filters with the actual native events directly. Change-Id: Ie35e47c59c862383bcaf857b28d54f7c72547882 Reviewed-by: Marius Storm-Olsen <marius.storm-olsen@nokia.com>
* Fix applicationName() being empty in QApplication.David Faure2012-07-161-1/+1
| | | | | | | | | | | | | | | A virtual method was reimplemented to return an always-empty string, probably a leftover from a refactoring. This fix showed that tst_qwidget_window was buggy: between Qt4 and Qt5, a "Before" became "After", which made "Before" unused, and was masking the fact that the app name was empty by default. In addition, the earlier Qt5 change that made the app name default to argv[0] now requires updating this test, now that it's actually working. Change-Id: I5360026821a9b95bedd0ff09dba3d51a22e542b7 Reviewed-by: Marc Mutz <marc.mutz@kdab.com> Reviewed-by: Paul Olav Tvete <paul.tvete@nokia.com>
* QCoreApplication: No longer hardcode arguments to be filtered out.Friedemann Kleint2012-05-161-0/+4
| | | | | | | | | | | | On Windows, Unicode command line arguments are re-created from the original command line filtering out the known arguments. To avoid having to hard-code all arguments of derived application classes, keep the original argv-array and use that to verify if an argument is still present. Task-number: QTBUG-25724 Change-Id: I5d7bbd9530b1b74e1dcd22a0edc4f323ef687d23 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Avoid using iconv for text conversion where possibleLars Knoll2012-05-161-0/+2
| | | | | | | | | | | | Try to use a builtin codec as codecForLocale() if possible first. Fall back and instantiate the iconv codec only if that failed. In addition, make sure we initialize the locale correctly before we try to setup the codec. Change-Id: I86d635f9d11e8ff93093f162e79fb37f3d85731b Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix ref counted window close handling.Stephen Kelly2012-02-161-0/+4
| | | | | | | | | | Instead of refcounting QWindow visibility, we ask the Application subclass whether quitting is appropriate. Task-Id: QTBUG-24120 Change-Id: Idd19cc1a3e5742fddded89c7638aaaa5e47c568d Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com> Reviewed-by: Robin Burchell <robin+qt@viroteck.net>
* Add the event loop quitlock feature to QtCore.Stephen Kelly2012-01-311-0/+4
| | | | | | | | | | | | | | | | A feature of a ref-counted quit (managed by a quit-lock class) is added to both QEventLoop and QCoreApplication. This allows, for example, an event loop to quit() when there is no more work for it to do. quitOnLastWindowClosed is implemented in terms of the refcount in QCoreApplication so that jobs can be completed before the application quits. Change-Id: I14c8f4e7ee12bbf81a6e5849290d4c8ff37fa110 Reviewed-by: David Faure <faure@kde.org> Reviewed-by: Bradley T. Hughes <bradley.hughes@nokia.com>
* Remove Symbian specific code from QtCore.Xizhi Zhu2012-01-301-18/+1
| | | | | Change-Id: I131303e28a12dccb96de3de4ca0073b389a9bbae Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* Remove "All rights reserved" line from license headers.Jason McDonald2012-01-301-1/+1
| | | | | | | | | | As in the past, to avoid rewriting various autotests that contain line-number information, an extra blank line has been inserted at the end of the license text to ensure that this commit does not change the total number of lines in the license header. Change-Id: I311e001373776812699d6efc045b5f742890c689 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update contact information in license headers.Jason McDonald2012-01-231-1/+1
| | | | | | | Replace Nokia contact email address with Qt Project website. Change-Id: I431bbbf76d7c27d8b502f87947675c116994c415 Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Update copyright year in license headers.Jason McDonald2012-01-051-1/+1
| | | | | Change-Id: I02f2c620296fcd91d4967d58767ea33fc4e1e7dc Reviewed-by: Rohan McGovern <rohan.mcgovern@nokia.com>
* Move handling of -qmljsdebugger argument to QCoreApplicationKai Koehne2011-09-191-0/+4
| | | | | | | | | | | | Move handling of -qmljsdebugger= argument from QApplication to QCoreApplication. It makes sense to allow debugging also for applications based on QCoreApplication (which we intend to support in QtDeclarative). Change-Id: I5a03a4510fc166cea5aad146da673ee0e7cd5d36 Reviewed-on: http://codereview.qt-project.org/5121 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Kent Hansen <kent.hansen@nokia.com>
* Merge remote branch 'gerrit/master' into HEADSamuel Rødal2011-09-061-1/+0
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe src/corelib/global/qglobal.h src/gui/kernel/qplatformnativeinterface_qpa.h src/gui/widgets/qlinecontrol.cpp src/gui/widgets/qmenu_mac.mm src/gui/widgets/qmenu_p.h src/gui/widgets/qmenubar.cpp src/gui/widgets/qmenubar_p.h src/gui/widgets/widgets.pri src/plugins/platforms/wayland/qwaylandnativeinterface.cpp src/plugins/platforms/wayland/qwaylandnativeinterface.h src/src.pro tests/auto/qdir/tst_qdir.cpp tests/auto/qfileinfo/tst_qfileinfo.cpp tests/auto/qsslsocket/tst_qsslsocket.cpp tests/auto/qstring/tst_qstring.cpp Change-Id: I64cf2cefa532ba87a92f632e3595ce6914183e9b
| * Don't use QSettings to "cache" plugin informationBradley T. Hughes2011-09-051-1/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The main rationale of the cache was to examine the plugin's build-key before loading it. Now that the build-key has been removed, the cache has lost its usefulness. This is part of a larger push to not use QSettings for Qt specific settings or caches. See also: http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000892.html http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000960.html http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000907.html http://lists.qt.nokia.com/pipermail/qt5-feedback/2011-August/000904.html Change-Id: I96e84aa25983c8e06e027ff70cef109444c362a2 Reviewed-on: http://codereview.qt.nokia.com/3978 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
* | Merge remote branch 'gerrit/master' into refactorLars Knoll2011-07-061-3/+0
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: config.tests/unix/opengldesktop/opengldesktop.cpp examples/itemviews/interview/interview.pro examples/mainwindows/mainwindow/mainwindow.pro examples/openvg/README examples/richtext/textedit/textedit.pro examples/tools/undo/undo.pro src/corelib/global/qglobal.h src/corelib/kernel/qcoreapplication.h src/corelib/kernel/qcoreevent.h src/corelib/kernel/qmetatype.h src/gui/kernel/qevent.cpp src/gui/kernel/qevent.h src/gui/painting/qpaintengine_raster.cpp src/gui/painting/qpaintengine_raster_p.h src/gui/text/qfontdatabase.cpp src/opengl/qgl.h src/openvg/qpaintengine_vg.cpp src/plugins/platforms/wayland/qwaylandwindow.cpp tests/auto/qmainwindow/qmainwindow.pro Change-Id: I6bfb586740a68379bb99f4612ec993393a5f3234
| * Remove the remaining QT3_SUPPORT code in corelibLars Knoll2011-06-291-3/+0
| | | | | | | | | | | | | | Change-Id: I6641c62d75d2034a46ea7cc869ae65285ae8b8f4 Reviewed-on: http://codereview.qt.nokia.com/866 Reviewed-by: Qt Sanity Bot <qt_sanity_bot@ovi.com> Reviewed-by: Liang Qi <liang.qi@nokia.com>
* | QWindowContext / QWindowFormat refactor.Samuel Rødal2011-06-101-0/+2
|/ | | | | | | | | | | | | To enable having a single GL context used for multiple drawables we need to de-couple the context class a bit more from the window class in the plugin API. Now contexts are created stand-alone based on a GL format and a share context, and when calling makeCurrent() a desired surface is specified. This maps well to GLX, EGL, Cocoa, AGL, and WGL, which all support this use case. QWindowContext is renamed to QGuiGLContext, and QWindowFormat is renamed to QGuiGLFormat. We have the ability to introduce a pbuffer or similar other offscreen GL drawable abstraction in the future.
* Update licenseheader text in source files for qtbase Qt moduleJyri Tahtela2011-05-241-17/+17
| | | | | | | Updated version of LGPL and FDL licenseheaders. Apply release phase licenseheaders for all source files. Reviewed-by: Trust Me
* Fix regression with QSettings patchmae2011-05-101-1/+1
| | | | | | The plugin loader is used without QCoreApplication. This fixes 31ef8fa6abc2ea23c6f0a996b36494d88aafb0b5 (cherry picked from commit 988871dabf3c949ffc71d126131281a3ae641ebf)
* Reduce open and stat system calls for QSettingsmae2011-05-101-0/+2
| | | | | | | | | | | | | | The patch moves the global static QSettings object from QLibrary to QCoreApplication and reduces a few stat and open calls. Without the patch, a large Trolltech.conf was pushed out of the unused settings cache during startup, meaning Trolltech.conf was parsed more than once. Reviewed-by: Liang Qi (cherry picked from commit 31ef8fa6abc2ea23c6f0a996b36494d88aafb0b5)
* Initial import from qtquick2.Qt by Nokia2011-04-271-0/+2
| | | | | Branched from the monolithic repo, Qt qtquick2 branch, at commit a4a585d2ee907746682846ae6e8a48e19deef469
* Initial import from the monolithic Qt.Qt by Nokia2011-04-271-0/+146
This is the beginning of revision history for this module. If you want to look at revision history older than this, please refer to the Qt Git wiki for how to use Git history grafting. At the time of writing, this wiki is located here: http://qt.gitorious.org/qt/pages/GitIntroductionWithQt If you have already performed the grafting and you don't see any history beyond this commit, try running "git log" with the "--follow" argument. Branched from the monolithic repo, Qt master branch, at commit 896db169ea224deb96c59ce8af800d019de63f12