Allow selecting a settings page programmatically
This commit is contained in:
parent
f81672885c
commit
ba16862d48
|
@ -201,6 +201,19 @@ void SettingsDialog::addHeadingWidget(QWidget *widget)
|
||||||
m_ui->headingLayout->addWidget(widget);
|
m_ui->headingLayout->addWidget(widget);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/*!
|
||||||
|
* \brief Selects the specified page within the specified category.
|
||||||
|
*/
|
||||||
|
void SettingsDialog::selectPage(int categoryIndex, int pageIndex)
|
||||||
|
{
|
||||||
|
m_categoryFilterModel->setFilterFixedString(QString());
|
||||||
|
m_ui->filterLineEdit->clear();
|
||||||
|
showCategory(m_categoryModel->category(categoryIndex));
|
||||||
|
m_ui->categoriesListView->selectionModel()->select(
|
||||||
|
m_categoryFilterModel->mapFromSource(m_categoryModel->index(categoryIndex)), QItemSelectionModel::ClearAndSelect);
|
||||||
|
m_ui->pagesTabWidget->setCurrentIndex(pageIndex);
|
||||||
|
}
|
||||||
|
|
||||||
/*!
|
/*!
|
||||||
* \brief Updates the tab widget to show the pages for the current category.
|
* \brief Updates the tab widget to show the pages for the current category.
|
||||||
*/
|
*/
|
||||||
|
|
|
@ -35,6 +35,7 @@ public:
|
||||||
QWidget *cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
|
QWidget *cornerWidget(Qt::Corner corner = Qt::TopRightCorner) const;
|
||||||
void setCornerWidget(QWidget *widget, Qt::Corner corner = Qt::TopRightCorner);
|
void setCornerWidget(QWidget *widget, Qt::Corner corner = Qt::TopRightCorner);
|
||||||
void addHeadingWidget(QWidget *widget);
|
void addHeadingWidget(QWidget *widget);
|
||||||
|
void selectPage(int categoryIndex, int pageIndex);
|
||||||
|
|
||||||
public Q_SLOTS:
|
public Q_SLOTS:
|
||||||
bool apply();
|
bool apply();
|
||||||
|
|
Loading…
Reference in New Issue