> On 16 Jul 2020, at 19:54, Thiago Macieira <thiago.macie...@intel.com> wrote: > > On Thursday, 16 July 2020 10:36:27 PDT Volker Hilsheimer wrote: >>> Since std::is_same_v<decltype(action->text), decltype(action->title)> and >>> &action->text == &action->title, how does the code above even work? >> >> action->text.structMemberFunction(); >> >> calls QAction::_qt_property_api_text::structMemberFunction, which is >> implemented by moc to operate on d->text >> >> whereas >> >> action->title.structMemberFunction(); >> >> calls QAction::_qt_property_api_title::structMemberFunction, which is >> implemented by moc to operate on d->title. >> >> >> The structMemberFunctions are different for each property, but that doesn't >> increase the size of QAction instances. >> >> The relevant macros are defined in qtmetamacros.h. > > In other words, action->text and action->title aren't the same type.
Correct, I see that my earlier statement that “each property is represented by an instance of a struct” was misleading. Cheers, Volker _______________________________________________ Development mailing list Development@qt-project.org https://lists.qt-project.org/listinfo/development