5 changed files with 94 additions and 4 deletions
			
			
		@ -0,0 +1,19 @@ | 
				
			|||||
 | 
					#include "qqmlcoreapp.h" | 
				
			||||
 | 
					using namespace QtMvvm; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					QQmlCoreApp::QQmlCoreApp(QObject *parent) : | 
				
			||||
 | 
						QObject(parent) | 
				
			||||
 | 
					{ | 
				
			||||
 | 
						connect(coreApp, &CoreApp::appStarted, | 
				
			||||
 | 
								this, &QQmlCoreApp::appStarted); | 
				
			||||
 | 
					} | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					MessageResult *QQmlCoreApp::showDialog(const MessageConfig &config) | 
				
			||||
 | 
					{ | 
				
			||||
 | 
						return CoreApp::showDialog(config); | 
				
			||||
 | 
					} | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					void QQmlCoreApp::show(const QString &viewModelName, const QVariantHash ¶ms, ViewModel *parentViewModel) | 
				
			||||
 | 
					{ | 
				
			||||
 | 
						CoreApp::show(qUtf8Printable(viewModelName), params, parentViewModel); | 
				
			||||
 | 
					} | 
				
			||||
@ -0,0 +1,28 @@ | 
				
			|||||
 | 
					#ifndef QTMVVM_QQMLCOREAPP_H | 
				
			||||
 | 
					#define QTMVVM_QQMLCOREAPP_H | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					#include <QtCore/QObject> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					#include <QtMvvmCore/CoreApp> | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					namespace QtMvvm { | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					class QQmlCoreApp : public QObject | 
				
			||||
 | 
					{ | 
				
			||||
 | 
						Q_OBJECT | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					public: | 
				
			||||
 | 
						explicit QQmlCoreApp(QObject *parent = nullptr); | 
				
			||||
 | 
					
 | 
				
			||||
 | 
						Q_INVOKABLE QtMvvm::MessageResult *showDialog(const QtMvvm::MessageConfig &config); | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					public Q_SLOTS: | 
				
			||||
 | 
						void show(const QString &viewModelName, const QVariantHash ¶ms = {}, QtMvvm::ViewModel *parentViewModel = nullptr); | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					Q_SIGNALS: | 
				
			||||
 | 
						void appStarted(); | 
				
			||||
 | 
					}; | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					} | 
				
			||||
 | 
					
 | 
				
			||||
 | 
					#endif // QTMVVM_QQMLCOREAPP_H
 | 
				
			||||
					Loading…
					
					
				
		Reference in new issue