QMetaType and QVariant

From Qt Wiki
Jump to navigation Jump to search


Session Summary

Look at qmetatype.h and see whether we understand what's there.

Session Owners

Thiago, Fabian

Notes

  • Fabian: could use dispatcher a la QSlotObject to reduce number of function pointers in QMetaTypeInterface
    • Ulf: contributes a lot to binary size
    • but code checks the pointers to avoid calling a function
      • e.g.trivially copyable? → memcpy
    • but a lot of the later additions could use a dispatcher
      • Thiago: each pointer is also a relocation
        • Marc: could set a nullptr to indicate calling a global function for all the built-in types to reduce relocs even more
  • Replace the lessThan with the spaceship function in the interface
  • Use spaceship in the impl of the interface for built-in types
  • Looking at flags:
    • ideas to reducenumber of flags:
      • for QWeakPointer<QObject>
        • backend for QPointer
      • plans exist to phase it out
  • std::function use
    • currently leaks it because the destructor code may already have been unloaded on destruction of registry
      • use function_ref?
  • MutableViewFunction
    • use in QML, Fabian and Ulf know
  • compare(void*, void*) function returns QPartialOrdering:
    • Marc: can stay as-is until we start to deprecate QPartialOrdering (just another one of the ordering types, behaves the same)
  • QPairVariantInterfaceImpl
    • used in associative containers?
      • investigate where it's used, remove if not used
  • type helpers
    • is_Real_Gadget? Seriously?
  • enum helper
    • used in QDebug, QTest, etc
  • when do we need Q_DECLARE_METATYPE?1
    • Fabian: QueuedConnection needs it

Session stopped 40% into the header file.

If you have questions or knowledge of QMetaType, talk to Thiago and Fabian.