SIEdit/app/panel.cpp

36 lines
506 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);
2023-09-14 13:14:49 -04:00
outer_layout_->setContentsMargins(0, 0, 0, 0);
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();
}