[QtUtils] Adopt shared Qt helpers across the client (#7618)

* [QtUtils] Add parent lookup, layout clearing, scroll area and monospace helpers

* [QtUtils] Adopt shared Qt helpers across the client

---------

Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de>
This commit is contained in:
BruebachL 2026-10-24 08:26:21 +02:00 • committed by GitHub
parent 1e0fc35d94
commit ab13a6748f
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
25 changed files with 60 additions and 178 deletions

View file

@ -12,6 +12,7 @@
#include "../card_dimensions.h"
#include "../z_values.h"
#include "libcockatrice/utility/macros.h"
#include "libcockatrice/utility/qt_utils.h"
#include "view_zone.h"
#include <QAction>
@ -356,12 +357,8 @@ QRectF ZoneViewWidget::closeButtonRect(QWidget *styleWidget) const
QGraphicsView *ZoneViewWidget::findDragView(QWidget *eventWidget) const
{
QWidget *current = eventWidget;
while (current) {
if (auto *view = qobject_cast<QGraphicsView *>(current)) {
return view;
}
current = current->parentWidget();
if (auto *view = QtUtils::findParentOfType<QGraphicsView>(eventWidget, true)) {
return view;
}
if (scene() && !scene()->views().isEmpty()) {