summaryrefslogtreecommitdiffstats
path: root/SQLiteStudio3/guiSQLiteStudio/sqleditor.h
diff options
context:
space:
mode:
Diffstat (limited to 'SQLiteStudio3/guiSQLiteStudio/sqleditor.h')
-rw-r--r--SQLiteStudio3/guiSQLiteStudio/sqleditor.h17
1 files changed, 12 insertions, 5 deletions
diff --git a/SQLiteStudio3/guiSQLiteStudio/sqleditor.h b/SQLiteStudio3/guiSQLiteStudio/sqleditor.h
index 1c98682..c56492c 100644
--- a/SQLiteStudio3/guiSQLiteStudio/sqleditor.h
+++ b/SQLiteStudio3/guiSQLiteStudio/sqleditor.h
@@ -13,11 +13,17 @@
#include <QFuture>
class CompleterWindow;
-class QTimer;
class Parser;
class SqlEditor;
class SearchTextDialog;
class SearchTextLocator;
+class LazyTrigger;
+
+#ifdef Q_OS_OSX
+# define COMPLETE_REQ_KEY Qt::META
+#else
+# define COMPLETE_REQ_KEY Qt::CTRL
+#endif
CFG_KEY_LIST(SqlEditor, QObject::tr("SQL editor input field"),
CFG_KEY_ENTRY(CUT, QKeySequence::Cut, QObject::tr("Cut selected text"))
@@ -34,7 +40,7 @@ CFG_KEY_LIST(SqlEditor, QObject::tr("SQL editor input field"),
CFG_KEY_ENTRY(FIND_PREV, QKeySequence::FindPrevious, QObject::tr("Find previous"))
CFG_KEY_ENTRY(REPLACE, QKeySequence::Replace, QObject::tr("Replace in text"))
CFG_KEY_ENTRY(DELETE_LINE, Qt::CTRL + Qt::Key_D, QObject::tr("Delete current line"))
- CFG_KEY_ENTRY(COMPLETE, Qt::CTRL + Qt::Key_Space, QObject::tr("Request code assistant"))
+ CFG_KEY_ENTRY(COMPLETE, COMPLETE_REQ_KEY + Qt::Key_Space, QObject::tr("Request code assistant"))
CFG_KEY_ENTRY(FORMAT_SQL, Qt::CTRL + Qt::Key_T, QObject::tr("Format contents"))
CFG_KEY_ENTRY(MOVE_BLOCK_DOWN, Qt::ALT + Qt::Key_Down, QObject::tr("Move selected block of text one line down"))
CFG_KEY_ENTRY(MOVE_BLOCK_UP, Qt::ALT + Qt::Key_Up, QObject::tr("Move selected block of text one line up"))
@@ -199,10 +205,10 @@ class GUI_API_EXPORT SqlEditor : public QPlainTextEdit, public ExtActionContaine
QMenu* validObjContextMenu = nullptr;
Db* db = nullptr;
CompleterWindow* completer = nullptr;
- QTimer* autoCompleteTimer = nullptr;
+ LazyTrigger* autoCompleteTrigger = nullptr;
bool autoCompletion = true;
bool deletionKeyPressed = false;
- QTimer* queryParserTimer = nullptr;
+ LazyTrigger* queryParserTrigger = nullptr;
Parser* queryParser = nullptr;
QHash<QString,QStringList> objectsInNamedDb;
QMutex objectsInNamedDbMutex;
@@ -254,7 +260,7 @@ class GUI_API_EXPORT SqlEditor : public QPlainTextEdit, public ExtActionContaine
void backspacePressed();
void complete();
void completeSelected();
- void scheduleAutoCompletion();
+// void scheduleAutoCompletion();
void checkForAutoCompletion();
void completerTypedText(const QString& text);
void completerBackspacePressed();
@@ -266,6 +272,7 @@ class GUI_API_EXPORT SqlEditor : public QPlainTextEdit, public ExtActionContaine
void highlightCurrentLine();
void updateLineNumberArea(const QRect&rect, int dy);
void cursorMoved();
+ void checkContentSize();
void formatSql();
void saveToFile();
void saveAsToFile();