2 #include <score/model/path/ObjectPath.hpp>
12 class DocumentDelegateModel;
13 class DocumentDelegatePresenter;
14 struct DocumentContext;
25 SCORE_LIB_BASE_EXPORT Document* documentFromObject(
const QObject* obj);
26 SCORE_LIB_BASE_EXPORT Document* documentFromObject(
const QObject& obj);
27 SCORE_LIB_BASE_EXPORT
const DocumentContext& documentContext(
const QObject& obj);
38 SCORE_LIB_BASE_EXPORT
ObjectPath unsafe_path(QObject
const*
const& obj);
39 SCORE_LIB_BASE_EXPORT
ObjectPath unsafe_path(
const QObject& obj);
44 SCORE_LIB_BASE_EXPORT DocumentDelegatePresenter*
45 presenterDelegate_generic(
const Document& d);
48 T* presenterDelegate(
const Document& d)
50 auto pd = presenterDelegate_generic(d);
52 return safe_cast<T*>(pd);
57 requires(std::is_base_of<DocumentDelegatePresenter, T>::value)
58 T* get(
const Document& d)
60 return presenterDelegate<T>(d);
64 T* try_presenterDelegate(
const Document& d)
66 return dynamic_cast<T*
>(presenterDelegate_generic(d));
70 requires(std::is_base_of<DocumentDelegatePresenter, T>::value)
71 T* try_get(
const Document& d)
73 return try_presenterDelegate<T>(d);
78 SCORE_LIB_BASE_EXPORT DocumentDelegateModel& modelDelegate_generic(
const Document& d);
81 T& modelDelegate(
const Document& d)
83 return safe_cast<T&>(modelDelegate_generic(d));
87 requires(std::is_base_of<DocumentDelegateModel, T>::value)
88 T& get(
const Document& d)
90 return modelDelegate<T>(d);
96 T* try_modelDelegate(
const Document& d)
98 return dynamic_cast<T*
>(&modelDelegate_generic(d));
101 template <
typename T>
102 requires(std::is_base_of<DocumentDelegateModel, T>::value)
103 T* try_get(
const Document& d)
105 return try_modelDelegate<T>(d);
The ObjectPath class.
Definition: ObjectPath.hpp:37
Base toolkit upon which the software is built.
Definition: Application.cpp:90