SIEdit/app/panel.cpp

35 lines
457 B
C++
Raw Normal View History

2022-06-24 13:46:25 -04:00
#include "panel.h"
Panel::Panel(QWidget *parent) :
QWidget{parent},
data_(nullptr)
2022-06-24 13:46:25 -04:00
{
outer_layout_ = new QVBoxLayout(this);
2022-06-24 13:46:25 -04:00
layout_ = new QGridLayout();
outer_layout_->addLayout(layout_);
2022-06-24 13:46:25 -04:00
}
void Panel::SetData(void *data)
2022-06-24 13:46:25 -04:00
{
if (data_) {
OnClosingData(data_);
2022-06-24 13:46:25 -04:00
}
data_ = data;
2022-06-24 13:46:25 -04:00
if (data_) {
OnOpeningData(data_);
2022-06-24 13:46:25 -04:00
}
}
void Panel::ResetData()
{
SetData(data_);
}
void Panel::FinishLayout()
{
outer_layout_->addStretch();
}