summaryrefslogtreecommitdiffstats
path: root/installerbuilder
diff options
context:
space:
mode:
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);