2022-06-24 13:46:25 -04:00
|
|
|
#include "panel.h"
|
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
Panel::Panel(QWidget *parent) :
|
|
|
|
QWidget{parent},
|
2022-07-10 23:51:49 -04:00
|
|
|
data_(nullptr)
|
2022-06-24 13:46:25 -04:00
|
|
|
{
|
2022-06-27 12:44:50 -04:00
|
|
|
outer_layout_ = new QVBoxLayout(this);
|
2022-06-24 13:46:25 -04:00
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
layout_ = new QGridLayout();
|
|
|
|
outer_layout_->addLayout(layout_);
|
2022-06-24 13:46:25 -04:00
|
|
|
}
|
|
|
|
|
2022-07-10 23:51:49 -04:00
|
|
|
void Panel::SetData(void *data)
|
2022-06-24 13:46:25 -04:00
|
|
|
{
|
2022-07-10 23:51:49 -04:00
|
|
|
if (data_) {
|
|
|
|
OnClosingData(data_);
|
2022-06-24 13:46:25 -04:00
|
|
|
}
|
|
|
|
|
2022-07-10 23:51:49 -04:00
|
|
|
data_ = data;
|
2022-06-24 13:46:25 -04:00
|
|
|
|
2022-07-10 23:51:49 -04:00
|
|
|
if (data_) {
|
|
|
|
OnOpeningData(data_);
|
2022-06-24 13:46:25 -04:00
|
|
|
}
|
|
|
|
}
|
2022-06-27 12:44:50 -04:00
|
|
|
|
2022-07-18 14:30:19 -04:00
|
|
|
void Panel::ResetData()
|
|
|
|
{
|
|
|
|
SetData(data_);
|
|
|
|
}
|
|
|
|
|
2022-06-27 12:44:50 -04:00
|
|
|
void Panel::FinishLayout()
|
|
|
|
{
|
|
|
|
outer_layout_->addStretch();
|
|
|
|
}
|