7 #include <QRadioButton>
23 : m_parentWindow(parentWindow)
25 , m_keywordsInitialized(false)
54 return m_widget.get();
63 if (searchKeyWord.isEmpty()) {
66 if (!m_keywordsInitialized) {
70 m_keywords << m_widget->windowTitle();
72 for (
const QLabel *label : m_widget->findChildren<QLabel *>())
73 m_keywords << label->text();
74 for (
const QCheckBox *checkbox : m_widget->findChildren<QCheckBox *>())
75 m_keywords << checkbox->text();
76 for (
const QRadioButton *checkbox : m_widget->findChildren<QRadioButton *>())
77 m_keywords << checkbox->text();
78 for (
const QPushButton *pushButton : m_widget->findChildren<QPushButton *>())
79 m_keywords << pushButton->text();
80 for (
const QGroupBox *groupBox : m_widget->findChildren<QGroupBox *>())
81 m_keywords << groupBox->title();
82 m_keywordsInitialized =
true;
84 for (
const QString &keyword : m_keywords)
85 if (keyword.contains(searchKeyWord, Qt::CaseInsensitive))
OptionPage(QWidget *parentWindow=nullptr)
Constructs a option page.
virtual void reset()=0
Discards altered settings and resets relevant widgets.
virtual QWidget * setupWidget()=0
Creates the widget for the page.
bool matches(const QString &searchKeyWord)
Returns whether the pages matches the specified searchKeyWord.
virtual ~OptionPage()
Destroys the option page.
QWidget * widget()
Returns the widget for the option page.