servatrice/cockatrice/src/tab.h
ebbit1q c874f201c3 add a bunch of parents to dialogs (#3658)
* add a bunch of parents to dialogs

works on #3651

* use game as parent instead

* add more parents

* fix create token dialog modality

* add parent to game information window

* replace a bunch of nullptrs with the magic of sed

* add parent to tip of the day and counters

* reorder game ptr

* set parent for life counter

* clangify
2019-03-26 14:54:47 -04:00

61 lines
1.2 KiB
C++

#ifndef TAB_H
#define TAB_H
#include <QMainWindow>
class QMenu;
class TabSupervisor;
class CardInfoWidget;
class Tab : public QMainWindow
{
Q_OBJECT
signals:
void userEvent(bool globalEvent = true);
void tabTextChanged(Tab *tab, const QString &newTabText);
protected:
TabSupervisor *tabSupervisor;
void addTabMenu(QMenu *menu)
{
tabMenus.append(menu);
}
protected slots:
void showCardInfoPopup(const QPoint &pos, const QString &cardName);
void deleteCardInfoPopup(const QString &cardName);
private:
QString currentCardName;
bool contentsChanged;
CardInfoWidget *infoPopup;
QList<QMenu *> tabMenus;
public:
Tab(TabSupervisor *_tabSupervisor, QWidget *parent = nullptr);
const QList<QMenu *> &getTabMenus() const
{
return tabMenus;
}
TabSupervisor *getTabSupervisor() const
{
return tabSupervisor;
}
bool getContentsChanged() const
{
return contentsChanged;
}
void setContentsChanged(bool _contentsChanged)
{
contentsChanged = _contentsChanged;
}
virtual QString getTabText() const = 0;
virtual void retranslateUi() = 0;
virtual void closeRequest()
{
}
virtual void tabActivated()
{
}
};
#endif