diff options
Diffstat (limited to 'src/libs/installer/componentmodel.h')
-rw-r--r-- | src/libs/installer/componentmodel.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/src/libs/installer/componentmodel.h b/src/libs/installer/componentmodel.h index f9fbae47a..c93dd60ae 100644 --- a/src/libs/installer/componentmodel.h +++ b/src/libs/installer/componentmodel.h @@ -1,6 +1,6 @@ /************************************************************************** ** -** Copyright (C) 2022 The Qt Company Ltd. +** Copyright (C) 2024 The Qt Company Ltd. ** Contact: https://www.qt.io/licensing/ ** ** This file is part of the Qt Installer Framework. @@ -31,6 +31,8 @@ #include "qinstallerglobal.h" +#include "component.h" + #include <QtCore/QAbstractItemModel> #include <QtCore/QList> #include <QtCore/QSet> @@ -38,7 +40,6 @@ namespace QInstaller { -class Component; class PackageManagerCore; class INSTALLER_EXPORT ComponentModel : public QAbstractItemModel @@ -49,6 +50,7 @@ class INSTALLER_EXPORT ComponentModel : public QAbstractItemModel public: enum ModelStateFlag { + Empty = -0x01, AllChecked = 0x01, AllUnchecked = 0x02, DefaultChecked = 0x04, @@ -78,6 +80,7 @@ public: QSet<Component *> partially() const; QSet<Component *> unchecked() const; QSet<Component *> uncheckable() const; + bool componentsSelected() const; PackageManagerCore *core() const; ComponentModel::ModelState checkedState() const; @@ -90,17 +93,16 @@ public Q_SLOTS: void setCheckedState(QInstaller::ComponentModel::ModelStateFlag state); Q_SIGNALS: - void componentsCheckStateChanged(const QList<QModelIndex> &indexes); - void modelCheckStateChanged(QInstaller::ComponentModel::ModelState state); + void checkStateChanged(QInstaller::ComponentModel::ModelState state); private Q_SLOTS: void onVirtualStateChanged(); private: void postModelReset(); - void updateModelState(); + void updateAndEmitModelState(); void collectComponents(Component *const component, const QModelIndex &parent) const; - QList<QModelIndex> updateCheckedState(const ComponentSet &components, const Qt::CheckState state); + QSet<QModelIndex> updateCheckedState(const ComponentSet &components, const Qt::CheckState state); private: PackageManagerCore *m_core; |