debug: add lint for zero sized items

This commit is contained in:
outfoxxed 2024-11-19 15:25:42 -08:00
parent 66b494d760
commit 6ceee06884
Signed by untrusted user: outfoxxed
GPG key ID: 4C88A185FB89301E
7 changed files with 109 additions and 0 deletions

View file

@ -22,6 +22,8 @@ target_link_libraries(quickshell-window PRIVATE
Qt::Core Qt::Gui Qt::Quick Qt6::QuickPrivate
)
qs_add_link_dependencies(quickshell-window quickshell-debug)
target_link_libraries(quickshell-window-init PRIVATE Qt::Qml)
qs_module_pch(quickshell-window SET large)

View file

@ -19,6 +19,7 @@
#include "../core/qmlscreen.hpp"
#include "../core/region.hpp"
#include "../core/reload.hpp"
#include "../debug/lint.hpp"
#include "windowinterface.hpp"
ProxyWindowBase::ProxyWindowBase(QObject* parent)
@ -214,6 +215,11 @@ void ProxyWindowBase::polishItems() {
// This hack manually polishes the item tree right before showing the window so it will
// always be created with the correct size.
QQuickWindowPrivate::get(this->window)->polishItems();
if (!this->ranLints) {
qs::debug::lintItemTree(this->mContentItem);
this->ranLints = true;
}
}
qint32 ProxyWindowBase::x() const {

View file

@ -130,6 +130,7 @@ protected:
QQuickWindow* window = nullptr;
QQuickItem* mContentItem = nullptr;
bool reloadComplete = false;
bool ranLints = false;
private:
void polishItems();