@@ -13,7 +13,7 @@ QPoint mapPopupToScreen(
13
13
const QWidget& widget,
14
14
const QPoint& popupUpperLeft,
15
15
const QSize& popupSize) {
16
- const auto * const pScreen = getScreen ( widget);
16
+ const auto * const pScreen = widget. screen ( );
17
17
VERIFY_OR_DEBUG_ASSERT (pScreen) {
18
18
// This should never fail
19
19
return popupUpperLeft;
@@ -37,8 +37,7 @@ QPoint mapPopupToScreen(
37
37
return QPoint (adjustedX, adjustedY);
38
38
}
39
39
40
- QWindow* getWindow (
41
- const QWidget& widget) {
40
+ QWindow* getWindow (const QWidget& widget) {
42
41
if (auto * window = widget.windowHandle ()) {
43
42
return window;
44
43
}
@@ -52,7 +51,7 @@ void growListWidget(QListWidget& listWidget, const QWidget& parent) {
52
51
// Try to display all files and the complete file locations to avoid
53
52
// horizontal scrolling.
54
53
// Get the screen dimensions
55
- QScreen * const pScreen = getScreen ( parent);
54
+ const auto * const pScreen = parent. screen ( );
56
55
QSize screenSpace;
57
56
VERIFY_OR_DEBUG_ASSERT (pScreen) {
58
57
qWarning () << " Screen not detected. Assuming screen size of 800x600px." ;
@@ -67,7 +66,7 @@ void growListWidget(QListWidget& listWidget, const QWidget& parent) {
67
66
int minW = listWidget.sizeHintForColumn (0 ) + margin;
68
67
int minH = listWidget.sizeHintForRow (0 ) * listWidget.count () + margin;
69
68
// The file list should fit into the window, but clamp to 75% of screen size
70
- // so (hoepfully ) the entire containing dialog is visible even if there are
69
+ // so (hopefully ) the entire containing dialog is visible even if there are
71
70
// toolbars at the screen edges
72
71
int newW = std::min (minW, static_cast <int >(screenSpace.width () * 0.75 ));
73
72
int newH = std::min (minH, static_cast <int >(screenSpace.height () * 0.75 ));
0 commit comments