From f6b24c72d851e5ca728241b3d3fc81b9bc5b137d Mon Sep 17 00:00:00 2001 From: onil Date: Mon, 7 Dec 2009 15:23:10 +0000 Subject: [PATCH] git-svn-id: file:///svnroot/family-shop-mgr@2 26eb2498-383b-47a6-be48-5d6f36779e85 --- .../FamilyShoppingManagerStartView.cpp | 21 ++++ .../FamilyShoppingManagerStartView.h | 21 ++++ code/family-shop-mgr/ShoppingTreeItem.cpp | 33 ++++++ code/family-shop-mgr/ShoppingTreeItem.h | 53 +++++++++ code/family-shop-mgr/ShoppingTreeModel.cpp | 26 +++++ code/family-shop-mgr/ShoppingTreeModel.h | 36 ++++++ code/family-shop-mgr/family-shop-mgr.pro | 32 +++--- code/family-shop-mgr/family-shop-mgr.pro.user | 118 ++++++++++++-------- code/family-shop-mgr/main.cpp | 21 ++++ 9 files changed, 295 insertions(+), 66 deletions(-) create mode 100644 code/family-shop-mgr/ShoppingTreeItem.cpp create mode 100644 code/family-shop-mgr/ShoppingTreeItem.h create mode 100644 code/family-shop-mgr/ShoppingTreeModel.cpp create mode 100644 code/family-shop-mgr/ShoppingTreeModel.h diff --git a/code/family-shop-mgr/FamilyShoppingManagerStartView.cpp b/code/family-shop-mgr/FamilyShoppingManagerStartView.cpp index 8eaa951..b3d944d 100644 --- a/code/family-shop-mgr/FamilyShoppingManagerStartView.cpp +++ b/code/family-shop-mgr/FamilyShoppingManagerStartView.cpp @@ -1,3 +1,24 @@ +/* + * This file is part of family-shop-mgr. + * + * family-shop-mgr is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * family-shop-mgr is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with family-shop-mgr. If not, see . + * + * Author: Unai IRIGOYEN + * Date: 12/07/2009 + * + */ + #include "FamilyShoppingManagerStartView.h" #include "ui_FamilyShoppingManagerStartView.h" diff --git a/code/family-shop-mgr/FamilyShoppingManagerStartView.h b/code/family-shop-mgr/FamilyShoppingManagerStartView.h index 2ab84d9..168828f 100644 --- a/code/family-shop-mgr/FamilyShoppingManagerStartView.h +++ b/code/family-shop-mgr/FamilyShoppingManagerStartView.h @@ -1,3 +1,24 @@ +/* + * This file is part of family-shop-mgr. + * + * family-shop-mgr is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * family-shop-mgr is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with family-shop-mgr. If not, see . + * + * Author: Unai IRIGOYEN + * Date: 12/07/2009 + * + */ + #ifndef FAMILYSHOPPINGMANAGERSTARTVIEW_H #define FAMILYSHOPPINGMANAGERSTARTVIEW_H diff --git a/code/family-shop-mgr/ShoppingTreeItem.cpp b/code/family-shop-mgr/ShoppingTreeItem.cpp new file mode 100644 index 0000000..f81fa1d --- /dev/null +++ b/code/family-shop-mgr/ShoppingTreeItem.cpp @@ -0,0 +1,33 @@ +/* + * This file is part of family-shop-mgr. + * + * family-shop-mgr is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * family-shop-mgr is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with family-shop-mgr. If not, see . + * + * Author: Unai IRIGOYEN + * Date: 12/07/2009 + * + */ + +#include "ShoppingTreeItem.h" + +ShoppingTreeItem::ShoppingTreeItem(const QVector &data, TreeItem *parent) +{ + parentItem = parent; + itemData = data; +} + +ShoppingTreeItem::~ShoppingTreeItem() +{ + qDeleteAll(childItems); +} diff --git a/code/family-shop-mgr/ShoppingTreeItem.h b/code/family-shop-mgr/ShoppingTreeItem.h new file mode 100644 index 0000000..eb4faf7 --- /dev/null +++ b/code/family-shop-mgr/ShoppingTreeItem.h @@ -0,0 +1,53 @@ +/* + * This file is part of family-shop-mgr. + * + * family-shop-mgr is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * family-shop-mgr is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with family-shop-mgr. If not, see . + * + * Author: Unai IRIGOYEN + * Date: 12/07/2009 + * + */ + +#ifndef SHOPPINGTREEITEM_H +#define SHOPPINGTREEITEM_H + +#include +#include +#include + +class ShoppingTreeItem +{ +public: + ShoppingTreeItem(const QVector &data, TreeItem *parent = 0); + ShoppingTreeItem(); + + ShoppingTreeItem *child(int number); + int childCount() const; + int columnCount() const; + QVariant data(int column) const; + bool insertChildren(int position, int count, int columns); + bool insertColumns(int position, int columns); + TreeItem *parent(); + bool removeChildren(int position, int count); + bool removeColumns(int position, int columns); + int childNumber() const; + bool setData(int column, const QVariant &value); + +private: + QList childItems; + QVector itemData; + TreeItem *parentItem; +}; + +#endif // SHOPPINGTREEITEM_H diff --git a/code/family-shop-mgr/ShoppingTreeModel.cpp b/code/family-shop-mgr/ShoppingTreeModel.cpp new file mode 100644 index 0000000..2de033f --- /dev/null +++ b/code/family-shop-mgr/ShoppingTreeModel.cpp @@ -0,0 +1,26 @@ +/* + * This file is part of family-shop-mgr. + * + * family-shop-mgr is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * family-shop-mgr is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with family-shop-mgr. If not, see . + * + * Author: Unai IRIGOYEN + * Date: 12/07/2009 + * + */ + +#include "ShoppingTreeModel.h" + +ShoppingTreeModel::ShoppingTreeModel() +{ +} diff --git a/code/family-shop-mgr/ShoppingTreeModel.h b/code/family-shop-mgr/ShoppingTreeModel.h new file mode 100644 index 0000000..f985b59 --- /dev/null +++ b/code/family-shop-mgr/ShoppingTreeModel.h @@ -0,0 +1,36 @@ +/* + * This file is part of family-shop-mgr. + * + * family-shop-mgr is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * family-shop-mgr is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with family-shop-mgr. If not, see . + * + * Author: Unai IRIGOYEN + * Date: 12/07/2009 + * + */ + +#ifndef SHOPPINGTREEMODEL_H +#define SHOPPINGTREEMODEL_H + +#include + +class ShoppingTreeModel : public QAbstractItemModel +{ +public: + ShoppingTreeModel(); + +private: + QDomDocument m_document; +}; + +#endif // SHOPPINGTREEMODEL_H diff --git a/code/family-shop-mgr/family-shop-mgr.pro b/code/family-shop-mgr/family-shop-mgr.pro index d6aead9..36d9221 100644 --- a/code/family-shop-mgr/family-shop-mgr.pro +++ b/code/family-shop-mgr/family-shop-mgr.pro @@ -1,18 +1,14 @@ -#------------------------------------------------- -# -# Project created by QtCreator 2009-12-01T15:41:15 -# -#------------------------------------------------- - -QT += xml - -TARGET = family-shop-mgr -TEMPLATE = app - - -SOURCES += main.cpp\ - FamilyShoppingManagerStartView.cpp - -HEADERS += FamilyShoppingManagerStartView.h - -FORMS += FamilyShoppingManagerStartView.ui +# ------------------------------------------------- +# Project created by QtCreator 2009-12-01T15:41:15 +# ------------------------------------------------- +QT += xml +TARGET = family-shop-mgr +TEMPLATE = app +SOURCES += main.cpp \ + FamilyShoppingManagerStartView.cpp \ + ShoppingTreeModel.cpp \ + ShoppingTreeItem.cpp +HEADERS += FamilyShoppingManagerStartView.h \ + ShoppingTreeModel.h \ + ShoppingTreeItem.h +FORMS += FamilyShoppingManagerStartView.ui diff --git a/code/family-shop-mgr/family-shop-mgr.pro.user b/code/family-shop-mgr/family-shop-mgr.pro.user index bb1324b..1ba29f8 100644 --- a/code/family-shop-mgr/family-shop-mgr.pro.user +++ b/code/family-shop-mgr/family-shop-mgr.pro.user @@ -1,143 +1,165 @@ + RunConfiguration0-BaseEnvironmentBase + 2 + + RunConfiguration0-CommandLineArguments - + RunConfiguration0-ProFile - family-shop-mgr.pro + family-shop-mgr.pro RunConfiguration0-RunConfiguration.name - family-shop-mgr + family-shop-mgr RunConfiguration0-UseDyldImageSuffix - false + false RunConfiguration0-UseTerminal - false + false RunConfiguration0-UserEnvironmentChanges - + RunConfiguration0-UserSetName - false + false + + + RunConfiguration0-UserSetWorkingDirectory + false + + + RunConfiguration0-UserWorkingDirectory + RunConfiguration0-type - Qt4ProjectManager.Qt4RunConfiguration + Qt4ProjectManager.Qt4RunConfiguration activeRunConfiguration - 0 + 0 activebuildconfiguration - Debug + Debug buildConfiguration-Debug - - Debug - 0 + + Debug + 0 + 2 + + 2 buildConfiguration-Release - - Release - 0 + + Release + 0 + 2 + + 0 buildconfiguration-Debug-buildstep0 - - Debug - 2 + + Debug + buildconfiguration-Debug-buildstep1 - - Debug + + Debug buildconfiguration-Debug-cleanstep0 - - Debug + + Debug + true + + clean + buildconfiguration-Release-buildstep0 - - Release - 0 + + Release + buildconfiguration-Release-buildstep1 - - Release + + Release buildconfiguration-Release-cleanstep0 - - Release + + Release buildconfigurations - - Debug - Release + + Debug + Release buildstep0 - - - + + + buildstep1 - - + + buildsteps - - trolltech.qt4projectmanager.qmake - trolltech.qt4projectmanager.make + + trolltech.qt4projectmanager.qmake + trolltech.qt4projectmanager.make cleanstep0 - - - true + + + true cleansteps - - trolltech.qt4projectmanager.make + + trolltech.qt4projectmanager.make defaultFileEncoding - UTF-8 + UTF-8 project - + diff --git a/code/family-shop-mgr/main.cpp b/code/family-shop-mgr/main.cpp index d5c8811..6ff5808 100644 --- a/code/family-shop-mgr/main.cpp +++ b/code/family-shop-mgr/main.cpp @@ -1,3 +1,24 @@ +/* + * This file is part of family-shop-mgr. + * + * family-shop-mgr is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * family-shop-mgr is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with family-shop-mgr. If not, see . + * + * Author: Unai IRIGOYEN + * Date: 12/07/2009 + * + */ + #include #include "FamilyShoppingManagerStartView.h" -- 1.7.9.5