Compare commits
11 Commits
master
...
97c6ddeaea
| Author | SHA1 | Date | |
|---|---|---|---|
| 97c6ddeaea | |||
| 5ae5034145 | |||
| 016753fb4d | |||
| b71db0530f | |||
| bb645bd71b | |||
| 12664842c7 | |||
| c41e92a9f5 | |||
| 6e4cdccc94 | |||
| e59bf65294 | |||
| 2e5d64f258 | |||
| 5382c54d6a |
@@ -1243,7 +1243,7 @@ void QCodeEdit::invokeAutoCompletition(bool force) {
|
|||||||
hideHelp();
|
hideHelp();
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
if (word_complet) acl << wordsCompletitionList(scope.second);
|
acl << wordsCompletitionList(scope.second);
|
||||||
QFont bf(font());
|
QFont bf(font());
|
||||||
bf.setBold(true);
|
bf.setBold(true);
|
||||||
foreach (const ACPair & ac, acl) {
|
foreach (const ACPair & ac, acl) {
|
||||||
@@ -1274,9 +1274,8 @@ void QCodeEdit::invokeAutoCompletition(bool force) {
|
|||||||
completer->setVisible(true);
|
completer->setVisible(true);
|
||||||
//qApp->processEvents();
|
//qApp->processEvents();
|
||||||
int sz = completer->verticalScrollBar()->width();
|
int sz = completer->verticalScrollBar()->width();
|
||||||
sz += ((QAbstractItemView*)completer)->viewport()->width();
|
for (int i = 0; i < completer->header()->count(); ++i)
|
||||||
// for (int i = 0; i < completer->header()->count(); ++i)
|
sz += qMax<int>(sz, ((QAbstractItemView*)completer)->sizeHintForColumn(i));
|
||||||
// sz += ((QAbstractItemView*)completer)->sizeHintForColumn(i);
|
|
||||||
completer->resize(sz, fontHeight() * 16);
|
completer->resize(sz, fontHeight() * 16);
|
||||||
} else
|
} else
|
||||||
completer->hide();
|
completer->hide();
|
||||||
|
|||||||
@@ -38,7 +38,6 @@ class QAD_WIDGETS_EXPORT QCodeEdit: public QWidget
|
|||||||
Q_PROPERTY(QString text READ text WRITE setText)
|
Q_PROPERTY(QString text READ text WRITE setText)
|
||||||
Q_PROPERTY(bool showSpaces READ showSpaces WRITE setShowSpaces)
|
Q_PROPERTY(bool showSpaces READ showSpaces WRITE setShowSpaces)
|
||||||
Q_PROPERTY(bool showLineNumbers READ showLineNumbers WRITE setShowLineNumbers)
|
Q_PROPERTY(bool showLineNumbers READ showLineNumbers WRITE setShowLineNumbers)
|
||||||
Q_PROPERTY(bool wordCompletitionEnabled READ wordCompletitionEnabled WRITE setWordCompletitionEnabled)
|
|
||||||
Q_PROPERTY(QFont editorFont READ editorFont WRITE setEditorFont)
|
Q_PROPERTY(QFont editorFont READ editorFont WRITE setEditorFont)
|
||||||
|
|
||||||
public:
|
public:
|
||||||
@@ -73,8 +72,6 @@ public:
|
|||||||
|
|
||||||
void registerAutoCompletitionClass(int id, ACClassType ac_class, const QString & name, const QIcon & icon = QIcon()) {ac_classes[id] = ACClass(id, ac_class, name, icon);}
|
void registerAutoCompletitionClass(int id, ACClassType ac_class, const QString & name, const QIcon & icon = QIcon()) {ac_classes[id] = ACClass(id, ac_class, name, icon);}
|
||||||
|
|
||||||
bool wordCompletitionEnabled() const {return word_complet;}
|
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
typedef QPair<QString, QString> StringsPair;
|
typedef QPair<QString, QString> StringsPair;
|
||||||
typedef QPair<int, QList<StringsPair> > ACPair;
|
typedef QPair<int, QList<StringsPair> > ACPair;
|
||||||
@@ -114,7 +111,6 @@ private:
|
|||||||
QStringList cursor_scope;
|
QStringList cursor_scope;
|
||||||
int prev_lc, auto_comp_pl, timer, cur_search_ind, pos_press, pos_el_press;
|
int prev_lc, auto_comp_pl, timer, cur_search_ind, pos_press, pos_el_press;
|
||||||
bool spaces_, _ignore_focus_out, _first, _destructor, _replacing;
|
bool spaces_, _ignore_focus_out, _first, _destructor, _replacing;
|
||||||
bool word_complet;
|
|
||||||
|
|
||||||
bool eventFilter(QObject * o, QEvent * e);
|
bool eventFilter(QObject * o, QEvent * e);
|
||||||
void showEvent(QShowEvent * );
|
void showEvent(QShowEvent * );
|
||||||
@@ -128,7 +124,7 @@ private:
|
|||||||
void clearSearch();
|
void clearSearch();
|
||||||
void moveToSearch();
|
void moveToSearch();
|
||||||
int searchIndFromCursor();
|
int searchIndFromCursor();
|
||||||
|
|
||||||
private slots:
|
private slots:
|
||||||
void syncScrolls();
|
void syncScrolls();
|
||||||
void scrollUp();
|
void scrollUp();
|
||||||
@@ -167,9 +163,7 @@ public slots:
|
|||||||
void searchNext(bool next = true);
|
void searchNext(bool next = true);
|
||||||
void searchPrevious();
|
void searchPrevious();
|
||||||
void hideSearch();
|
void hideSearch();
|
||||||
void setWordCompletitionEnabled(bool on) {word_complet = on;}
|
|
||||||
|
|
||||||
|
|
||||||
signals:
|
signals:
|
||||||
void textChanged();
|
void textChanged();
|
||||||
void parseRequest();
|
void parseRequest();
|
||||||
|
|||||||
Reference in New Issue
Block a user