Compare commits
2 Commits
d96c99f79d
...
bfa1e4af38
| Author | SHA1 | Date | |
|---|---|---|---|
| bfa1e4af38 | |||
| ceb00e911b |
@@ -10,6 +10,9 @@
|
||||
#include <QAction>
|
||||
#include <QApplication>
|
||||
#include <QHeaderView>
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
# include <QWindow>
|
||||
#endif
|
||||
#include "ecombobox.h"
|
||||
#include "qad_types.h"
|
||||
#include "ui_qcodeedit.h"
|
||||
@@ -130,6 +133,9 @@ QCodeEdit::QCodeEdit(QWidget * parent): QWidget(parent) {
|
||||
connect(ui->textCode, SIGNAL(selectionChanged()), this, SLOT(textEdit_selectionChanged()));
|
||||
connect(ui->comboSearch->lineEdit(), SIGNAL(returnPressed()), this, SLOT(searchNext()));
|
||||
connect(ui->comboReplace->lineEdit(), SIGNAL(returnPressed()), this, SLOT(on_buttonReplaceSearch_clicked()));
|
||||
#if QT_VERSION >= QT_VERSION_CHECK(5, 0, 0)
|
||||
connect(qApp, &QGuiApplication::focusWindowChanged, this, [this](QWindow*w){if (w == 0) {hideHelp(); completer->hide();}});
|
||||
#endif
|
||||
updateLines();
|
||||
|
||||
registerAutoCompletitionClass(-1, QCodeEdit::Keyword, "Words", QIcon(":/icons/code-word.png"));
|
||||
@@ -1292,11 +1298,9 @@ void QCodeEdit::invokeAutoCompletition(bool force) {
|
||||
completer->move(ui->textCode->mapToGlobal(ui->textCode->cursorRect().bottomRight()));
|
||||
if (completer->topLevelItemCount() > 0) {
|
||||
completer->setVisible(true);
|
||||
//qApp->processEvents();
|
||||
int sz = completer->verticalScrollBar()->width();
|
||||
sz += ((QAbstractItemView*)completer)->viewport()->width();
|
||||
// for (int i = 0; i < completer->header()->count(); ++i)
|
||||
// sz += ((QAbstractItemView*)completer)->sizeHintForColumn(i);
|
||||
int sz = completer->verticalScrollBar()->isVisible() ? completer->verticalScrollBar()->width() : 0;
|
||||
for (int i = 0; i < completer->header()->count(); ++i)
|
||||
sz += ((QAbstractItemView*)completer)->sizeHintForColumn(i);
|
||||
completer->resize(sz, fontHeight() * 16);
|
||||
} else
|
||||
completer->hide();
|
||||
|
||||
Reference in New Issue
Block a user