debug/lint: run lints on reload for visible windows

This commit is contained in:
outfoxxed 2024-11-22 17:55:45 -08:00
parent 8d63006bba
commit a8901fde67
Signed by: outfoxxed
GPG key ID: 4C88A185FB89301E
2 changed files with 7 additions and 4 deletions

View file

@ -76,7 +76,10 @@ void ProxyWindowBase::onReload(QObject* oldInstance) {
emit this->windowConnected();
this->postCompleteWindow();
if (wasVisible && this->isVisibleDirect()) emit this->backerVisibilityChanged();
if (wasVisible && this->isVisibleDirect()) {
emit this->backerVisibilityChanged();
this->runLints();
}
}
void ProxyWindowBase::postCompleteWindow() { this->setVisible(this->mVisible); }
@ -137,7 +140,7 @@ void ProxyWindowBase::connectWindow() {
QObject::connect(this->window, &QWindow::heightChanged, this, &ProxyWindowBase::heightChanged);
QObject::connect(this->window, &QWindow::screenChanged, this, &ProxyWindowBase::screenChanged);
QObject::connect(this->window, &QQuickWindow::colorChanged, this, &ProxyWindowBase::colorChanged);
QObject::connect(this->window, &ProxiedWindow::exposed, this, &ProxyWindowBase::onWindowExposeEvent);
QObject::connect(this->window, &ProxiedWindow::exposed, this, &ProxyWindowBase::runLints);
// clang-format on
}
@ -221,7 +224,7 @@ void ProxyWindowBase::polishItems() {
QQuickWindowPrivate::get(this->window)->polishItems();
}
void ProxyWindowBase::onWindowExposeEvent() {
void ProxyWindowBase::runLints() {
if (!this->ranLints) {
qs::debug::lintItemTree(this->mContentItem);
this->ranLints = true;

View file

@ -122,7 +122,7 @@ protected slots:
void onMaskChanged();
void onMaskDestroyed();
void onScreenDestroyed();
void onWindowExposeEvent();
void runLints();
protected:
bool mVisible = true;