Cockatrice 2025-11-30-Development-2.11.0-beta.38
A cross-platform virtual tabletop for multiplayer card games
Loading...
Searching...
No Matches
tab.h
Go to the documentation of this file.
1
6
7#ifndef TAB_H
8#define TAB_H
9
10#include <QMainWindow>
12
13class QMenu;
14class TabSupervisor;
16
17class Tab : public QMainWindow
18{
19 Q_OBJECT
20signals:
21 void userEvent(bool globalEvent = true);
22 void tabTextChanged(Tab *tab, const QString &newTabText);
23
24protected:
26 void addTabMenu(QMenu *menu)
27 {
28 tabMenus.append(menu);
29 }
30protected slots:
31 void showCardInfoPopup(const QPoint &pos, const CardRef &cardRef);
32 void deleteCardInfoPopup(const QString &cardName);
33
34private:
38 QList<QMenu *> tabMenus;
39
40public:
41 explicit Tab(TabSupervisor *_tabSupervisor);
42 [[nodiscard]] const QList<QMenu *> &getTabMenus() const
43 {
44 return tabMenus;
45 }
46 [[nodiscard]] TabSupervisor *getTabSupervisor() const
47 {
48 return tabSupervisor;
49 }
50 [[nodiscard]] bool getContentsChanged() const
51 {
52 return contentsChanged;
53 }
54 void setContentsChanged(bool _contentsChanged)
55 {
56 contentsChanged = _contentsChanged;
57 }
58 [[nodiscard]] virtual QString getTabText() const = 0;
59 virtual void retranslateUi() = 0;
60
68 virtual bool closeRequest();
69
70 virtual void tabActivated()
71 {
72 }
73};
74
75#endif
Definition card_info_display_widget.h:21
Definition tab_supervisor.h:83
bool getContentsChanged() const
Definition tab.h:50
CardRef currentCard
Definition tab.h:35
void addTabMenu(QMenu *menu)
Definition tab.h:26
TabSupervisor * tabSupervisor
Definition tab.h:25
bool contentsChanged
Definition tab.h:36
void deleteCardInfoPopup(const QString &cardName)
Definition tab.cpp:36
void tabTextChanged(Tab *tab, const QString &newTabText)
virtual QString getTabText() const =0
const QList< QMenu * > & getTabMenus() const
Definition tab.h:42
TabSupervisor * getTabSupervisor() const
Definition tab.h:46
Tab(TabSupervisor *_tabSupervisor)
Definition tab.cpp:11
void userEvent(bool globalEvent=true)
virtual void tabActivated()
Definition tab.h:70
void setContentsChanged(bool _contentsChanged)
Definition tab.h:54
virtual void retranslateUi()=0
virtual bool closeRequest()
Definition tab.cpp:46
void showCardInfoPopup(const QPoint &pos, const CardRef &cardRef)
Definition tab.cpp:17
QList< QMenu * > tabMenus
Definition tab.h:38
CardInfoDisplayWidget * infoPopup
Definition tab.h:37
Definition card_ref.h:14