You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
42 lines
1.1 KiB
C++
42 lines
1.1 KiB
C++
#include "detailwidget.h"
|
|
#include "ui_detailwidget.h"
|
|
|
|
#include "campservice.h"
|
|
|
|
DetailWidget::DetailWidget(QWidget *parent) :
|
|
QWidget(parent),
|
|
ui(new Ui::DetailWidget)
|
|
{
|
|
ui->setupUi(this);
|
|
|
|
m_peopleModel = new AutoTableModel<AddressItem>(this);
|
|
m_servicesModel = new AutoTableModel<ServiceItem>(this);
|
|
ui->tabPeople->setModel(m_peopleModel);
|
|
ui->tabServices->setModel(m_servicesModel);
|
|
|
|
ui->tabPeople->hideColumn(0);
|
|
ui->tabPeople->hideColumn(1);
|
|
ui->tabPeople->hideColumn(6);
|
|
ui->tabPeople->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
|
|
|
|
ui->tabServices->hideColumn(1);
|
|
ui->tabServices->hideColumn(3);
|
|
ui->tabServices->hideColumn(7);
|
|
ui->tabServices->horizontalHeader()->setSectionResizeMode(0, QHeaderView::Stretch);
|
|
ui->tabServices->horizontalHeader()->setSectionResizeMode(2, QHeaderView::Stretch);
|
|
}
|
|
|
|
DetailWidget::~DetailWidget()
|
|
{
|
|
delete ui;
|
|
}
|
|
|
|
void DetailWidget::setData(const CampDataPtr &data)
|
|
{
|
|
CampService srv;
|
|
srv.loadItems(data);
|
|
|
|
m_peopleModel->setData(data->people());
|
|
m_servicesModel->setData(data->services());
|
|
}
|