[prev in list] [next in list] [prev in thread] [next in thread]
List: kde-commits
Subject: [muon/newui] installer: QML-ify
From: Aleix Pol <aleixpol () kde ! org>
Date: 2012-02-01 4:34:34
Message-ID: 20120201043434.A10C2A60BE () git ! kde ! org
[Download RAW message or body]
Git commit c608a1b8d6324ec84d1c3a65b9474501678e9b03 by Aleix Pol.
Committed on 01/02/2012 at 05:29.
Pushed by apol into branch 'newui'.
QML-ify
added properties and improved introspecting information.
M +7 -2 installer/CategoryModel.cpp
M +1 -0 installer/CategoryModel.h
http://commits.kde.org/muon/c608a1b8d6324ec84d1c3a65b9474501678e9b03
diff --git a/installer/CategoryModel.cpp b/installer/CategoryModel.cpp
index 0983484..553cb34 100644
--- a/installer/CategoryModel.cpp
+++ b/installer/CategoryModel.cpp
@@ -26,7 +26,13 @@
CategoryModel::CategoryModel(QObject* parent)
: QStandardItemModel(parent)
-{}
+{
+ QHash< int, QByteArray > names = roleNames();
+ names[CategoryTypeRole] = "categoryType";
+ names[AndOrFilterRole] = "andOrFilter";
+ names[NotFilterRole] = "notFilter";
+ setRoleNames(names);
+}
CategoryModel::~CategoryModel()
{
@@ -38,7 +44,6 @@ void CategoryModel::setCategories(const QList<Category *> &categoryList,
{
qDeleteAll(m_categoryList);
m_categoryList = categoryList;
- qDebug() << "fuuuuuuuuu";
foreach (Category *category, m_categoryList) {
QStandardItem *categoryItem = new QStandardItem;
categoryItem->setText(category->name());
diff --git a/installer/CategoryModel.h b/installer/CategoryModel.h
index 80d3b46..90e95e9 100644
--- a/installer/CategoryModel.h
+++ b/installer/CategoryModel.h
@@ -43,6 +43,7 @@ class CategoryModel : public QStandardItemModel
/// A SubCategoryView
SubCatType = 2
};
+ Q_ENUMS(CatViewType);
explicit CategoryModel(QObject* parent = 0);
virtual ~CategoryModel();
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic