summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Modernize the "thread" featureUlf Hermann2018-08-171-2/+4
| | | | | | | | | | 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>
* Merge remote-tracking branch 'origin/5.11' into devQt Forward Merge Bot2018-08-071-1/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf src/corelib/doc/src/objectmodel/signalsandslots.qdoc src/plugins/platforms/cocoa/qcocoamenuloader.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection.h src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp tests/auto/gui/image/qimage/tst_qimage.cpp Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Change-Id: I9bd24ee9b00d4f26c8f344ce3970aa6e93935ff5
| * QObject: do allow setProperty() to change the type of the propertyThiago Macieira2018-08-041-1/+2
| | | | | | | | | | | | | | | | | | | | | | [ChangeLog][QtCore][QObject] Fixed a bug in setProperty() that caused a property change not to take effect if the old value compared equal using QVariant's equality operator, but the values were not strictly equal. Task-number: QTBUG-69744 Change-Id: I00e04a465fcf4fc1a462fffd1547885861a07a64 Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix typo as->hasFrederik Gladhorn2018-07-161-2/+2
| | | | | | | | | | | | | | Change-Id: I4f9033660c06686d7b499ec6d28be2c3b64353e2 Reviewed-by: Paul Wicking <paul.wicking@qt.io> Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Tracepoints: trace QObject construction and destructionGiuseppe D'Angelo2018-07-041-0/+5
| | | | | | | | | | Change-Id: I10f5ef391a2d3059ed5e8a26afe5e191adc31e85 Reviewed-by: Rafael Roquetto <rafael.roquetto@kdab.com>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-07-021-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/plugins/platforms/cocoa/qnsview.mm src/plugins/platforms/cocoa/qnsview_dragging.mm src/plugins/platforms/ios/qiosinputcontext.mm src/plugins/platforms/xcb/qxcbconnection.cpp src/plugins/platforms/xcb/qxcbconnection_xi2.cpp src/plugins/platforms/xcb/qxcbwindow.cpp src/tools/androiddeployqt/main.cpp Was moved from qttools into qtbase in 5.11. So re-apply 32398e4d here. tests/auto/corelib/global/qlogging/test/test.pro tests/auto/corelib/global/qlogging/tst_qlogging.cpp tests/auto/corelib/io/qfile/tst_qfile.cpp tests/auto/corelib/kernel/qtimer/tst_qtimer.cpp tests/auto/corelib/thread/qthreadstorage/test/test.pro tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp tests/auto/widgets/kernel/qapplication/test/test.pro Done-with: Gatis Paeglis <gatis.paeglis@qt.io> Done-with: Mårten Nordheim <marten.nordheim@qt.io> Done-with: Oliver Wolff <oliver.wolff@qt.io> Change-Id: Id970486c5315a1718c540f00deb2633533e8fc7b
| * Doc: Add missing full stops in briefsPaul Wicking2018-06-211-1/+1
| | | | | | | | | | | | Task-number: QTBUG-68933 Change-Id: I3f2a9f8c562f9a44bb32bddd31d75abbfe6de04d Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | Add note about calling invokable functions from QML when returning QObjectsSimon Hausmann2018-06-061-0/+5
| | | | | | | | | | | | | | | | | | | | Link to the data ownership section of the QML documentation to elaborate on the special rules that apply for invokable functions that return QObjects. Change-Id: I41ea9089468c9505807cf1fde22be759b397a6d3 Reviewed-by: Mitch Curtis <mitch.curtis@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.11' into devLiang Qi2018-05-241-0/+1
|\| | | | | | | | | | | | | | | | | | | Conflicts: mkspecs/features/qt_common.prf src/corelib/tools/qstring.cpp src/plugins/platforms/windows/qwindowsmousehandler.cpp src/widgets/widgets/qmainwindowlayout_p.h Change-Id: I5df613008f6336f69b257d08e49a133d033a9d65
| * Fix documentation of Q_NAMESPACEOlivier Goffart2018-05-221-0/+1
| | | | | | | | | | | | | | We need to add the \relates command otherwise it won't appear in the documentation Change-Id: I134776c1528445761a7539cf687e4855d39eb7a7 Reviewed-by: BogDan Vatra <bogdan@kdab.com>
* | QObject: Extend debug output of connectLars Schmertmann2018-04-181-1/+6
|/ | | | | | | | | | Sometimes it is hard to find the line, when the warning "QObject::connect: invalid null parameter" appears in the log. This change adds the class names of the sender and receiver to give a hint where to search for the wrong call to connect. Change-Id: I00cead7d943f96d60f198cb3f0bed34ba10285c5 Reviewed-by: André Hartmann <aha_1980@gmx.de>
* Modernize the "regularexpression" featureUlf Hermann2018-03-201-3/+5
| | | | | | | | | | | | | Use QT_CONFIG(regularexpression), disentangle it from QT_BOOTSTRAPPED, switch it off in the bootstrap build, remove the #ifdefs from qregularexpression.{h|cpp}, and add QT_REQUIRE_CONFIG(regularexpression) to the header. qregularexpression.{h|cpp} are already correctly excluded in tools.pri if !qtConfig(regularexpression). Change-Id: I21de154a6a118b76f99003d3acb72ac1e220d302 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
* Use explicit QThreadData::hasEventDispatcher() where possibleTor Arne Vestbø2018-02-141-4/+4
| | | | | Change-Id: Ibce1a82dabb4e1381486211dbfb14eee9572e0ac Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Fix typosJarek Kobus2018-02-131-1/+1
| | | | | Change-Id: Id625efea998f2b4dce9970b903830dc3b3efcd3d Reviewed-by: Leena Miettinen <riitta-leena.miettinen@qt.io>
* doc: clang-qdoc must not see certain function declarationsMartin Smith2018-01-241-1/+3
| | | | | | | | | | | | | | | The macro Q_DECLARE_INTERFACE declared some qobject_cast() functions that clang-qdoc must not see in the contexts where the macro is used. This update prevents that from happening by ensuring that Q_CLANG_QDOC is not defined when the macro is defined. This update also adds a \fn command for a declaration of qobject_cast() that was missing in the documentation. There are two versions of the function, one with a const parameter and one with a non-const parameter, and they both share one qdoc comment. Change-Id: Ic74d0aaae62767cd0391474ee95ae3f4f820b06e Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* Merge remote-tracking branch 'origin/5.10' into devLiang Qi2018-01-201-0/+1
|\ | | | | | | | | | | | | Conflicts: tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: If089d5010d15c33b3c1f13912d4386207456c1a9
| * Merge remote-tracking branch 'origin/5.9' into 5.10Tor Arne Vestbø2018-01-161-0/+1
| |\ | | | | | | | | | Change-Id: I896b0cf54f317c4336cc3d3db319a0b89e421728
| | * Prevent O(n^2) behavior when calling QObject::deleteLaterErik Verbruggen2018-01-161-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When a deleteLater event is queued, a check if done if the same event for the same receiver is queued before by scanning all pending events. This leads to quadratic behavior, which is quite noticeable. By using an unused bit in QObjectData, this can be prevented. Now the duplicate event scanning in QCoreApplication is only done for the quit event. Task-number: QTBUG-65712 Change-Id: Ie505acbbec802f91ebd0b94ac067e362c2476113 Reviewed-by: Erik Verbruggen <erik.verbruggen@qt.io> Reviewed-by: Simon Hausmann <simon.hausmann@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io>
* | | doc: Correct qdoc warnings in qobject.cpp and qmetatype.cppMartin Smith2018-01-081-13/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | clang required adding template clauses to a few \fn commands. There were also a few cases where Q_QDOC was changed to Q_CLANG_QDOC and a few cases where special declarations for qdoc were removed in favor of the actual declarations. Unfortunately, a few qdoc warnings remain unfixed for classes QObject and QMetaType, but these might be caused by minor bugs in clang-qdoc itself, so they will be fixed there. Change-Id: Ib586628cb6d2aa9cf4bcad303b5af09b412a7e57 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Merge remote-tracking branch 'origin/5.10' into devLars Knoll2018-01-021-1/+1
|\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf sc/corelib/io/qfsfileengine_p.h src/corelib/io/qstorageinfo_unix.cpp src/platformsupport/eglconvenience/qeglpbuffer_p.h src/platformsupport/input/libinput/qlibinputkeyboard.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/plugins/platforms/cocoa/qcocoamenu.mm src/plugins/platforms/ios/qiosscreen.h src/plugins/platforms/ios/qioswindow.h src/plugins/platforms/ios/quiview.mm src/printsupport/dialogs/qpagesetupdialog_unix_p.h src/printsupport/dialogs/qprintpreviewdialog.cpp src/printsupport/widgets/qcupsjobwidget_p.h src/widgets/widgets/qmenu.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp Change-Id: Iecb4883122efe97ef0ed850271e6c51bab568e9c
| * | Merge remote-tracking branch 'origin/5.9' into 5.10Lars Knoll2017-12-301-1/+1
| |\| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: .qmake.conf mkspecs/win32-g++/qmake.conf src/corelib/global/qglobal_p.h src/corelib/global/qoperatingsystemversion_p.h src/corelib/io/qfilesystemengine_win.cpp src/network/bearer/qbearerengine.cpp src/platformsupport/input/libinput/qlibinputpointer.cpp src/sql/doc/snippets/code/doc_src_sql-driver.cpp src/widgets/kernel/qwidget_p.h src/widgets/kernel/qwidgetwindow.cpp src/widgets/styles/qfusionstyle.cpp tests/auto/corelib/io/qfileinfo/tst_qfileinfo.cpp Change-Id: I80e2722f481b12fff5d967c28f89208c0e9a1dd8
| | * Don't crash with null receiver/context in new-style connectsSergio Martins2017-12-191-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | old style connects have protection against null sender and null receiver, but new style only had against null sender. Change-Id: Ie555ac078412918e60c3b60830fe1f3abfb7f5af Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | | doc: Change invokeMethod() comments to work with clangMartin Smith2017-12-081-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There were four dummy declarations for struct QMetaObject that were needed by old qdoc to allow documentation of some very complicated function signatures that old qdoc could not parse. clangqdoc can now parse these signatures, but, unfortunately, old qdoc is still used to parse \fn commands in .cpp and .qdoc files, so the dummy declarations are still needed in struct QMetaObject. However, clangqdoc now sees that two of the four dummy declarations are actually duplicates of the other two, and then old qdoc complains when it can't find all four of the function nodes, when it parses the four \fn commands. This update removes the duplicate dummy declarations and the two redundant \fn comments. The remaining two \fn comments are updated accordingly. This change also moves a couple of qdoc comments so they are located with the function definitions that they are documenting. Change-Id: I85e2492ba0380b01c3700b3dc7db0913d6429701 Reviewed-by: Martin Smith <martin.smith@qt.io>
* | | doc: Add class qualifiers to parameter typesMartin Smith2017-12-061-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | This change supplies several missing class qualifiers for parameter types and function return types. Change-Id: I569026e4da0948902fcc13557003d3748b85dd82 Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
* | | Replace Q_NULLPTR with nullptr where possibleKevin Funk2017-09-191-3/+3
|/ / | | | | | | | | | | | | | | | | | | | | | | | | Remaining uses of Q_NULLPTR are in: src/corelib/global/qcompilerdetection.h (definition and documentation of Q_NULLPTR) tests/manual/qcursor/qcursorhighdpi/main.cpp (a test executable compilable both under Qt4 and Qt5) Change-Id: If6b074d91486e9b784138f4514f5c6d072acda9a Reviewed-by: Ville Voutilainen <ville.voutilainen@qt.io> Reviewed-by: Lars Knoll <lars.knoll@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-05-071-2/+5
|\| | | | | | | | | | | | | | | Conflicts: src/network/access/qnetworkreply.cpp tests/auto/corelib/kernel/qmetaobject/tst_qmetaobject.cpp Change-Id: Iadf766269454087e69fb216fc3857d85b0ddfaad
| * Doc: correct minor link issuesNico Vertriest2017-05-031-2/+4
| | | | | | | | | | | | | | | | | | qobject.cpp:4288: warning: Can't link to 'Q_ENUM_NS' qobject.cpp:4314: warning: Can't link to 'Q_FLAG_NS' Change-Id: I0fa5a1d4f9b4868a1a98ce6d3b5f6bb9b34c5dd2 Reviewed-by: Venugopal Shivashankar <Venugopal.Shivashankar@qt.io> Reviewed-by: Topi Reiniö <topi.reinio@qt.io>
| * Include moc of qnamespace.h in qobject.cppThiago Macieira2017-04-291-0/+1
| | | | | | | | | | | | | | Change-Id: I84e363d735b443cb9beefffd14b8bd4b39b00840 Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io> Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Merge remote-tracking branch 'origin/5.9' into devLiang Qi2017-03-201-1/+4
|\| | | | | | | | | | | | | | | | | Conflicts: src/corelib/io/qfilesystemengine_win.cpp src/gui/text/qdistancefield.cpp src/plugins/platforms/xcb/qxcbconnection.h Change-Id: I1be4a6f440ccb7599991159e3cb9de60990e4b1e
| * Doc: Add links to the signal-slot syntaxes pageSze Howe Koh2017-03-131-1/+4
| | | | | | | | | | Change-Id: I5443a09d18ada6de16a5cec503523b7cc284b0dc Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Deprecate QSignalMapperOlivier Goffart2017-03-141-1/+1
|/ | | | | | | | | | Does not make much sense now that we can connect to lambda functions [ChangeLog][QtCore][QSignalMapper] QSignalMapper is now marked as deprecated. Change-Id: I89135f23fdf16b42142a125eb7c9a86084c90bfc Reviewed-by: Sze Howe Koh <szehowe.koh@gmail.com>
* Doc: Remove references to pre-C++11 recommendationsOlivier Goffart2017-03-011-13/+2
| | | | | | | | | Compiler support for lambda functions and variadic templates is required since Qt 5.7, so no need to mention in the documentation what happens if the compiler doesn't support it. Change-Id: I5caeaa0bd7f0edce81e22e22964e0b7dd042c719 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* Merge remote-tracking branch 'origin/5.8' into 5.9Liang Qi2017-02-161-1/+1
|\ | | | | | | | | | | | | | | | | Conflicts: src/corelib/plugin/qlibrary_unix.cpp src/plugins/platforms/xcb/qxcbconnection.cpp tests/auto/corelib/tools/qdatetime/tst_qdatetime.cpp Change-Id: I632c400d909f8c204f55743aadc7886af2f15dfb
| * Turn QThreadData::threadId into a QAtomicPointerThiago Macieira2017-02-151-1/+1
| | | | | | | | | | | | | | | | | | | | | | Solves a data race found by TSan. Since thread and threadId are QAtomicPointer, I've removed the explicit initialization in the QThreadData constructor Task-number: QTBUG-58855 Change-Id: I4139d5f93dcb4b429ae9fffd14a34082f2683f76 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2017-01-301-1/+7
|\| | | | | | | | | | | | | | | | | | | | | Conflicts: examples/network/network-chat/peermanager.cpp src/widgets/util/qsystemtrayicon.cpp src/widgets/util/qsystemtrayicon_qpa.cpp src/widgets/util/qsystemtrayicon_win.cpp src/widgets/util/qsystemtrayicon_x11.cpp Change-Id: I1c026df83818c0ccaf956980370e7522960627db
| * Doc: add a note that UniqueConnection does not work for lambdasThiago Macieira2017-01-261-1/+7
| | | | | | | | | | | | | | Task-number: QTBUG-52438 Change-Id: I3e4e5051937c40319d6efffd1491bef6feb6776e Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | Fix some qdoc-warnings for 5.9Friedemann Kleint2017-01-251-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | qtbase/src/corelib/global/qoperatingsystemversion.cpp:119: warning: Cannot find 'QOperatingSystemVersion(...)' in '\fn' QOperatingSystemVersion::QOperatingSystemVersion(int maj, int min, int mic) qtbase/src/corelib/io/qdir.cpp:1852: warning: Unknown command '\p' qtbase/src/corelib/kernel/qabstracteventdispatcher.cpp:482: warning: Cannot find 'registerEventNotifier(...)' in '\fn' bool QAbstractEventDispatcher::registerEventNotifier(QWinEventNotifier *notifier); qtbase/src/corelib/kernel/qabstracteventdispatcher.cpp:495: warning: Cannot find 'unregisterEventNotifier(...)' in '\fn' bool QAbstractEventDispatcher::unregisterEventNotifier(QWinEventNotifier *notifier); qtbase/src/corelib/global/qoperatingsystemversion.cpp:268: warning: Can't link to 'macro()' qtbase/src/corelib/global/qoperatingsystemversion.cpp:296: warning: Can't link to 'typeName()' qtbase/src/corelib/io/qdir.cpp:1845: warning: Undocumented parameter 'filters' in QDir::isEmpty() qtbase/src/corelib/kernel/qobject.cpp:1636: warning: No such parameter 'interval' in QObject::startTimer() qtbase/src/network/bearer/qnetworkconfiguration.cpp:343: warning: Undocumented parameter 'timeout' in QNetworkConfiguration::setConnectTimeout() qtbase/src/gui/kernel/qoffscreensurface.cpp:337: warning: Undocumented parameter 'handle' in QOffscreenSurface::setNativeHandle() qtbase/src/platformheaders/xcbfunctions/qxcbwindowfunctions.qdoc:109: warning: Unknown command '\role' qtbase/src/widgets/util/qundostack.cpp:727: warning: Command '\li' outside of '\list' and '\table' ... Change-Id: I57bff895a8e1afd94b582a6a72a06771514ee27e Reviewed-by: Jake Petroules <jake.petroules@qt.io>
* | QObject: add startTimer() overload with std::chronoAnton Kudryavtsev2016-12-231-0/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | In client code I often see code like: startTimer(1000); //ms Let the code to be self-explaining. So provide overload method that takes std::chrono::milliseconds as arg. QTimer already has std::chrono support, but QObject does not. Change-Id: Ib348612ce35f1a997b4816fe9e864775cbcbec16 Reviewed-by: Edward Welbourne <edward.welbourne@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
* | Mark qt_addObject/qt_removeObject for removal in Qt6Erik Verbruggen2016-12-071-1/+8
| | | | | | | | | | | | | | | | | | We now have qtHookData, which is a better (and cheaper) way to add hooks for object creation and deletion. For binary-compatibility reasons we cannot remove it in Qt5. Change-Id: Iecd9f4e1195f90279c395845fa26c6301b67b9a1 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QObject: remove unused function qt_find_obj_childOlivier Goffart2016-11-091-24/+0
| | | | | | | | | | | | | | | | | | qt_find_obj_child is a vestige from Qt3. It is not used nor exported. It can safely be removed. Change-Id: Ief6164c361a369559e067b99880c357e421e6342 Reviewed-by: Martin Smith <martin.smith@qt.io> Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | QObject::dumpObject*: add const overloadsGiuseppe D'Angelo2016-10-031-2/+35
| | | | | | | | | | | | | | | | | | | | | | They don't modify "this", so they should be const. Mark the existing non-const overloads for removal in Qt 6. [ChangeLog][QtCore][QObject] QObject::dumpObjectInfo and QObject::dumpObjectTree now have const overloads. Change-Id: If9fb15692d2d1536930f86d043d688236d4b778a Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* | Merge remote-tracking branch 'origin/5.8' into devLiang Qi2016-09-261-1/+1
|\| | | | | | | | | | | | | Conflicts: src/plugins/platforms/ios/qiosmessagedialog.mm Change-Id: Icfbf55c3215ec088e552d0b42a5c94d04b17c65f
| * Fix event names on comment about QChildEventSérgio Martins2016-09-251-1/+1
| | | | | | | | | | | | Change-Id: If9901471e459acb374807649e0affb84d82f7b8b Reviewed-by: David Faure <david.faure@kdab.com> Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* | QObject::dumpObject*: enable them also for non-debug buildsGiuseppe D'Angelo2016-09-061-15/+0
|/ | | | | | | | | | | | | | | It makes very little sense that one needs to have a debug build of Qt to debug QObject issues in application code. At this date we don't even offer debug builds for Linux systems, and anyhow one might want to debug an application running against a release build of Qt. [ChangeLog][QtCore][QObject] QObject::dumpObjectInfo and QObject::dumpObjectTree are now fully functional even in a non-debug build of Qt. Change-Id: Ifddd3023ffc82f3dc3928a7a94d4970e2fb1b44a Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* Say hello to Q_NAMESPACEBogDan Vatra2016-08-191-2/+59
| | | | | | | | | | | | Q_NAMESPACE is useful to add Q_ENUM_NS/Q_ENUMS, Q_FLAG_NS/Q_FLAGS and Q_CLASSINFO to a namespace. [ChangeLog] Added Q_NAMESPACE which can be used to add Q_ENUM_NS/ Q_ENUMS, Q_FLAG_NS/Q_FLAGS and Q_CLASSINFO to a namespace Task-number: QTBUG-54981 Change-Id: Ic61b972794063e77134681fb347d6c4acddcdb44 Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
* QObject::connect: allow to disable narrowing of the connection argumentsGiuseppe D'Angelo2016-08-021-0/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | One of the good features of the new connection style is that implicit conversion is performed for the connection arguments. However, this is also a bad feature when it comes to the old C remnants in the C++ language: for instance, doubles implicitly convert to ints, possibly losing precision (and GCC/Clang do not even warn about those under -Wall, only MSVC does) or even triggering undefined behavior. For this reason, when using braced initialization, C++11 disables narrowing conversions or floating/integral conversions. Use this feature when checking the arguments of a PMF-style signal/slot connection. Technically this makes the program ill-formed, however GCC still accepts it (but at least warns under -Wall). Hence, add a way to disable these implicit conversions. This is a opt-in and guarded by a macro, as it's a source incompatible change. [ChangeLog][QtCore][QObject] The QT_NO_NARROWING_CONVERSIONS_IN_CONNECT macro has been added. When using the new connection syntax (PMF-based) this macro makes it illegal to narrow the arguments carried by the signal, and/or to perform floating point to integral implicit conversions on them. When the macro is defined, depending on your compiler a QObject::connect() statement triggering such conversions will now fail to compile. Change-Id: Ie17eb3e66ce0cd780138e60d8bb7da815a4ada83 Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
* Merge remote-tracking branch 'origin/5.7' into devEdward Welbourne2016-08-011-2/+2
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure 5.7 now supports clang on android; but dev re-worked configure src/gui/kernel/qevent.h One side renamed a parameter of a constructor; the other added an alternate constructor on the next line. Applied the rename to both for consistency. tests/auto/tools/moc/tst_moc.cpp Each side added a new test at the end. .qmake.conf Ignored 5.7's change to MODULE_VERSION. configure.json No conflict noticed by git; but changes in 5.7 were needed for the re-worked configure to accommodate 5.7's stricter handling of C++11. Change-Id: I9cda53836a32d7bf83828212c7ea00b1de3e09d2
| * Merge remote-tracking branch 'origin/5.6' into 5.7Liang Qi2016-08-011-2/+2
| |\ | | | | | | | | | | | | | | | | | | | | | Conflicts: src/widgets/itemviews/qabstractitemview.cpp src/widgets/itemviews/qabstractitemview_p.h Change-Id: I54589b1365103cb1749186af92aab03a49c94b64
| | * Fix for race condition in signal activationDenis Kormalev2016-07-291-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There was a race condition between QObject::disconnect() and QMetaObject::activate() which can occur if there are multiple BlockingQueued connections to one signal from different threads and they connect/disconnect their connections often. What can happen in this case is: T1 is in activate() method and T2 is in disconnect() method T1 T2 locks sender mutex selects next connection unlocks sender mutex locks sender mutex sets isSlotObject to false creates QMetaCallEvent derefs connection posts event Two things can happen here: 1. Connection can still be valid, but it will have isSlotObject==false and callFunction will be used instead of slotObj 2. Connection can already be invalid To fix it mutex unlock should be moved after QMetaCallEvent creation. Also there is another case, when we don't disconnect but delete the receiver object. In this case it can already be invalid during postEvent, so we need to move mutex unlock after postEvent. Change-Id: I8103798324140ee11de5b4e10906562ba878ff8b Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com> Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
| | * Fix grammar error in QFlags documentationMitch Curtis2016-07-261-1/+1
| | | | | | | | | | | | | | | Change-Id: I1c5d2be402f7e194eaa2e6f646aa5edad1bfd9d9 Reviewed-by: Marc Mutz <marc.mutz@kdab.com>