mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-11-05 09:33:25 -08:00
81 lines
2 KiB
C++
81 lines
2 KiB
C++
/**
|
|
* @file deck_analytics_widget.h
|
|
* @ingroup DeckEditorAnalyticsWidgets
|
|
* @brief Main analytics widget container with resizable panels for deck statistics.
|
|
*/
|
|
|
|
#ifndef DECK_ANALYTICS_WIDGET_H
|
|
#define DECK_ANALYTICS_WIDGET_H
|
|
|
|
#include "../general/tutorial/tutorial_controller.h"
|
|
|
|
#include <QJsonObject>
|
|
#include <QList>
|
|
#include <QString>
|
|
#include <QVector>
|
|
#include <QWidget>
|
|
#include <qtmetamacros.h>
|
|
|
|
class LayoutInspector;
|
|
class AbstractAnalyticsPanelWidget;
|
|
class DeckListStatisticsAnalyzer;
|
|
class FlowWidget;
|
|
class QCheckBox;
|
|
class QPushButton;
|
|
class QScrollArea;
|
|
class QVBoxLayout;
|
|
class ResizablePanel;
|
|
|
|
class DeckAnalyticsWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public slots:
|
|
void updateDisplays();
|
|
|
|
public:
|
|
explicit DeckAnalyticsWidget(QWidget *parent, DeckListStatisticsAnalyzer *analyzer);
|
|
void retranslateUi();
|
|
void includeSideboardChanged(bool checked);
|
|
TutorialSequence generateTutorialSequence();
|
|
|
|
private slots:
|
|
void onAddPanel();
|
|
void onRemoveSelected();
|
|
void onPanelDropped(ResizablePanel *dragged, ResizablePanel *target, bool insertBefore);
|
|
void saveLayout();
|
|
void loadLayout();
|
|
void addDefaultPanels();
|
|
bool loadLayoutInternal();
|
|
void clearPanels();
|
|
|
|
protected:
|
|
bool eventFilter(QObject *obj, QEvent *event) override;
|
|
void selectWrapper(ResizablePanel *panel);
|
|
int indexOfSelectedWrapper() const;
|
|
|
|
private:
|
|
void addPanelInstance(const QString &typeId, AbstractAnalyticsPanelWidget *panel, const QJsonObject &cfg = {});
|
|
|
|
QVBoxLayout *layout;
|
|
FlowWidget *controlContainer;
|
|
|
|
QPushButton *addButton;
|
|
QPushButton *removeButton;
|
|
QPushButton *saveButton;
|
|
QPushButton *loadButton;
|
|
|
|
QCheckBox *includeSideboardCheckBox;
|
|
|
|
QScrollArea *scrollArea;
|
|
QWidget *panelContainer;
|
|
QVBoxLayout *panelLayout;
|
|
|
|
QVector<ResizablePanel *> panelWrappers;
|
|
ResizablePanel *selectedWrapper = nullptr;
|
|
|
|
DeckListStatisticsAnalyzer *statsAnalyzer;
|
|
LayoutInspector *insp = nullptr;
|
|
};
|
|
|
|
#endif // DECK_ANALYTICS_WIDGET_H
|