qt5base-lts/src
Kent Hansen f95181c7bb Long live Qt5 meta-object method/property descriptors
This commit introduces two significant changes to the meta-object
data format:

1) Meta-type information (QMetaType type/name) information is
stored directly in the meta-data for both properties and methods;
2) The original signature (string) of a method is no longer stored
in the meta-data, since it can be reconstructed from the method
name and parameter type info.

The motivation for this change is to enable direct access to method
names and type information (avoiding string-based lookup for types
if possible), since that's typically the information language
bindings (e.g. QML) need. (moc already had all the desired
information about methods, but it threw it away!)

This change keeps support for the older (6 and below) meta-object
revisions, but the support will be removed after a short grace
period.

The following public QMetaMethod functions have been added:

name() : QByteArray
returnType() : int
parameterCount() : int
parameterType(int index) : int

The following internal QMetaMethod function has been added:

getParameterTypes(int *types) : void

This commit extends the meta-method data to include explicit
type/name data for methods. The new data follows the existing
(5-word) method descriptors in the meta-data. The method descriptor
format was modified to enable this. First, the descriptor now
contains the meta-data index where the method's type/name information
can be found. Second, the descriptor contains the number of
parameters. Third, the descriptor has a reference to the name of the
method, not the full signature.

Each entry of a method's type/name array contains either the type id
(if it could be determined at meta-object definition time), or a
reference to the name of the type (so that the type id can be
resolved at runtime).

Lastly, instead of storing the method parameter names as a
comma-separated list that needs to be parsed at runtime (which was
how it was done prior to this commit), the names are now stored as
separate entries in the meta-object string table, and their indexes
are stored immediately after the method type info array. Hence,
parameter names can be queried through the public API without
parsing/allocating/copying, too.

Task-number: QTBUG-24154
Change-Id: Idb7ab81f12d4bfd658b74e18a0fce594f580cba3
Reviewed-by: Thiago Macieira <thiago.macieira@intel.com>
Reviewed-by: Lars Knoll <lars.knoll@nokia.com>
2012-02-29 12:50:14 +01:00
..
3rdparty Compile SHA-2 code on systems without stdint.h 2012-02-28 18:53:32 +01:00
concurrent QFutureWatcher: Make constructors explicit 2012-02-25 11:43:18 +01:00
corelib Long live Qt5 meta-object method/property descriptors 2012-02-29 12:50:14 +01:00
dbus Rename QMetaMethod::signature() to methodSignature() 2012-02-29 12:50:14 +01:00
gui Rename QMetaMethod::signature() to methodSignature() 2012-02-29 12:50:14 +01:00
modules Move QtConcurrent into its own module 2012-02-05 17:49:16 +01:00
network QSslError: fix wrong #endif placement 2012-02-25 15:28:11 +01:00
opengl Prevent stack corruption when using OpenGL Core Profile 2012-02-28 00:29:04 +01:00
platformsupport Add UDev helper class for evdev plugins 2012-02-24 11:29:43 +01:00
plugins Rename remaining references to QInputPanel 2012-02-28 14:38:36 +01:00
printsupport QPrinterInfo: remove unused variable 2012-02-26 11:58:16 +01:00
sql QSqlTableModel: unify code for cache-clearing before select 2012-02-28 09:12:03 +01:00
testlib Rename QMetaMethod::signature() to methodSignature() 2012-02-29 12:50:14 +01:00
tools Long live Qt5 meta-object method/property descriptors 2012-02-29 12:50:14 +01:00
widgets Make the CMake files work with directory overrides. 2012-02-28 21:07:16 +01:00
winmain Remove "All rights reserved" line from license headers. 2012-01-30 03:54:59 +01:00
xml QDomNode: don't needlessly call virtual functions 2012-02-28 11:54:52 +01:00
qbase.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
qt_install.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
qt_targets.pri Moved common module profiles to be feature profiles. 2011-06-05 14:47:14 +02:00
src.pro remove over-uses of $$list() 2012-02-27 20:52:45 +01:00