From b07dbb64147d325617e16084edaea01e1f1decf5 Mon Sep 17 00:00:00 2001 From: konrad Date: Tue, 28 Dec 2010 12:00:49 +0000 Subject: [PATCH] buttons for order audit git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@687 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33 --- src/dialogs/orderauditdlg.cpp | 23 +++++++++++++++++++---- 1 files changed, 19 insertions(+), 4 deletions(-) diff --git a/src/dialogs/orderauditdlg.cpp b/src/dialogs/orderauditdlg.cpp index a8465a5..62e7f49 100644 --- a/src/dialogs/orderauditdlg.cpp +++ b/src/dialogs/orderauditdlg.cpp @@ -13,16 +13,17 @@ #include "orderauditdlg_p.h" #include "formula.h" +#include "main.h" #include -#include -#include -#include #include +#include #include #include #include -#include +#include +#include +#include class MOAAuditList:public QList @@ -95,6 +96,7 @@ MOrderAuditDialog::MOrderAuditDialog(MTGetOrderAudit& audit, QWidget* parent) setWindowTitle(tr("Order Audit [%1]").arg(orders.value(0).orderid())); setSizeGripEnabled(true); d->formula.setParent(this); + resize(800,600); //init list d->maudit.addOrders(orders); d->maudit.addTickets(audit.gettickets()); @@ -117,7 +119,19 @@ MOrderAuditDialog::MOrderAuditDialog(MTGetOrderAudit& audit, QWidget* parent) vl->addWidget(d->mdata=new QTreeView,1); d->mdata->setModel(d->mmodel=new QStandardItemModel); d->mdata->setEditTriggers(QAbstractItemView::NoEditTriggers); + connect(d->mprofile,SIGNAL(currentIndexChanged(int)),this,SLOT(drawdata())); drawdata(); + //button bar + QPushButton*p; + QHBoxLayout*hl; + vl->addLayout(hl=new QHBoxLayout,0); + hl->addWidget(p=new QPushButton("Expand"),0); + connect(p,SIGNAL(clicked()),d->mdata,SLOT(expandAll())); + hl->addWidget(p=new QPushButton("Collapse"),0); + connect(p,SIGNAL(clicked()),d->mdata,SLOT(collapseAll())); + hl->addStretch(1); + hl->addWidget(p=new QPushButton("Close"),0); + connect(p,SIGNAL(clicked()),this,SLOT(reject())); } MOrderAuditDialog::~MOrderAuditDialog() @@ -184,6 +198,7 @@ void MOrderAuditDialog::drawdata() } d->formula.setContext(0); } + d->mdata->expandAll(); for(int i=0;immodel->columnCount();i++) d->mdata->resizeColumnToContents(i); } -- 1.7.2.5