mirror of
https://github.com/sqlitebrowser/sqlitebrowser.git
synced 2026-01-20 19:11:39 -06:00
This is a first rough implementation of QScintilla support as SQL text editor. It should work mostly and build fine with qmake as well as cmake. The new code supports all the features of the old one plus adding a few subtle improvements. The main point of this, however, is reducing the code we have to maintain and making it easier to add new features to the editor.
42 lines
784 B
C++
42 lines
784 B
C++
#ifndef SQLUILEXER_H
|
|
#define SQLUILEXER_H
|
|
|
|
#include "Qsci/qscilexersql.h"
|
|
|
|
#include <QMap>
|
|
|
|
class QsciAPIs;
|
|
|
|
class SqlUiLexer : public QsciLexerSQL
|
|
{
|
|
Q_OBJECT
|
|
|
|
public:
|
|
explicit SqlUiLexer(QObject *parent = 0);
|
|
|
|
enum ApiCompleterIconId
|
|
{
|
|
ApiCompleterIconIdKeyword = 1,
|
|
ApiCompleterIconIdFunction,
|
|
ApiCompleterIconIdTable,
|
|
ApiCompleterIconIdColumn,
|
|
};
|
|
|
|
typedef QMap<QString, QList<QString> > TablesAndColumnsMap;
|
|
void setTableNames(const TablesAndColumnsMap& tables);
|
|
|
|
virtual const char* keywords(int set) const;
|
|
|
|
virtual QStringList autoCompletionWordSeparators() const;
|
|
|
|
private:
|
|
QsciAPIs* autocompleteApi;
|
|
|
|
void setupAutoCompletion();
|
|
|
|
QStringList listTables;
|
|
QStringList listFunctions;
|
|
};
|
|
|
|
#endif
|