mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 17:43:23 -08:00
[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:
parent
1e0fc35d94
commit
ab13a6748f
25 changed files with 60 additions and 178 deletions
|
|
@ -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()) {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue