summaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/uiscriptingedit.h
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/uiscriptingedit.h')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/uiscriptingedit.h37
1 files changed, 37 insertions, 0 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/uiscriptingedit.h b/SQLiteStudio3/guiSQLiteStudio/uiscriptingedit.h
new file mode 100644
index 0000000..fdd2df8
--- /dev/null
+++ b/SQLiteStudio3/guiSQLiteStudio/uiscriptingedit.h
@@ -0,0 +1,37 @@
+#ifndef UISCRIPTINGEDIT_H
+#define UISCRIPTINGEDIT_H
+
+#include "uiloaderpropertyhandler.h"
+#include "common/global.h"
+#include "guiSQLiteStudio_global.h"
+#include <QObject>
+
+class QSyntaxHighlighter;
+
+class GUI_API_EXPORT UiScriptingEdit : public UiLoaderPropertyHandler
+{
+ public:
+ UiScriptingEdit();
+
+ const char* getPropertyName() const;
+ void handle(QWidget* widget, const QVariant& value);
+
+ private:
+ class EditUpdater : public QObject
+ {
+ public:
+ EditUpdater(QWidget* widget);
+
+ bool eventFilter(QObject* obj, QEvent* e);
+
+ private:
+ void installNewHighlighter(const QVariant& prop);
+
+ QWidget* watchedWidget = nullptr;
+ QString currentLang;
+ QSyntaxHighlighter* currentHighlighter = nullptr;
+ bool changingHighlighter = false;
+ };
+};
+
+#endif // UISCRIPTINGEDIT_H