ComponentSelectionPage Class | Qt Installer Framework Manual

- Qt Installer Framework Manual
- ComponentSelectionPage

# ComponentSelectionPage Class

class QInstaller::ComponentSelectionPage

The ComponentSelectionPage class changes the checked state of components. More...

Header: | #include <ComponentSelectionPage>
Inherits: | QInstaller::PackageManagerPage

- List of all members, including inherited members

## Public Functions

| ComponentSelectionPage(QInstaller::PackageManagerCore *core)
virtual | ~ComponentSelectionPage()
bool | addVirtualComponentToUninstall(const QString &name)
void | deselectAll()
void | deselectComponent(const QString &id)
void | selectAll()
void | selectComponent(const QString &id)
void | selectDefault()

## Reimplemented Public Functions

virtual bool | isComplete() const override

## Reimplemented Protected Functions

virtual void | entering() override
virtual void | leaving() override
virtual void | showEvent(QShowEvent *event) override
virtual bool | validatePage() override

## Detailed Description

## Member Function Documentation

### `[explicit]` ComponentSelectionPage::ComponentSelectionPage(QInstaller::PackageManagerCore *core)

Constructs a component selection page with core as parent.

### `[virtual noexcept]` ComponentSelectionPage::~ComponentSelectionPage()

Destructs a component selection page.

### `[invokable]` bool ComponentSelectionPage::addVirtualComponentToUninstall(const QString &name)

Adds an additional virtual component with the name to be installed.

Returns `true` if the virtual component is found and not installed.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` void ComponentSelectionPage::deselectAll()

Deselects all components in the component tree.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` void ComponentSelectionPage::deselectComponent(const QString &id)

Deselects the component with id in the component tree.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[override virtual protected]` void ComponentSelectionPage::entering()

Reimplements: PackageManagerPage::entering().

Initializes the page's fields based on values from fields on previous pages. The text to display depends on whether the page is being used in an installer, updater, or uninstaller.

### `[override virtual]` bool ComponentSelectionPage::isComplete() const

Reimplements: PackageManagerPage::isComplete() const.

Returns `true` if at least one component is checked on the page.

### `[override virtual protected]` void ComponentSelectionPage::leaving()

Reimplements: PackageManagerPage::leaving().

Called when end users leave the page and the PackageManagerGui:currentPageChanged() signal is triggered.

### `[invokable]` void ComponentSelectionPage::selectAll()

Selects all components in the component tree.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` void ComponentSelectionPage::selectComponent(const QString &id)

Selects the component with id in the component tree.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[invokable]` void ComponentSelectionPage::selectDefault()

Selects the components that have the `<Default>` element set to `true` in the package information file.

Note: This function can be invoked via the meta-object system and from QML. See Q_INVOKABLE.

### `[override virtual protected]` void ComponentSelectionPage::showEvent(QShowEvent *event)

Called when the show event event occurs. Switching pages back and forth might restore or remove the checked state of certain components the end users have checked or not checked, because the dependencies are resolved and checked when clicking Next. So as not to confuse the end users with newly checked components they did not check, the state they left the page in is restored.

### `[override virtual protected]` bool ComponentSelectionPage::validatePage()

Reimplements: PackageManagerPage::validatePage().

Called when `ComponentSelectionPage` is validated. Tries to load `component` scripts for components about to be installed. Returns `true` if the script loading succeeded and the next page is shown.