diff --git a/src/appvals/AppGlobalValues.h b/src/appvals/AppGlobalValues.h new file mode 100644 index 0000000..b1b088a --- /dev/null +++ b/src/appvals/AppGlobalValues.h @@ -0,0 +1,32 @@ +// +// Created by Krad on 2021/11/19. +// + +#ifndef GUI_APPGLOBALVALUES_H +#define GUI_APPGLOBALVALUES_H + +#define APP_VALUES()\ +ADD_APP_VALUE(InProcessing)\ +ADD_APP_VALUE(LastOperationTime)\ +ADD_APP_VALUE(LastOperation) + +#include +#include +#include +class AppGlobalValues { +public: + #define ADD_APP_VALUE(name)\ + static QVariant name(){\ + return qApp->property(#name);\ + }\ + static void set##name(QVariant val){\ + qApp->setProperty(#name, val);\ + } + + APP_VALUES() + + #undef ADD_APP_VALUE +}; + + +#endif //GUI_APPGLOBALVALUES_H