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