Skip to content

Commit a8901fd

Browse files
committed
debug/lint: run lints on reload for visible windows
1 parent 8d63006 commit a8901fd

File tree

2 files changed

+7
-4
lines changed

2 files changed

+7
-4
lines changed

src/window/proxywindow.cpp

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,7 +76,10 @@ void ProxyWindowBase::onReload(QObject* oldInstance) {
7676
emit this->windowConnected();
7777
this->postCompleteWindow();
7878

79-
if (wasVisible && this->isVisibleDirect()) emit this->backerVisibilityChanged();
79+
if (wasVisible && this->isVisibleDirect()) {
80+
emit this->backerVisibilityChanged();
81+
this->runLints();
82+
}
8083
}
8184

8285
void ProxyWindowBase::postCompleteWindow() { this->setVisible(this->mVisible); }
@@ -137,7 +140,7 @@ void ProxyWindowBase::connectWindow() {
137140
QObject::connect(this->window, &QWindow::heightChanged, this, &ProxyWindowBase::heightChanged);
138141
QObject::connect(this->window, &QWindow::screenChanged, this, &ProxyWindowBase::screenChanged);
139142
QObject::connect(this->window, &QQuickWindow::colorChanged, this, &ProxyWindowBase::colorChanged);
140-
QObject::connect(this->window, &ProxiedWindow::exposed, this, &ProxyWindowBase::onWindowExposeEvent);
143+
QObject::connect(this->window, &ProxiedWindow::exposed, this, &ProxyWindowBase::runLints);
141144
// clang-format on
142145
}
143146

@@ -221,7 +224,7 @@ void ProxyWindowBase::polishItems() {
221224
QQuickWindowPrivate::get(this->window)->polishItems();
222225
}
223226

224-
void ProxyWindowBase::onWindowExposeEvent() {
227+
void ProxyWindowBase::runLints() {
225228
if (!this->ranLints) {
226229
qs::debug::lintItemTree(this->mContentItem);
227230
this->ranLints = true;

src/window/proxywindow.hpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -122,7 +122,7 @@ protected slots:
122122
void onMaskChanged();
123123
void onMaskDestroyed();
124124
void onScreenDestroyed();
125-
void onWindowExposeEvent();
125+
void runLints();
126126

127127
protected:
128128
bool mVisible = true;

0 commit comments

Comments
 (0)