Added sales to people. Print button on Camp wizard is now functional. Added item grids below Camp main grid.
parent
e5b33fa973
commit
cc6111d09f
@ -0,0 +1,41 @@
|
||||
#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());
|
||||
}
|
@ -0,0 +1,28 @@
|
||||
#ifndef DETAILWIDGET_H
|
||||
#define DETAILWIDGET_H
|
||||
|
||||
#include <QWidget>
|
||||
#include <autotablemodel.h>
|
||||
#include "data/camp-data.h"
|
||||
|
||||
namespace Ui {
|
||||
class DetailWidget;
|
||||
}
|
||||
|
||||
class DetailWidget : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
|
||||
public:
|
||||
explicit DetailWidget(QWidget *parent = 0);
|
||||
~DetailWidget();
|
||||
|
||||
void setData(const CampDataPtr &data);
|
||||
|
||||
private:
|
||||
Ui::DetailWidget *ui;
|
||||
AutoTableModel<AddressItem> *m_peopleModel;
|
||||
AutoTableModel<ServiceItem> *m_servicesModel;
|
||||
};
|
||||
|
||||
#endif // DETAILWIDGET_H
|
@ -0,0 +1,59 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<ui version="4.0">
|
||||
<class>DetailWidget</class>
|
||||
<widget class="QWidget" name="DetailWidget">
|
||||
<property name="geometry">
|
||||
<rect>
|
||||
<x>0</x>
|
||||
<y>0</y>
|
||||
<width>806</width>
|
||||
<height>445</height>
|
||||
</rect>
|
||||
</property>
|
||||
<property name="windowTitle">
|
||||
<string>Form</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox">
|
||||
<property name="title">
|
||||
<string>People</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_2">
|
||||
<item>
|
||||
<widget class="QTableView" name="tabPeople">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
<item>
|
||||
<widget class="QGroupBox" name="groupBox_2">
|
||||
<property name="title">
|
||||
<string>Services</string>
|
||||
</property>
|
||||
<layout class="QHBoxLayout" name="horizontalLayout_3">
|
||||
<item>
|
||||
<widget class="QTableView" name="tabServices">
|
||||
<property name="selectionMode">
|
||||
<enum>QAbstractItemView::NoSelection</enum>
|
||||
</property>
|
||||
<property name="selectionBehavior">
|
||||
<enum>QAbstractItemView::SelectRows</enum>
|
||||
</property>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
</item>
|
||||
</layout>
|
||||
</widget>
|
||||
<resources/>
|
||||
<connections/>
|
||||
</ui>
|
File diff suppressed because it is too large
Load Diff
Loading…
Reference in New Issue