... by not actually creating the unused instances of the Id types.
Change-Id: I6955046fa1b457ea70d36090d3bf0051b31dfdaa
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
Backport the learnings and simplification from the real use to
the demo case.
Change-Id: I3f501b03c760484961bfd586735c0db53ba080db
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
This adds support for inheritance to the existing experimental
implementation in tests/manual/layoutbuilder/experimental
and gets rid of the tight coupling and qobject_casts in the
setter implementations. Plan is to use this (minus "bindings"
via *::Id / id()) for utils/layoutbuilder.{h,cpp} later.
The "binding" support via id() is still experimental, and in
its current version not really useful. A possible idea would
be to re-use the Tasking::Storage idea, but it's not quite
clear how to expose that "long distance" (i.e. across multiple,
unrelated top-level builders). However, this is not used in
in current uses of the "old" layoutbuilder, so this is not
blocking anything.
Some notes:
The *Interface hierarchy is not strictly needed, it could directly
act on things in the QObject hierarchy but would then need #includes
of all "buildable" classes, which can be avoided in the current
implementation. Besides, the indirection allows us to tweak and/or
add functionailty to the Qt classes in the indirecting code, that
does not necessarily have to match 1:1 to the underlyings Qt classes.
The std::function based callbacks are quite fat and not functionally
needed and could be dropped by "inlining" the relevant bits from
typical std::function implementations. However, these invariably seem
to end up calling functions through pointers to (ABI-compatible, but)
different types, which is for /user/ code formally undefined behavior
according to C++11 §5.2.10/6. To avoid a discussion whether doing
the same ourselves is tolerable or not, this uses std::function
and pays the price of the overhead.
Change-Id: I6d40c1bd48cf065fcf211eaff8d9a2298bca20eb
Reviewed-by: <github-actions-qt-creator@cristianadam.eu>
Reviewed-by: Marcus Tillmanns <marcus.tillmanns@qt.io>
The Id was only used in the demo. "ID" is Not exactly canonical naming,
but this clashes often with Utils::Id, so mis-spell until we settle on a
proper name.
Change-Id: I6fdf806c41abf224f7422ec6c9263db3eb357190
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Intenally just wrapping a 'bindTo' result, but less trigger potential
for pointer related peladophobia
Change-Id: I25171a2675fb0474ce97c04552ac1cf5ffd6ee56
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Reviewed-by: hjk <hjk@qt.io>
Currently almost the same as the comparison example, but planeed to
grow.
Change-Id: Id129266a1b5b12438e2fb643ee114e6d816581f6
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>
Everying is a LayoutItem now, and everything is split into
a proper setup and execution phase.
Execution happens only via LayoutBuilder (directly or via
convenience wrappers in LayoutItem).
No direct access to the widget in creation, funnel out is
via the new bindTo() facility.
Change-Id: I7eb38fd736ae57a68f9a72a6add5c767da82b49f
Reviewed-by: Qt CI Bot <qt_ci_bot@qt-project.org>
Reviewed-by: Alessandro Portale <alessandro.portale@qt.io>