qt5base-lts/tests/auto/corelib
Nils Jeisecke fee8944cbe Allow use of template class instances inheriting from a Q_GADGET in Qml
The Q_GADGET macro cannot be used in templates. It can however be useful
to derive a template class from a Q_GADGET enabled base class to benefit
from type safety features in C++ (e.g. the class could represent an id
or handle for some C++ type).

For proper wrapping of a QVariant with a gadget value in a QJSValue, the
QMetaType::IsGadget flag must be set for the registered template
instance type - which does not happen prior to the fix because
IsGadgetHelper requires qt_check_for_QGADGET_macro to be defined in the
registered class but not in an ancestor class - in other words: The
class must declare Q_GADGET.

To overcome this, IsGadgetHelper/IsPointerToGadgetHelper can now
differentiate between a Q_GADGET flagged class (allowing
automatic registration) and a derived class, e.g. a template class
(forcing Q_DECLARE_METATYPE to be used explicitly).

[ChangeLog][QtCore][QMetaObject] It is now possible to use template
class instances inheriting from a Q_GADGET in Qml

Task-number: QTBUG-66744
Change-Id: I7632ad45cff79fa422b3f852ca0b963f35fab155
Reviewed-by: Olivier Goffart (Woboq GmbH) <ogoffart@woboq.com>
2018-03-10 06:12:24 +00:00
..
animation qtbase: cleanup BLACKLIST files 2018-02-13 15:20:33 +00:00
codecs Replace Q_DECL_OVERRIDE with override where possible 2017-09-19 11:53:42 +00:00
global Fix thread_local test 2018-02-23 13:23:01 +00:00
io qsettings: add Advapi32 lib to Windows ICC builds 2018-02-15 22:02:24 +00:00
itemmodels QListWidgetItem/QStandardItem: pass role to dataChanged() signal 2018-01-26 19:58:26 +00:00
kernel Allow use of template class instances inheriting from a Q_GADGET in Qml 2018-03-10 06:12:24 +00:00
mimetypes QMimeDatabase: fix regression in alias resolving 2018-02-28 22:17:58 +00:00
plugin tst_QLibrary: Ensure installation order of testdata libs 2018-03-02 07:20:04 +00:00
serialization JSON: remove braces from UUID text representations 2018-03-02 04:06:33 +00:00
statemachine Fix crash in tst_QStateMachine::dontProcessSlotsWhenMachineIsNotRunning 2018-02-14 08:12:20 +00:00
thread Tests: Raise minimum supported MSVC version to 2015 2018-01-04 20:23:25 +00:00
tools QLocale: Update the system private on QLocale default constructor if needed 2018-03-02 09:52:14 +00:00
corelib.pro Create corelib/serialization and move existing file formats into it 2018-01-26 20:59:50 +00:00