mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-25 21:40:25 -06:00
Refactoring and find/replace dialog in the JSON editor.
SQL and JSON text editor classes have been refactored. A new parent class for both editors have been added for the common logic implementable without depending on the specific lexer. The only visible effect of this change should be that the JSON editor (issue #1173) now has the same find/replace dialog as the SQL editor. This prepares for the implementation of the XML editor (issue #1253).
This commit is contained in:
@@ -1,7 +1,7 @@
|
||||
#ifndef SQLTEXTEDIT_H
|
||||
#define SQLTEXTEDIT_H
|
||||
|
||||
#include "Qsci/qsciscintilla.h"
|
||||
#include "ExtendedScintilla.h"
|
||||
|
||||
class FindReplaceDialog;
|
||||
class SqlUiLexer;
|
||||
@@ -10,7 +10,7 @@ class SqlUiLexer;
|
||||
* @brief The SqlTextEdit class
|
||||
* This class is based on the QScintilla widget
|
||||
*/
|
||||
class SqlTextEdit : public QsciScintilla
|
||||
class SqlTextEdit : public ExtendedScintilla
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
@@ -18,30 +18,11 @@ public:
|
||||
explicit SqlTextEdit(QWidget *parent = nullptr);
|
||||
virtual ~SqlTextEdit();
|
||||
|
||||
bool findText(QString text, bool regexp, bool caseSensitive, bool words, bool wrap, bool forward);
|
||||
void clearSelection();
|
||||
static SqlUiLexer* sqlLexer;
|
||||
|
||||
public slots:
|
||||
void reloadKeywords();
|
||||
void reloadSettings();
|
||||
void clearErrorIndicators();
|
||||
void setErrorIndicator(int fromRow, int fromIndex, int toRow, int toIndex);
|
||||
void openFindReplaceDialog();
|
||||
|
||||
protected:
|
||||
void dropEvent(QDropEvent* e);
|
||||
|
||||
private:
|
||||
void setupSyntaxHighlightingFormat(const QString& settings_name, int style);
|
||||
|
||||
int errorIndicatorNumber;
|
||||
bool showErrorIndicators;
|
||||
FindReplaceDialog* findReplaceDialog;
|
||||
|
||||
private slots:
|
||||
void updateLineNumberAreaWidth();
|
||||
void showContextMenu(const QPoint &pos);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Reference in New Issue
Block a user