git-svn-id: file:///svnroot/family-shop-mgr@14 26eb2498-383b-47a6-be48-5d6f36779e85
[family-shop-mgr] / code / family-shop-mgr / GoShoppingView.cpp
index e841f7d..5304afa 100644 (file)
 #include "GoShoppingView.h"\r
 #include "ui_GoShopping.h"\r
 \r
-GoShoppingView::GoShoppingView(QWidget *parent)\r
-    :QWidget(parent), ui(new Ui::GoShoppingView)\r
+#include "ShoppingTreeModel.h"\r
+\r
+GoShoppingView::GoShoppingView(QString xmlFileName, QWidget *parent)\r
+    :QDialog(parent), ui(new Ui::GoShoppingView)\r
 {\r
     ui->setupUi(this);\r
+    ShoppingTreeModel *model = new ShoppingTreeModel(xmlFileName, this);\r
+    ui->treeView->setModel(model);\r
+    for(int column = 0; column < model->columnCount(); column++)\r
+        ui->treeView->resizeColumnToContents(column);\r
 }\r
 \r
 GoShoppingView::~GoShoppingView()\r