Compare commits
4 Commits
451dbdd4c2
...
b531f1a693
Author | SHA1 | Date |
---|---|---|
|
b531f1a693 | |
|
882cc8989f | |
|
444cc1aeee | |
|
cb4ec62c1e |
|
@ -0,0 +1,20 @@
|
||||||
|
{
|
||||||
|
"MicroPython.executeButton": [
|
||||||
|
{
|
||||||
|
"text": "▶",
|
||||||
|
"tooltip": "运行",
|
||||||
|
"alignment": "left",
|
||||||
|
"command": "extension.executeFile",
|
||||||
|
"priority": 3.5
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"MicroPython.syncButton": [
|
||||||
|
{
|
||||||
|
"text": "$(sync)",
|
||||||
|
"tooltip": "同步",
|
||||||
|
"alignment": "left",
|
||||||
|
"command": "extension.execute",
|
||||||
|
"priority": 4
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
|
@ -49,26 +49,26 @@ FluScrollablePage{
|
||||||
Layout.topMargin: -6
|
Layout.topMargin: -6
|
||||||
code:'FluPivot{
|
code:'FluPivot{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
FluPivotItem:{
|
FluPivotItem {
|
||||||
text: qsTr("All")
|
title: qsTr("All")
|
||||||
contentItem: FluText{
|
contentItem: FluText{
|
||||||
text: qsTr("All emails go here.")
|
text: qsTr("All emails go here.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluPivotItem:{
|
FluPivotItem {
|
||||||
text: qsTr("Unread")
|
title: qsTr("Unread")
|
||||||
contentItem: FluText{
|
contentItem: FluText{
|
||||||
text: qsTr("Unread emails go here.")
|
text: qsTr("Unread emails go here.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluPivotItem:{
|
FluPivotItem {
|
||||||
text: qsTr("Flagged")
|
title: qsTr("Flagged")
|
||||||
contentItem: FluText{
|
contentItem: FluText{
|
||||||
text: qsTr("Flagged emails go here.")
|
text: qsTr("Flagged emails go here.")
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
FluPivotItem:{
|
FluPivotItem {
|
||||||
text: qsTr("Urgent")
|
title: qsTr("Urgent")
|
||||||
contentItem: FluText{
|
contentItem: FluText{
|
||||||
text: qsTr("Urgent emails go here.")
|
text: qsTr("Urgent emails go here.")
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,6 @@ class AppInfo : public QObject {
|
||||||
explicit AppInfo(QObject *parent = nullptr);
|
explicit AppInfo(QObject *parent = nullptr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SINGLETON(AppInfo)
|
EXAMPLESINGLETON(AppInfo)
|
||||||
[[maybe_unused]] Q_INVOKABLE void testCrash();
|
[[maybe_unused]] Q_INVOKABLE void testCrash();
|
||||||
};
|
};
|
||||||
|
|
|
@ -15,7 +15,7 @@ private:
|
||||||
void templateToFile(const QString &source, const QString &dest, Args &&...args);
|
void templateToFile(const QString &source, const QString &dest, Args &&...args);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SINGLETON(InitializrHelper)
|
EXAMPLESINGLETON(InitializrHelper)
|
||||||
~InitializrHelper() override;
|
~InitializrHelper() override;
|
||||||
[[maybe_unused]] Q_INVOKABLE void generate(const QString &name, const QString &path);
|
[[maybe_unused]] Q_INVOKABLE void generate(const QString &name, const QString &path);
|
||||||
Q_SIGNAL void error(const QString &message);
|
Q_SIGNAL void error(const QString &message);
|
||||||
|
|
|
@ -144,7 +144,7 @@ private:
|
||||||
explicit Network(QObject *parent = nullptr);
|
explicit Network(QObject *parent = nullptr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SINGLETON(Network)
|
EXAMPLESINGLETON(Network)
|
||||||
|
|
||||||
static Network *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine) {
|
static Network *create(QQmlEngine *qmlEngine, QJSEngine *jsEngine) {
|
||||||
return getInstance();
|
return getInstance();
|
||||||
|
|
|
@ -15,7 +15,7 @@ private:
|
||||||
explicit SettingsHelper(QObject *parent = nullptr);
|
explicit SettingsHelper(QObject *parent = nullptr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SINGLETON(SettingsHelper)
|
EXAMPLESINGLETON(SettingsHelper)
|
||||||
~SettingsHelper() override;
|
~SettingsHelper() override;
|
||||||
void init(char *argv[]);
|
void init(char *argv[]);
|
||||||
Q_INVOKABLE void saveDarkMode(int darkModel) {
|
Q_INVOKABLE void saveDarkMode(int darkModel) {
|
||||||
|
|
|
@ -14,7 +14,7 @@ private:
|
||||||
[[maybe_unused]] explicit TranslateHelper(QObject *parent = nullptr);
|
[[maybe_unused]] explicit TranslateHelper(QObject *parent = nullptr);
|
||||||
|
|
||||||
public:
|
public:
|
||||||
SINGLETON(TranslateHelper)
|
EXAMPLESINGLETON(TranslateHelper)
|
||||||
~TranslateHelper() override;
|
~TranslateHelper() override;
|
||||||
void init(QQmlEngine *engine);
|
void init(QQmlEngine *engine);
|
||||||
|
|
||||||
|
|
|
@ -4,22 +4,22 @@
|
||||||
* @brief The Singleton class
|
* @brief The Singleton class
|
||||||
*/
|
*/
|
||||||
template <typename T>
|
template <typename T>
|
||||||
class Singleton {
|
class ExampleSingleton {
|
||||||
public:
|
public:
|
||||||
static T *getInstance();
|
static T *getInstance();
|
||||||
};
|
};
|
||||||
|
|
||||||
template <typename T>
|
template <typename T>
|
||||||
T *Singleton<T>::getInstance() {
|
T *ExampleSingleton<T>::getInstance() {
|
||||||
static T *instance = new T();
|
static T *instance = new T();
|
||||||
return instance;
|
return instance;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define SINGLETON(Class) \
|
#define EXAMPLESINGLETON(Class) \
|
||||||
private: \
|
private: \
|
||||||
friend class Singleton<Class>; \
|
friend class ExampleSingleton<Class>; \
|
||||||
\
|
\
|
||||||
public: \
|
public: \
|
||||||
static Class *getInstance() { \
|
static Class *getInstance() { \
|
||||||
return Singleton<Class>::getInstance(); \
|
return ExampleSingleton<Class>::getInstance(); \
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue