Use QWindow::setScreen instead of QWidget::setScreen
This commit is contained in:
parent
9ebfd80b29
commit
8de2eee8cc
2 changed files with 5 additions and 3 deletions
|
|
@ -770,10 +770,11 @@ void PopupMenu::showMenu(const QPoint &p, PopupMenu *parent, TriggeredSource sou
|
|||
}
|
||||
_parent = parent;
|
||||
|
||||
createWinId();
|
||||
if (_parent) {
|
||||
setScreen(_parent->screen());
|
||||
windowHandle()->setScreen(_parent->screen());
|
||||
} else if (screen) {
|
||||
setScreen(screen);
|
||||
windowHandle()->setScreen(screen);
|
||||
}
|
||||
|
||||
using Origin = PanelAnimation::Origin;
|
||||
|
|
|
|||
|
|
@ -117,7 +117,8 @@ void Tooltip::popup(const QPoint &m, const QString &text, const style::Tooltip *
|
|||
|
||||
// adjust tooltip position
|
||||
if (screen) {
|
||||
setScreen(screen);
|
||||
createWinId();
|
||||
windowHandle()->setScreen(screen);
|
||||
const auto r = screen->availableGeometry();
|
||||
if (r.x() + r.width() - _st->skip < p.x() + s.width() && p.x() + s.width() > m.x()) {
|
||||
p.setX(qMax(r.x() + r.width() - int32(_st->skip) - s.width(), m.x() - s.width()));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue