|
Aria 2.0.0
C++23 MVVM framework (C++20 minimum) — reactive, coroutine-first, ABI-layered
|
Wraps any QWidget* (or QObject*) as an IView. More...
#include <qt_view.hpp>
Public Member Functions | |
| QtView (QObject *w) noexcept | |
| ~QtView () override | |
| std::string_view | kind () const noexcept override |
| QObject * | object () const noexcept |
| template<typename T> | |
| T * | as () const noexcept |
| Public Member Functions inherited from aria::binding::IView | |
| IView () | |
| IView (const IView &)=delete | |
| IView & | operator= (const IView &)=delete |
| IView (IView &&)=delete | |
| IView & | operator= (IView &&)=delete |
| virtual | ~IView () |
| Subscription | on_destroy (std::function< void()> cb) const |
| Subscribe to "this view is about to be destroyed". | |
Additional Inherited Members | |
| Protected Member Functions inherited from aria::binding::IView | |
| void | fire_destroy_ () noexcept |
| Invoked by ~IView() to fan out the notification — this is the last-resort trigger. | |
Wraps any QWidget* (or QObject*) as an IView.
The wrapped QObject is owned by Qt's parent-child tree, not by us. We connect to QObject::destroyed and fire the IView destroy signal from there — i.e. while this subclass's state is still valid, which is what the adapter contract asks for. Relying on the ~IView fallback alone would be too late (and never happen at all for a QtView that is kept alive by a cache).
QPointer additionally keeps object() safe if the widget is destroyed before anyone notices.
|
inlineexplicitnoexcept |
|
inlineoverride |
|
inlinenodiscardoverridevirtualnoexcept |
Implements aria::binding::IView.
|
inlinenodiscardnoexcept |
|
inlinenodiscardnoexcept |