mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-04-27 07:48:01 -07:00
* [VDE] Deck Analytics Widgets overhaul Took 2 minutes Took 3 minutes Took 3 minutes * Qt5 version guards. Took 33 minutes Took 3 seconds * Include QtMath Took 3 minutes Took 8 seconds * Use getCards() Took 4 minutes * Non pointer stuff Took 52 seconds * Add a newline to the tooltip Took 2 minutes Took 27 seconds * Fix build failure on macOS 15 * Rename some things. Took 17 minutes Took 11 seconds Took 18 seconds * Address overloads, fix default configuration. Took 1 hour 9 minutes Took 8 seconds * Fix mana curve default config. Took 4 minutes * Namespace to Qt libs Took 5 minutes * Selection overlay is transparent for mouse events. Took 2 minutes * Brace initialize. Took 8 minutes * Debian 11. Took 5 minutes --------- Co-authored-by: Lukas Brübach <Bruebach.Lukas@bdosecurity.de> Co-authored-by: RickyRister <ricky.rister.wang@gmail.com>
71 lines
1.8 KiB
C++
71 lines
1.8 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 "abstract_analytics_panel_widget.h"
|
|
#include "deck_list_statistics_analyzer.h"
|
|
#include "resizable_panel.h"
|
|
|
|
#include <QJsonObject>
|
|
#include <QScrollArea>
|
|
#include <QVBoxLayout>
|
|
#include <QVector>
|
|
#include <QWidget>
|
|
|
|
class LayoutInspector;
|
|
|
|
class DeckAnalyticsWidget : public QWidget
|
|
{
|
|
Q_OBJECT
|
|
|
|
public slots:
|
|
void updateDisplays();
|
|
|
|
public:
|
|
explicit DeckAnalyticsWidget(QWidget *parent, DeckListStatisticsAnalyzer *analyzer);
|
|
void retranslateUi();
|
|
|
|
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;
|
|
QWidget *controlContainer;
|
|
QHBoxLayout *controlLayout;
|
|
|
|
QPushButton *addButton;
|
|
QPushButton *removeButton;
|
|
QPushButton *saveButton;
|
|
QPushButton *loadButton;
|
|
|
|
QScrollArea *scrollArea;
|
|
QWidget *panelContainer;
|
|
QVBoxLayout *panelLayout;
|
|
|
|
QVector<ResizablePanel *> panelWrappers;
|
|
ResizablePanel *selectedWrapper = nullptr;
|
|
|
|
DeckListStatisticsAnalyzer *statsAnalyzer;
|
|
LayoutInspector *insp = nullptr;
|
|
};
|
|
|
|
#endif // DECK_ANALYTICS_WIDGET_H
|