Browse Source
added shortcut methods to get the view factories
pull/2/head
Skycoder42
7 years ago
No known key found for this signature in database
GPG Key ID: 8E01AD9EF0578D2B
4 changed files with
14 additions and
0 deletions
-
src/mvvmquick/quickpresenter.cpp
-
src/mvvmquick/quickpresenter.h
-
src/mvvmwidgets/widgetspresenter.cpp
-
src/mvvmwidgets/widgetspresenter.h
|
|
@ -54,6 +54,11 @@ void QuickPresenter::registerViewExplicitly(const QMetaObject *viewModelType, co |
|
|
|
QuickPresenterPrivate::currentPresenter()->d->explicitMappings.insert(viewModelType, viewUrl); |
|
|
|
} |
|
|
|
|
|
|
|
InputViewFactory *QuickPresenter::getInputViewFactory() |
|
|
|
{ |
|
|
|
return QuickPresenterPrivate::currentPresenter()->inputViewFactory(); |
|
|
|
} |
|
|
|
|
|
|
|
void QuickPresenter::present(QtMvvm::ViewModel *viewModel, const QVariantHash ¶ms, QPointer<QtMvvm::ViewModel> parent) |
|
|
|
{ |
|
|
|
if(d->qmlPresenter) { |
|
|
|
|
|
@ -42,6 +42,8 @@ public: |
|
|
|
//! @copybrief registerViewExplicitly()
|
|
|
|
static void registerViewExplicitly(const QMetaObject *viewModelType, const QUrl &viewUrl); |
|
|
|
|
|
|
|
static InputViewFactory* getInputViewFactory(); |
|
|
|
|
|
|
|
void present(ViewModel *viewModel, const QVariantHash ¶ms, QPointer<ViewModel> parent) override; |
|
|
|
void showDialog(const MessageConfig &config, MessageResult *result) override; |
|
|
|
|
|
|
|
|
|
@ -68,6 +68,11 @@ void WidgetsPresenter::registerViewExplicitly(const QMetaObject *viewModelType, |
|
|
|
WidgetsPresenterPrivate::currentPresenter()->d->explicitMappings.insert(viewModelType, viewType); |
|
|
|
} |
|
|
|
|
|
|
|
InputWidgetFactory *WidgetsPresenter::getInputWidgetFactory() |
|
|
|
{ |
|
|
|
return WidgetsPresenterPrivate::currentPresenter()->inputWidgetFactory(); |
|
|
|
} |
|
|
|
|
|
|
|
void WidgetsPresenter::present(ViewModel *viewModel, const QVariantHash ¶ms, QPointer<ViewModel> parent) |
|
|
|
{ |
|
|
|
// find and create view
|
|
|
|
|
|
@ -46,6 +46,8 @@ public: |
|
|
|
//! @copybrief registerViewExplicitly()
|
|
|
|
static void registerViewExplicitly(const QMetaObject *viewModelType, const QMetaObject *viewType); |
|
|
|
|
|
|
|
static InputWidgetFactory* getInputWidgetFactory(); |
|
|
|
|
|
|
|
void present(ViewModel *viewModel, const QVariantHash ¶ms, QPointer<ViewModel> parent) override; |
|
|
|
void showDialog(const MessageConfig &config, MessageResult *result) override; |
|
|
|
|
|
|
|