completer fixes
This commit is contained in:
@@ -416,7 +416,7 @@ bool QCodeEdit::eventFilter(QObject * o, QEvent * e) {
|
|||||||
completer->hide();
|
completer->hide();
|
||||||
hideHelp();
|
hideHelp();
|
||||||
}
|
}
|
||||||
if (e->type() == QEvent::MouseMove) {
|
if (e->type() == QEvent::MouseMove && completer->isHidden()) {
|
||||||
QMouseEvent * me = (QMouseEvent*)e;
|
QMouseEvent * me = (QMouseEvent*)e;
|
||||||
if (me->modifiers().testFlag(Qt::ControlModifier)) {
|
if (me->modifiers().testFlag(Qt::ControlModifier)) {
|
||||||
showLink();
|
showLink();
|
||||||
|
|||||||
@@ -70,21 +70,16 @@ void QCodeEditCompleter::addItems(QFont f, const QCodeEdit::ACClass & cl, const
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
bool QCodeEditCompleter::isEmpty() const {
|
|
||||||
return topLevelItemCount() <= 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
void QCodeEditCompleter::invoke(QPoint global_pos) {
|
void QCodeEditCompleter::invoke(QPoint global_pos) {
|
||||||
if (isEmpty()) {
|
if (topLevelItemCount() > 1) setCurrentItem(topLevelItem(1));
|
||||||
|
if (isHidden()) move(global_pos);
|
||||||
|
if (topLevelItemCount() > 0) {
|
||||||
|
setVisible(true);
|
||||||
|
adjust();
|
||||||
|
} else {
|
||||||
hide();
|
hide();
|
||||||
return;
|
|
||||||
}
|
}
|
||||||
setCurrentItem(topLevelItem(1));
|
|
||||||
if (isHidden())
|
|
||||||
move(global_pos);
|
|
||||||
setVisible(true);
|
|
||||||
adjust();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -34,7 +34,6 @@ public:
|
|||||||
void nextCompletition();
|
void nextCompletition();
|
||||||
void previousCompletition();
|
void previousCompletition();
|
||||||
void addItems(QFont f, const QCodeEdit::ACClass & cl, const QCodeEdit::ACSection & items);
|
void addItems(QFont f, const QCodeEdit::ACClass & cl, const QCodeEdit::ACSection & items);
|
||||||
bool isEmpty() const;
|
|
||||||
void invoke(QPoint global_pos);
|
void invoke(QPoint global_pos);
|
||||||
|
|
||||||
QString currentReturn() const;
|
QString currentReturn() const;
|
||||||
|
|||||||
Reference in New Issue
Block a user