QtMvvm  1.1.0
A mvvm oriented library for Qt, to create Projects for Widgets and Quick in parallel
Classes | Namespaces | Macros
coreapp.h File Reference

The Header that defines the QtMvvm::CoreApp class. More...

#include <type_traits>
#include <QtCore/qobject.h>
#include <QtCore/qscopedpointer.h>
#include <QtCore/qcoreapplication.h>
#include "QtMvvmCore/qtmvvmcore_global.h"
#include "QtMvvmCore/viewmodel.h"
#include "QtMvvmCore/ipresenter.h"
#include "QtMvvmCore/message.h"

Go to the source code of this file.

Classes

class  QtMvvm::CoreApp
 A logicaly application object to drive the mvvm application from the core part. More...
 

Namespaces

 QtMvvm
 The primary namespace of the QtMvvm library.
 

Macros

#define QTMVVM_REGISTER_CORE_APP(T)
 Registers you custom CoreApp class as CoreApp to be used. More...
 
#define coreApp   QtMvvm::CoreApp::instance()
 A define as shortcut to the CoreApp. Can be redefined to cast to your custom class type.
 

Detailed Description

The Header that defines the QtMvvm::CoreApp class.

Definition in file coreapp.h.

Macro Definition Documentation

◆ QTMVVM_REGISTER_CORE_APP

#define QTMVVM_REGISTER_CORE_APP (   T)
Value:
namespace {\
void __setup_ ## T ## _hook() { \
static_assert(std::is_base_of<QtMvvm::CoreApp, T>::value, "QTMVVM_REGISTER_CORE_APP must be used with a class that extends QtMvvm::CoreApp"); \
auto app = new T(nullptr); \
app->registerApp(); \
} \
} \
Q_COREAPP_STARTUP_FUNCTION(__setup_ ## T ## _hook)

Registers you custom CoreApp class as CoreApp to be used.

Definition at line 106 of file coreapp.h.