Merge branch 'master' of https://git.shstk.ru/SHS/qad
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
|
||||
#include <QHeaderView>
|
||||
#include <QKeyEvent>
|
||||
#include <QScreen>
|
||||
|
||||
|
||||
QCodeEditCompleter::QCodeEditCompleter(QWidget * parent): QTreeWidget(parent) {
|
||||
@@ -79,8 +80,13 @@ void QCodeEditCompleter::invoke(QPoint global_pos) {
|
||||
setCurrentItem(topLevelItem(1));
|
||||
if (isHidden()) move(global_pos);
|
||||
if (topLevelItemCount() > 0) {
|
||||
const auto screen = qApp->screenAt(global_pos);
|
||||
setVisible(true);
|
||||
adjust();
|
||||
if (global_pos.y() + height() > screen->availableSize().height()) {
|
||||
global_pos.setY(global_pos.y() -height() - fontHeight(this));
|
||||
}
|
||||
move(global_pos);
|
||||
} else {
|
||||
hide();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user