3 #include <QApplication>
4 #include <QDesktopWidget>
16 if (boundingRect.top() > requiredRect.top())
17 requiredRect.moveTop(boundingRect.top());
18 else if (boundingRect.bottom() < requiredRect.bottom())
19 requiredRect.moveBottom(boundingRect.bottom());
21 if (boundingRect.left() > requiredRect.left())
22 requiredRect.moveLeft(boundingRect.left());
23 else if (boundingRect.right() < requiredRect.right())
24 requiredRect.moveRight(boundingRect.right());
25 w->
move(requiredRect.topLeft());
void ensureOnScreen(QWidget *w)
(Fully) displays the widget by moving it.
QDesktopWidget * desktop()