Qt Utilities
5.7.1
Common Qt related C++ classes and routines used by my applications such as dialogs, widgets and models
settingsdialog
optioncategory.cpp
Go to the documentation of this file.
1
#include "
./optioncategory.h
"
2
#include "
./optionpage.h
"
3
4
namespace
Dialogs
{
5
14
OptionCategory::OptionCategory
(QObject *parent)
15
: QObject(parent)
16
, m_currentIndex(0)
17
{
18
}
19
23
OptionCategory::~OptionCategory
()
24
{
25
qDeleteAll(m_pages);
26
}
27
32
bool
OptionCategory::applyAllPages
()
33
{
34
for
(
OptionPage
*page : m_pages) {
35
if
(!page->apply()) {
36
return
false
;
37
}
38
}
39
return
true
;
40
}
41
46
void
OptionCategory::resetAllPages
()
47
{
48
for
(
OptionPage
*page : m_pages) {
49
page->reset();
50
}
51
}
52
57
bool
OptionCategory::matches
(
const
QString &searchKeyWord)
const
58
{
59
for
(
OptionPage
*page : m_pages) {
60
if
(page->matches(searchKeyWord)) {
61
return
true
;
62
}
63
}
64
return
false
;
65
}
66
73
void
OptionCategory::assignPages
(
const
QList<OptionPage *>
pages
)
74
{
75
qDeleteAll(m_pages);
76
m_pages =
pages
;
77
emit
pagesChanged
();
78
}
79
94
}
optionpage.h
Dialogs::OptionPage
The OptionPage class is the base class for SettingsDialog pages.
Definition:
optionpage.h:15
Dialogs::OptionCategory::assignPages
void assignPages(const QList< OptionPage *> pages)
Assigns the specified pages to the category.
Definition:
optioncategory.cpp:73
optioncategory.h
Dialogs::OptionCategory::applyAllPages
bool applyAllPages()
Applies all pages.
Definition:
optioncategory.cpp:32
Dialogs
Provides common dialogs such as AboutDialog, EnterPasswordDialog and SettingsDialog.
Definition:
dialogutils.h:12
Dialogs::OptionCategory::resetAllPages
void resetAllPages()
Resets all pages.
Definition:
optioncategory.cpp:46
Dialogs::OptionCategory::pagesChanged
void pagesChanged()
Emitted when the pages changed.
Dialogs::OptionCategory::matches
bool matches(const QString &searchKeyWord) const
Returns whether the option category matches the specified searchKeyWord.
Definition:
optioncategory.cpp:57
Dialogs::OptionCategory::pages
const QList< OptionPage * > pages() const
Dialogs::OptionCategory::~OptionCategory
~OptionCategory()
Destroys the option category.
Definition:
optioncategory.cpp:23
Dialogs::OptionCategory::OptionCategory
OptionCategory(QObject *parent=nullptr)
Constructs a option category.
Definition:
optioncategory.cpp:14
Generated on Thu Jun 1 2017 14:14:42 for Qt Utilities by
1.8.13