Skip to content

Commit dbaaf55

Browse files
committed
core/popupwindow: remove parentWindow deprecation message
Was being falsely triggered by lints.
1 parent eb5a5b8 commit dbaaf55

File tree

4 files changed

+11
-14
lines changed

4 files changed

+11
-14
lines changed

src/debug/lint.cpp

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -7,10 +7,7 @@
77
#include <qqmlcontext.h>
88
#include <qqmlengine.h>
99
#include <qqmlinfo.h>
10-
#include <qquickframebufferobject.h>
1110
#include <qquickitem.h>
12-
#include <qquickpainteditem.h>
13-
#include <qquickrhiitem.h>
1411
#include <qquickwindow.h>
1512
#include <qstringliteral.h>
1613

src/wayland/popupanchor.cpp

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
#include <private/wayland-xdg-shell-client-protocol.h>
77
#include <qvariant.h>
88
#include <qwindow.h>
9+
#include <qtmetamacros.h>
910

1011
#include "../core/popupanchor.hpp"
1112
#include "../core/types.hpp"

src/window/popupwindow.cpp

Lines changed: 7 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
#include <qlogging.h>
44
#include <qnamespace.h>
55
#include <qobject.h>
6-
#include <qquickwindow.h>
6+
#include <qqmlinfo.h>
77
#include <qtypes.h>
88
#include <qwindow.h>
99

@@ -38,12 +38,11 @@ void ProxyPopupWindow::completeWindow() {
3838
void ProxyPopupWindow::postCompleteWindow() { this->updateTransientParent(); }
3939

4040
void ProxyPopupWindow::setParentWindow(QObject* parent) {
41-
qWarning() << "PopupWindow.parentWindow is deprecated. Use PopupWindow.anchor.window.";
41+
qmlWarning(this) << "PopupWindow.parentWindow is deprecated. Use PopupWindow.anchor.window.";
4242
this->mAnchor.setWindow(parent);
4343
}
4444

4545
QObject* ProxyPopupWindow::parentWindow() const {
46-
qWarning() << "PopupWindow.parentWindow is deprecated. Use PopupWindow.anchor.window.";
4746
return this->mAnchor.window();
4847
}
4948

@@ -71,7 +70,7 @@ void ProxyPopupWindow::updateTransientParent() {
7170
void ProxyPopupWindow::onParentUpdated() { this->updateTransientParent(); }
7271

7372
void ProxyPopupWindow::setScreen(QuickshellScreenInfo* /*unused*/) {
74-
qWarning() << "Cannot set screen of popup window, as that is controlled by the parent window";
73+
qmlWarning(this) << "Cannot set screen of popup window, as that is controlled by the parent window";
7574
}
7675

7776
void ProxyPopupWindow::setVisible(bool visible) {
@@ -101,28 +100,28 @@ void ProxyPopupWindow::onVisibleChanged() {
101100
}
102101

103102
void ProxyPopupWindow::setRelativeX(qint32 x) {
104-
qWarning() << "PopupWindow.relativeX is deprecated. Use PopupWindow.anchor.rect.x.";
103+
qmlWarning(this) << "PopupWindow.relativeX is deprecated. Use PopupWindow.anchor.rect.x.";
105104
auto rect = this->mAnchor.rect();
106105
if (x == rect.x) return;
107106
rect.x = x;
108107
this->mAnchor.setRect(rect);
109108
}
110109

111110
qint32 ProxyPopupWindow::relativeX() const {
112-
qWarning() << "PopupWindow.relativeX is deprecated. Use PopupWindow.anchor.rect.x.";
111+
qmlWarning(this) << "PopupWindow.relativeX is deprecated. Use PopupWindow.anchor.rect.x.";
113112
return this->mAnchor.rect().x;
114113
}
115114

116115
void ProxyPopupWindow::setRelativeY(qint32 y) {
117-
qWarning() << "PopupWindow.relativeY is deprecated. Use PopupWindow.anchor.rect.y.";
116+
qmlWarning(this) << "PopupWindow.relativeY is deprecated. Use PopupWindow.anchor.rect.y.";
118117
auto rect = this->mAnchor.rect();
119118
if (y == rect.y) return;
120119
rect.y = y;
121120
this->mAnchor.setRect(rect);
122121
}
123122

124123
qint32 ProxyPopupWindow::relativeY() const {
125-
qWarning() << "PopupWindow.relativeY is deprecated. Use PopupWindow.anchor.rect.y.";
124+
qmlWarning(this) << "PopupWindow.relativeY is deprecated. Use PopupWindow.anchor.rect.y.";
126125
return this->mAnchor.rect().y;
127126
}
128127

src/window/popupwindow.hpp

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,9 +30,9 @@
3030
/// }
3131
///
3232
/// PopupWindow {
33-
/// parentWindow: toplevel
34-
/// relativeX: parentWindow.width / 2 - width / 2
35-
/// relativeY: parentWindow.height
33+
/// anchor.window: toplevel
34+
/// anchor.rect.x: parentWindow.width / 2 - width / 2
35+
/// anchor.rect.y: parentWindow.height
3636
/// width: 500
3737
/// height: 500
3838
/// visible: true

0 commit comments

Comments
 (0)