summaryrefslogtreecommitdiffstats
path: root/installerbuilder
diff options
context:
space:
mode:
authorkh1 <qt-info@nokia.com>2011-04-01 13:54:45 +0200
committerkh1 <qt-info@nokia.com>2011-04-01 13:54:45 +0200
commit4e5a483628ce1af16c3d934a04e40f9837e3c37f (patch)
treee3b328b0c80d187e92780c30e85c085cb0792f6c /installerbuilder
parent26c249d344610aa20ef38f2d143332d1c918b922 (diff)
Add slots to select/ deselect all components.
Diffstat (limited to 'installerbuilder')
-rw-r--r--installerbuilder/libinstaller/componentmodel.cpp14
-rw-r--r--installerbuilder/libinstaller/componentmodel.h4
2 files changed, 18 insertions, 0 deletions
diff --git a/installerbuilder/libinstaller/componentmodel.cpp b/installerbuilder/libinstaller/componentmodel.cpp
index 41ca3905c..94ec0a794 100644
--- a/installerbuilder/libinstaller/componentmodel.cpp
+++ b/installerbuilder/libinstaller/componentmodel.cpp
@@ -207,6 +207,20 @@ Component* ComponentModel::componentFromIndex(const QModelIndex &index) const
return m_rootComponent;
}
+// -- public slots
+
+void ComponentModel::selectAll()
+{
+ for (int i = 0; i < m_rootComponent->childCount(); ++i)
+ setData(index(i, 0, QModelIndex()), Qt::Checked, Qt::CheckStateRole);
+}
+
+void ComponentModel::deselectAll()
+{
+ for (int i = 0; i < m_rootComponent->childCount(); ++i)
+ setData(index(i, 0, QModelIndex()), Qt::Unchecked, Qt::CheckStateRole);
+}
+
// -- private slots
void ComponentModel::slotModelReset()
diff --git a/installerbuilder/libinstaller/componentmodel.h b/installerbuilder/libinstaller/componentmodel.h
index 2c0901b9e..d518623ce 100644
--- a/installerbuilder/libinstaller/componentmodel.h
+++ b/installerbuilder/libinstaller/componentmodel.h
@@ -67,6 +67,10 @@ public:
QModelIndex indexFromComponent(Component *component);
Component* componentFromIndex(const QModelIndex &index) const;
+public Q_SLOTS:
+ void selectAll();
+ void deselectAll();
+
Q_SIGNALS:
void checkStateChanged(const QModelIndex &index);