Extending Qt Creator Manual | IOptionsPage

Extending Qt Creator Manual 4.5.2

# IOptionsPage Class

(Core::IOptionsPage)

The IOptionsPage class is an interface for providing pages for the Options dialog (called Preferences on Mac OS). More...

Header: | #include <IOptionsPage>
Inherited By: | VcsBase::VcsBaseOptionsPage

- List of all members, including inherited members

## Public Functions

| IOptionsPage(QObject *parent = 0)
virtual | ~IOptionsPage()
virtual void | apply() = 0
Id | category() const
QIcon | categoryIcon() const
QString | displayCategory() const
QString | displayName() const
virtual void | finish() = 0
Id | id() const
virtual bool | matches(const QString &searchKeyWord) const
virtual QWidget * | widget() = 0

## Protected Functions

void | setCategory(Id category)
void | setCategoryIcon(const Utils::Icon &categoryIcon)
void | setDisplayCategory(const QString &displayCategory)
void | setDisplayName(const QString &displayName)
void | setId(Id id)

## Detailed Description

The IOptionsPage class is an interface for providing pages for the Options dialog (called Preferences on Mac OS).

## Member Function Documentation

### IOptionsPage::IOptionsPage(QObject *parent = 0)

Constructs an options page with the given parent.

### `[virtual]` IOptionsPage::~IOptionsPage()

Destroys the options page.

### `[pure virtual]` void IOptionsPage::apply()

This is called when selecting the Apply button on the options page dialog. It should detect whether any changes were made and store those.

### Id IOptionsPage::category() const

Returns the unique id for the category that the options page should be displayed in. This id is used for sorting the list on the left side of the Options dialog.

See also setCategory().

### QIcon IOptionsPage::categoryIcon() const

Returns the category icon of the options page. This icon is displayed in the list on the left side of the Options dialog.

See also setCategoryIcon().

### QString IOptionsPage::displayCategory() const

Returns the translated category name of the options page. This name is displayed in the list on the left side of the Options dialog.

See also setDisplayCategory().

### QString IOptionsPage::displayName() const

Returns the translated display name of the options page.

See also setDisplayName().

### `[pure virtual]` void IOptionsPage::finish()

Is called directly before the Options dialog closes. Here you should delete the widget that was created in widget() to free resources.

### Id IOptionsPage::id() const

Returns a unique identifier for referencing the options page.

See also setId().

### `[virtual]` bool IOptionsPage::matches(const QString &searchKeyWord) const

Is used by the Options dialog search filter to match searchKeyWord to this options page. This defaults to take the widget and then looks for all child labels, check boxes, push buttons, and group boxes. Should return `true` when a match is found.

### `[protected]` void IOptionsPage::setCategory(Id category)

Uses category to sort the options pages.

See also category().

### `[protected]` void IOptionsPage::setCategoryIcon(const Utils::Icon &categoryIcon)

See also categoryIcon().

### `[protected]` void IOptionsPage::setDisplayCategory(const QString &displayCategory)

Sets displayCategory as the display category of the options page.

See also displayCategory().

### `[protected]` void IOptionsPage::setDisplayName(const QString &displayName)

Sets displayName as the display name of the options page.

See also displayName().

### `[protected]` void IOptionsPage::setId(Id id)

Sets the id of the options page.

See also id().

### `[pure virtual]` QWidget *IOptionsPage::widget()

Returns the widget to show in the Options dialog. You should create a widget lazily here, and delete it again in the finish() method. This method can be called multiple times, so you should only create a new widget if the old one was deleted.