5 #include <QRadioButton> 22 m_parentWindow(parentWindow),
24 m_keywordsInitialized(false)
51 return m_widget.get();
60 if(searchKeyWord.isEmpty()) {
63 if(!m_keywordsInitialized) {
67 m_keywords << m_widget->windowTitle();
69 for(
const QLabel *label : m_widget->findChildren<QLabel *>())
70 m_keywords << label->text();
71 for(
const QCheckBox *checkbox : m_widget->findChildren<QCheckBox *>())
72 m_keywords << checkbox->text();
73 for(
const QRadioButton *checkbox : m_widget->findChildren<QRadioButton *>())
74 m_keywords << checkbox->text();
75 for(
const QPushButton *pushButton : m_widget->findChildren<QPushButton *>())
76 m_keywords << pushButton->text();
77 for(
const QGroupBox *groupBox : m_widget->findChildren<QGroupBox *>())
78 m_keywords << groupBox->title();
79 m_keywordsInitialized =
true;
81 for(
const QString &keyword : m_keywords)
82 if(keyword.contains(searchKeyWord, Qt::CaseInsensitive))
QWidget * widget()
Returns the widget for the option page.
bool matches(const QString &searchKeyWord)
Returns whether the pages matches the specified searchKeyWord.
virtual QWidget * setupWidget()=0
Creates the widget for the page.
Provides common dialogs such as AboutDialog, EnterPasswordDialog and SettingsDialog.
virtual void reset()=0
Discards altered settings and resets relevant widgets.
OptionPage(QWidget *parentWindow=nullptr)
Constructs a option page.
virtual ~OptionPage()
Destroys the option page.