Cockatrice 2026-09-01-Development-3.1.0-beta.10
A virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
game_view.h
Go to the documentation of this file.
1
6
7#ifndef GAMEVIEW_H
8#define GAMEVIEW_H
9
10#include "tally/tally.h"
11
12#include <QGraphicsView>
13
14class GameScene;
15class QGridLayout;
16class QLabel;
17class QRubberBand;
18
19class GameView : public QGraphicsView
20{
21 Q_OBJECT
22private:
24 QRubberBand *rubberBand;
28 QGridLayout *tallyLayout;
31 QList<TallyRow> cachedTallyRows;
32
33 QSize rebuildTallyLabels(const QList<TallyRow> &entries);
34 void clearTallyLabels();
35
36protected:
37 void resizeEvent(QResizeEvent *event) override;
38private slots:
39 void startRubberBand(const QPointF &selectionOrigin);
40 void resizeRubberBand(const QPointF &cursorPoint, int selectedCount);
41 void stopRubberBand();
42 void refreshShortcuts();
43 void updateTotalSelectionCount(const QSize &viewSize = QSize());
44 void setFocusDisabled(bool disabled);
45public slots:
46 void updateSceneRect(const QRectF &rect);
47
48public:
49 explicit GameView(GameScene *scene, QWidget *parent = nullptr);
50};
51
52#endif
Manages the game board display including players, zones, cards, and animations.
Definition game_scene.h:43
void startRubberBand(const QPointF &selectionOrigin)
Definition game_view.cpp:110
QPointF selectionOrigin
Definition game_view.h:29
void updateTotalSelectionCount(const QSize &viewSize=QSize())
Definition game_view.cpp:249
void setFocusDisabled(bool disabled)
Definition game_view.cpp:311
QRect previousBandRect
Last rubber-band rect for targeted repaint.
Definition game_view.h:30
QWidget * tallyContainer
Definition game_view.h:27
QList< TallyRow > cachedTallyRows
Cached entries to avoid redundant rebuilds.
Definition game_view.h:31
QRubberBand * rubberBand
Definition game_view.h:24
void updateSceneRect(const QRectF &rect)
Definition game_view.cpp:105
GameView(GameScene *scene, QWidget *parent=nullptr)
Definition game_view.cpp:38
void refreshShortcuts()
Definition game_view.cpp:195
QLabel * dragCountLabel
Definition game_view.h:25
QAction * aCloseMostRecentZoneView
Definition game_view.h:23
QGridLayout * tallyLayout
Definition game_view.h:28
QSize rebuildTallyLabels(const QList< TallyRow > &entries)
Definition game_view.cpp:206
QLabel * totalCountLabel
Definition game_view.h:26
void resizeEvent(QResizeEvent *event) override
Definition game_view.cpp:94
void clearTallyLabels()
Definition game_view.cpp:201
void stopRubberBand()
Definition game_view.cpp:179
void resizeRubberBand(const QPointF &cursorPoint, int selectedCount)
Definition game_view.cpp:122