buttons for order audit
authorkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Tue, 28 Dec 2010 12:00:49 +0000 (12:00 +0000)
committerkonrad <konrad@6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33>
Tue, 28 Dec 2010 12:00:49 +0000 (12:00 +0000)
git-svn-id: https://silmor.de/svn/softmagic/smoke/trunk@687 6e3c4bff-ac9f-4ac1-96c5-d2ea494d3e33

src/dialogs/orderauditdlg.cpp

index a8465a5..62e7f49 100644 (file)
 #include "orderauditdlg_p.h"
 
 #include "formula.h"
+#include "main.h"
 
 #include <QBoxLayout>
-#include <QDebug>
-#include <QStandardItemModel>
-#include <QTreeView>
 #include <QComboBox>
+#include <QDebug>
 #include <QDomDocument>
 #include <QDomElement>
 #include <QFile>
-#include <main.h>
+#include <QPushButton>
+#include <QStandardItemModel>
+#include <QTreeView>
 
 
 class MOAAuditList:public QList<MOAParcel>
@@ -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;i<d->mmodel->columnCount();i++)
                d->mdata->resizeColumnToContents(i);
 }