LibreVNA/Software/PC_Application/CustomWidgets/tilewidget.h
Kiara Navarro 0b2cd5bdc5
gui: set individual plot as full screen when double clicked
The following commit features to set specific plot as full screen
if double clicked event is triggered while mouse is over that
particular plot.

This becomes handy if you are interested in a particular traces over
that plot and want to inspect it in more detail.
2021-07-03 16:09:28 -03:00

62 lines
1.4 KiB
C++

#ifndef TILEWIDGET_H
#define TILEWIDGET_H
#include <QWidget>
#include "Traces/traceplot.h"
#include <QSplitter>
#include "Traces/tracemodel.h"
#include "savable.h"
namespace Ui {
class TileWidget;
}
class TileWidget : public QWidget, public Savable
{
Q_OBJECT
public:
explicit TileWidget(TraceModel &model, QWidget *parent = nullptr);
~TileWidget();
TileWidget *Child1() { return child1; };
TileWidget *Child2() { return child2; };
// closes all plots/childs, leaving only the tilewidget at the top
void clear();
virtual nlohmann::json toJSON() override;
virtual void fromJSON(nlohmann::json j) override;
public slots:
void splitVertically();
void splitHorizontally();
void closeTile();
void setPlot(TracePlot *plot);
private slots:
void on_bSmithchart_clicked();
void on_bXYplot_clicked();
void on_plotDoubleClicked();
void traceDeleted(TracePlot *t);
private:
TileWidget(TraceModel &model, TileWidget &parent);
void split();
void setContent(TracePlot *plot);
void setChild();
TileWidget* findRootTile();
void setFullScreen();
TracePlot *fullScreenPlot;
Ui::TileWidget *ui;
QSplitter *splitter;
bool isSplit;
TileWidget *parent;
TileWidget *child1, *child2;
bool hasContent;
bool isFullScreen;
TracePlot *content;
TraceModel &model;
};
#endif // TILEWIDGET_H