summaryrefslogtreecommitdiffstats
path: root/src/corelib/kernel/qmetaobject.cpp
Commit message (Collapse)AuthorAgeFilesLines
* Use the qt_static_metacall in QueuedConnectionOlivier Goffart2011-04-081-4/+14
| | | | | | And also in QMetaMethod::invoke Reviewed-by: brad
* Fix QMetaObject::indexOfSlotOlivier Goffart2011-04-041-1/+1
| | | | The wrong offset was added
* Speedup activation of signalsOlivier Goffart2011-03-311-13/+22
| | | | | | | | | | | | | | | | | | | | | | | | | The virtual QObject::qt_metacall will recurse to the whole object hierarchy to find from which class a function should be called. But it is possible to know, at connection time, from which exact QMetaObject a function belongs, and the relative offset into it. So we make the slot calls from the qt_static_metacall function. So activation of signals is faster. - We must not call a slot from a class that has been destroyed. To avoid this, there is a check on the methodOffset. If it is smaller, that means we might be called (indirectly) from the destructor. We fallback to the virtual call to qt_metacall that does the right thing. - The signature of the static method is void (*) (QObject*,MetaCall,int,void**) It returns void, so the compiler is allowed to do tail recusive optimization. Having the QObject* as first parameter make it ready on the stack for the call to the member function. - The new static method has to be a member function in order to be able to access the private slots. Reviewed-by: brad
* Merge remote-tracking branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-02-041-0/+48
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/declarative/samegame/SamegameCore/samegame.js mkspecs/features/symbian/default_post.prf src/declarative/qml/qdeclarativeengine.cpp src/gui/text/qtextdocumentlayout.cpp src/plugins/plugins.pro src/s60installs/bwins/QtCoreu.def src/s60installs/bwins/QtGuiu.def src/s60installs/eabi/QtCoreu.def src/s60installs/eabi/QtGuiu.def src/s60installs/s60installs.pro tests/auto/declarative/declarative.pro tests/auto/declarative/qdeclarativedebug/tst_qdeclarativedebug.cpp tests/auto/declarative/qdeclarativepixmapcache/tst_qdeclarativepixmapcache.cpp tests/auto/declarative/qmlvisual/qmlvisual.pro
| * Merge branch '4.7' of scm.dev.nokia.troll.no:qt/qt-qml into qtquick11Martin Jones2011-01-191-1/+1
| |\
| * | Allow a revision to be associated with properties and methods.Martin Jones2011-01-051-0/+48
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Allows a revision to be associated with properties via: Q_PROPERTY(int prop READ prop1 REVISION 1) Allows a revision to be associated with methods via either: public slots Q_REVISION(1): void method1(); or: public slots: Q_REVISION void method1(); Private revision() methods are added to QMetaProperty and QMetaMethod to access the revision info. This is private API for use by QML for now. Task-number: QTBUG-13451 Reviewed-by: Kent Hansen
* | | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2011-01-171-1/+1
|\ \ \ | | |/ | |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/webkit/imageanalyzer/imageanalyzer.h examples/webkit/imageanalyzer/mainwindow.h mkspecs/unsupported/qws/linux-x86-openkode-g++/qplatformdefs.h src/corelib/io/qfsfileengine_iterator_unix.cpp src/corelib/io/qfsfileengine_iterator_win.cpp src/corelib/kernel/qcoreapplication.cpp src/network/access/qnetworkaccessdatabackend.cpp src/plugins/bearer/connman/qconnmanservice_linux.cpp src/plugins/platforms/openvglite/qwindowsurface_vglite.h src/s60installs/bwins/QtCoreu.def src/s60installs/eabi/QtCoreu.def src/s60installs/s60installs.pro tools/assistant/tools/assistant/helpviewer_qwv.h tools/qdoc3/test/qt-html-templates.qdocconf
| * | Update copyright year to 2011.Jason McDonald2011-01-101-1/+1
| |/ | | | | | | Reviewed-by: Trust Me
* | Properly implement qobject_cast for const pointers.Thiago Macieira2010-09-111-1/+19
| | | | | | | | | | | | | | | | | | Instead of using ugly const_cast in public headers and Q_UNUSED (which expands to nothing in release builds), use a properly-const method. Reviewed-By: Bradley T. Hughes (cherry picked from commit 0b0aa7603b27447a5abe55c55d0514bc56b35f9e)
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Olivier Goffart2010-08-131-1/+4
|\ \ | |/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/gui/painting/qpainter.cpp src/gui/text/qtextengine.cpp tests/auto/qimage/tst_qimage.cpp tests/auto/qpainter/tst_qpainter.cpp tools/qdoc3/test/assistant.qdocconf tools/qdoc3/test/designer.qdocconf tools/qdoc3/test/linguist.qdocconf tools/qdoc3/test/qmake.qdocconf tools/qdoc3/test/qt-build-docs.qdocconf tools/qdoc3/test/qt-html-templates.qdocconf tools/qdoc3/test/qt-html-templates_zh_CN.qdocconf tools/qdoc3/test/qt.qdocconf
| * QMetaObject::normalizeSignature avoid reading past the string in case of ↵Olivier Goffart2010-08-101-1/+4
| | | | | | | | | | | | | | | | | | | | | | invalid signature given. If passed "a(b", qNormalizeType would return a pointer to the \0 at the end of the string. We would add \0 to the result (thinking it is ',' or ')' ) And continue to process the memory after the string. Reviewed-by: Kent Hansen Task-number: QT-1591
* | Merge remote branch 'origin/4.7' into qt-master-from-4.7Thiago Macieira2010-06-011-0/+7
|\ \ | |/
| * QMetaMethod::invoke: Document that the function does not check the argumentsOlivier Goffart2010-05-281-0/+7
| | | | | | | | | | | | And added an assert to ease debugging Task-number: QTBUG-10945
* | QMetaObject::invokeMethod using Qt::BlockingQueuedConnection can handle the ↵Olivier Goffart2010-05-071-33/+20
|/ | | | | | | | | | | | | | | | return value. When using Qt::BlockingQueuedConnection, we do not need to copy the arguments, and we can handle the return type. The argv we pass to the event is the param vector alocated on the stack. Since we don't need to destroy the argument, we can pass 0 for the types. The private QMetaCallEvent destructor is modified not to destroy the arguments if types_ is 0 Task-number: QTBUG-10440 Reviewed-by: Brad
* Optimize QMetaObject::indexOf* functionsOlivier Goffart2010-03-231-31/+32
| | | | | | | | | | | | | | | | | | | | | Comparing the first character before calling strcmp gives big speedup, as it avoid the overhead of calling the strcmp function in many cases. In indexOfMethodRelative, fix the normalize case. The computation of the normalized string was put outside of the for loop, but it should have been inside. This was not detected by the test because the wrong string is at the end. In IndexOfMethodRelative, we do not need to check if the method is a signal or a slot, because we only iterate over the right interval. This is only true for code generated by moc since Qt 4.6. Which means that in application compiled with Qt 4.5 and older, indexOfSignal could now return a slot with the same name (and vice-versa), but I this it is safe to ignore that "problem". Reviewed-by: Roberto Raggi Reviewed-by: Kent Hansen
* Merge remote branch 'origin/4.6' into qt-4.7-from-4.6Rohan McGovern2010-03-061-1/+1
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe examples/multimedia/audioinput/audioinput.cpp src/corelib/io/qfsfileengine.cpp src/gui/egl/qegl_wince.cpp src/gui/egl/qeglproperties.cpp src/gui/egl/qeglproperties_p.h src/gui/embedded/directfb.pri src/gui/kernel/qapplication_win.cpp src/gui/painting/qdrawutil.cpp src/opengl/qgl_p.h src/sql/drivers/odbc/qsql_odbc.cpp src/sql/drivers/odbc/qsql_odbc.h tests/auto/auto.pro tests/auto/qgl/tst_qgl.cpp translations/assistant_adp_ru.ts
| * Compile with GCC 3.3Olivier Goffart2010-03-021-1/+1
| | | | | | | | | | Task-number: QTBUG-8554 Reviewed-by: Gabriel
* | QMetaObject::invokeMethod: print a warning if the method is not found.Olivier Goffart2010-03-011-1/+4
| | | | | | | | | | | | | | | | Also adapt QTestLib not to call invokeMethod on unexisting method to avoid warnings Task-number: QTBUG-7331 Reviewed-by: Brad
* | Make indexOfMethod not crash when going through a metaobject with ↵Thiago Macieira2010-01-271-2/+5
| | | | | | | | | | | | methodCount == 0. Reviewed-by: Bradley T. Hughes
* | Merge branch '4.6'Thiago Macieira2010-01-131-1/+1
|\ \ | |/ | | | | | | | | | | | | | | | | | | Conflicts: bin/syncqt doc/src/deployment/deployment.qdoc src/corelib/io/qfsfileengine_win.cpp src/corelib/xml/qxmlstream.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2_p.h tools/assistant/tools/assistant/centralwidget.cpp tools/linguist/lupdate/main.cpp
| * Update copyright year to 2010Jason McDonald2010-01-061-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Merge branch '4.6'Thiago Macieira2009-12-261-0/+1
|\ \ | |/ | | | | | | | | | | Conflicts: examples/webkit/fancybrowser/main.cpp src/opengl/gl2paintengineex/qpaintengineex_opengl2.cpp tools/assistant/tools/assistant/bookmarkmanager.cpp
| * Fix QMetaObject::connect and disconnect with "dynamic signals"Olivier Goffart2009-12-141-0/+1
| | | | | | | | | | | | | | | | QML might pass index that are larger that the method cound. We must not call QMetaObjectPrivate::originalClone in that case as this would read invalid memory Reviewed-by: brad
* | Avoid crash in QObject::connect() if class has no signalsEskil Abrahamsen Blomfeldt2009-12-111-1/+1
| | | | | | | | | | | | | | | | If signalCount was 0, then indexOfSlotRelative would use -1 as the lookup and read unitialized memory in the loop. This would cause a crash in release on Windows. Done-with: Olivier
* | Fix certain type-const-ref syntax not recognized by normalizedSignature()Bradley T. Hughes2009-11-301-14/+44
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Normally, const Type & is normalized to just Type, but this didn't work for Template<T>const& or Type*const& types. This now works as expected. However, this changes the way these types are normalized, and existing code using the old syntax will break. We can prevent this breakage by also normalizing the method signature in the metaobject when looking up signals and slots in QObject::connect(). I have added an autotest for this, which includes moc output generated by Qt 4.6's moc. This means we need to bump the metaobject revision number even though we are not adding any new data (only changing the normalized strings we store). Task-number: QTBUG-2407 Task-number: QTBUG-3722 Reviewed-by: ogoffart
* | Reduce the code duplication within QMetaObject::indexOf{Signal,Slot,Method}Olivier Goffart2009-11-301-34/+32
|/ | | | | | | This also change the bounds of the checked method by using the signalCount as a hint Reviewed-by: Brad
* Implement internal support for property interceptors (used by declarative).Michael Brasser2009-11-041-1/+4
| | | | | Reviewed-by: Kent Hansen Reviewed-by: Aaron Kennedy
* Update confusing qWarning message.Thiago Macieira2009-10-291-2/+2
| | | | Reviewed-by: Olivier Goffart
* Update license headers again.Jason McDonald2009-09-091-4/+4
| | | | Reviewed-by: Trust Me
* QMetaObject::normalizeType: fix out-of-bound access.Olivier Goffart2009-09-011-7/+4
| | | | | | | | As reported in merge request 1375 Also use QVarLenghtArray instead of manually allocated char* Reviewed-by: Thierry
* Merge branch '4.5' into 4.6Thiago Macieira2009-08-311-13/+13
|\ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: demos/boxes/glshaders.cpp demos/boxes/vector.h demos/embedded/fluidlauncher/pictureflow.cpp demos/embedded/fluidlauncher/pictureflow.h doc/src/desktop-integration.qdoc doc/src/distributingqt.qdoc doc/src/examples-overview.qdoc doc/src/examples.qdoc doc/src/frameworks-technologies/dbus-adaptors.qdoc doc/src/geometry.qdoc doc/src/groups.qdoc doc/src/objecttrees.qdoc doc/src/platform-notes.qdoc doc/src/plugins-howto.qdoc doc/src/qt3support.qdoc doc/src/qtdbus.qdoc doc/src/qtdesigner.qdoc doc/src/qtgui.qdoc doc/src/qtmain.qdoc doc/src/qtopengl.qdoc doc/src/qtsvg.qdoc doc/src/qtuiloader.qdoc doc/src/qundo.qdoc doc/src/richtext.qdoc doc/src/topics.qdoc src/corelib/tools/qdumper.cpp src/gui/embedded/qkbdpc101_qws.cpp src/gui/embedded/qkbdsl5000_qws.cpp src/gui/embedded/qkbdusb_qws.cpp src/gui/embedded/qkbdvr41xx_qws.cpp src/gui/embedded/qkbdyopy_qws.cpp src/gui/embedded/qmousebus_qws.cpp src/gui/embedded/qmousevr41xx_qws.cpp src/gui/embedded/qmouseyopy_qws.cpp src/gui/painting/qpaintengine_d3d.cpp src/gui/painting/qwindowsurface_d3d.cpp src/opengl/gl2paintengineex/glgc_shader_source.h src/opengl/gl2paintengineex/qglpexshadermanager.cpp src/opengl/gl2paintengineex/qglpexshadermanager_p.h src/opengl/gl2paintengineex/qglshader.cpp src/opengl/gl2paintengineex/qglshader_p.h src/opengl/util/fragmentprograms_p.h src/plugins/kbddrivers/linuxis/linuxiskbdhandler.cpp src/plugins/mousedrivers/linuxis/linuxismousehandler.cpp src/script/parser/qscript.g src/script/qscriptarray_p.h src/script/qscriptasm_p.h src/script/qscriptbuffer_p.h src/script/qscriptclass.cpp src/script/qscriptclassdata_p.h src/script/qscriptcompiler.cpp src/script/qscriptcompiler_p.h src/script/qscriptcontext.cpp src/script/qscriptcontext_p.cpp src/script/qscriptcontext_p.h src/script/qscriptcontextfwd_p.h src/script/qscriptecmaarray.cpp src/script/qscriptecmaarray_p.h src/script/qscriptecmaboolean.cpp src/script/qscriptecmacore.cpp src/script/qscriptecmadate.cpp src/script/qscriptecmadate_p.h src/script/qscriptecmaerror.cpp src/script/qscriptecmaerror_p.h src/script/qscriptecmafunction.cpp src/script/qscriptecmafunction_p.h src/script/qscriptecmaglobal.cpp src/script/qscriptecmaglobal_p.h src/script/qscriptecmamath.cpp src/script/qscriptecmamath_p.h src/script/qscriptecmanumber.cpp src/script/qscriptecmanumber_p.h src/script/qscriptecmaobject.cpp src/script/qscriptecmaobject_p.h src/script/qscriptecmaregexp.cpp src/script/qscriptecmaregexp_p.h src/script/qscriptecmastring.cpp src/script/qscriptecmastring_p.h src/script/qscriptengine.cpp src/script/qscriptengine_p.cpp src/script/qscriptengine_p.h src/script/qscriptenginefwd_p.h src/script/qscriptextenumeration.cpp src/script/qscriptextenumeration_p.h src/script/qscriptextqobject.cpp src/script/qscriptextqobject_p.h src/script/qscriptextvariant.cpp src/script/qscriptfunction.cpp src/script/qscriptfunction_p.h src/script/qscriptgc_p.h src/script/qscriptmember_p.h src/script/qscriptobject_p.h src/script/qscriptprettypretty.cpp src/script/qscriptprettypretty_p.h src/script/qscriptvalue.cpp src/script/qscriptvalueimpl.cpp src/script/qscriptvalueimpl_p.h src/script/qscriptvalueimplfwd_p.h src/script/qscriptvalueiteratorimpl.cpp src/script/qscriptxmlgenerator.cpp src/script/qscriptxmlgenerator_p.h tests/auto/linguist/lupdate/testdata/recursivescan/project.ui tests/auto/linguist/lupdate/testdata/recursivescan/sub/finddialog.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp tools/linguist/shared/cpp.cpp
| * Update tech preview license header.Jason McDonald2009-08-311-13/+13
| | | | | | | | Reviewed-by: Trust Me
| * Update license headers.Jason McDonald2009-08-111-1/+1
| | | | | | | | Reviewed-by: Trust Me
* | Enable Q_OBJECT usage across DLL boundary on Symbian OSShane Kearns2009-08-281-1/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Symbian loader does not allow DLL import relocations in the data section. To workaround this, added an accessor function which can be used to get the class static metadata from the base class even if it is in another DLL. Changing the implementation for all platforms would cause a binary break, so it is only used for Symbian. The Q_NO_DATA_RELOCATION macro is used to configure this feature instead of Q_OS_SYMBIAN, because it is possible another platform may need the same fix and Symbian may eventually fix their DLL loader to support this feature. Task-number: 258893 Reviewed-by: Kent Hansen
* | Merge commit 'qt/master'Jason Barron2009-08-201-63/+39
|\ \ | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/painting/svgviewer/files/bubbles.svg src/corelib/kernel/qobject.cpp src/network/kernel/qhostinfo.cpp tests/auto/qhostinfo/tst_qhostinfo.cpp
| * | Improve memory usage of the connectionlists inside QObjectOlivier Goffart2009-08-191-63/+39
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ... by not allocating space for slots in the vector. Before, the vector uses the signal index as index. The problem is that the slots and signal are mixed in the same index space. We solve the problem by having a different index space for the signal in the connectionlists vector. All we need to do is to add the information about the number of signals in the moc. Also, we are not connecting to cloned signal but only to the orginial ones. For example, destroyed(QObject * = 0) would generate two signal, we now only connect to the first one. This also improve a little bit the performence while activating signals since it removed one call to indexOfMethod. Reviewed-by: Brad
* | | Merge commit 'qt/master'Jason Barron2009-08-131-1/+3
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: examples/opengl/samplebuffers/glwidget.cpp src/corelib/io/qfsfileengine_unix.cpp src/corelib/kernel/qobject.cpp src/corelib/tools/qsharedpointer.cpp src/gui/gui.pro tests/auto/qhttp/tst_qhttp.cpp tests/auto/qkeyevent/tst_qkeyevent.cpp
| * | Update contact URL in license headers.Jason McDonald2009-08-121-1/+1
| | | | | | | | | | | | Reviewed-by: Trust Me
| * | Doc: add \since 4.6 for new functionsVolker Hilsheimer2009-08-101-0/+2
| | |
* | | Merge commit 'qt/master-stable'Jason Barron2009-08-061-0/+4
|\ \ \ | |/ / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: configure.exe doc/src/classes/qnamespace.qdoc examples/examples.pro src/corelib/kernel/qcoreevent.cpp src/corelib/kernel/qobject.cpp src/gui/kernel/qapplication.cpp src/gui/kernel/qstandardgestures.h src/gui/kernel/qwidget.cpp
| * | Doc fixesAaron Kennedy2009-08-041-0/+4
| | | | | | | | | | | | Reviewed-by: TrustMe
* | | Merge commit 'origin/master'Jason Barron2009-08-041-0/+2
|\ \ \ | |/ / |/| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Conflicts: src/corelib/global/qglobal.h src/corelib/kernel/qmetatype.cpp src/corelib/kernel/qobject.cpp src/corelib/thread/qthread_unix.cpp src/gui/graphicsview/qgraphicssceneevent.h src/gui/itemviews/qheaderview.h src/gui/kernel/qapplication_qws.cpp src/gui/kernel/qgesture.h src/gui/kernel/qgesturerecognizer.h src/gui/painting/qpaintengine_raster.cpp src/network/access/qhttpnetworkreply.cpp src/network/access/qnetworkcookie.h src/network/socket/qnativesocketengine_unix.cpp
| * | Squashed commit of the topic/exceptions branch.Harald Fernengel2009-08-031-0/+2
| | | | | | | | | | | | | | | Contains some smaller fixes and renaming of macros. Looks big, but isn't scary at all ;)
* | | Remove isDynamic property flagAaron Kennedy2009-07-311-13/+1
| | | | | | | | | | | | Reviewed-by: Roberto Raggi
* | | Reorder flag values in ascending orderAaron Kennedy2009-07-311-4/+4
| | | | | | | | | | | | Reviewed-by: Roberto Raggi
* | | Dynamic meta object supportAaron Kennedy2009-07-311-16/+39
| | | | | | | | | | | | | | | | | | | | | This is an internal API used by declarative. Authored-by: mae Reviewed-by: Aaron Kennedy
* | | Add index methods to QMetaProperty and QMetaMethodAaron Kennedy2009-07-311-0/+20
| | | | | | | | | | | | | | | Authored-by: Kent Hansen Reviewed-by: Aaron Kennedy
* | | Add FINAL attribute to Q_PROPERTY()Aaron Kennedy2009-07-311-1/+16
| | | | | | | | | | | | | | | | | | This will be used by the declarative module to optimize property bindings. Reviewed-by: Roberto Raggi
* | | Add CONSTANT attribute to Q_PROPERTY()Aaron Kennedy2009-07-311-1/+28
| | | | | | | | | | | | | | | | | | This will be used by the declarative module to determine if a property lacking a NOTIFY signal is truly constant, or just missing a NOTIFY signal. Reviewed-by: Roberto Raggi
* | | Doc: add \since 4.6 for new APIsVolker Hilsheimer2009-07-191-0/+2
| | |