Qt Utilities
5.6.0
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
22
OptionCategory::~OptionCategory
()
23
{
24
qDeleteAll(m_pages);
25
}
26
31
bool
OptionCategory::applyAllPages
()
32
{
33
for
(
OptionPage
*page : m_pages) {
34
if
(!page->apply()) {
35
return
false
;
36
}
37
}
38
return
true
;
39
}
40
45
void
OptionCategory::resetAllPages
()
46
{
47
for
(
OptionPage
*page : m_pages) {
48
page->reset();
49
}
50
}
51
55
bool
OptionCategory::matches
(
const
QString &searchKeyWord)
const
56
{
57
for
(
OptionPage
*page : m_pages) {
58
if
(page->matches(searchKeyWord)) {
59
return
true
;
60
}
61
}
62
return
false
;
63
}
64
71
void
OptionCategory::assignPages
(
const
QList<OptionPage *>
pages
)
72
{
73
qDeleteAll(m_pages);
74
m_pages =
pages
;
75
emit
pagesChanged
();
76
}
77
93
}
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:71
optioncategory.h
Dialogs::OptionCategory::applyAllPages
bool applyAllPages()
Applies all pages.
Definition:
optioncategory.cpp:31
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:45
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:55
Dialogs::OptionCategory::pages
const QList< OptionPage * > pages() const
Dialogs::OptionCategory::~OptionCategory
~OptionCategory()
Destroys the option category.
Definition:
optioncategory.cpp:22
Dialogs::OptionCategory::OptionCategory
OptionCategory(QObject *parent=nullptr)
Constructs a option category.
Definition:
optioncategory.cpp:14
Generated on Wed Mar 22 2017 04:03:21 for Qt Utilities by
1.8.13