FOSSredder 0.5.0
Loading...
Searching...
No Matches
Navigation.cpp
Go to the documentation of this file.
1
5
7
8#include <QMetaObject>
9
10namespace ui {
11
12Navigation::Navigation(QObject* parent) : QObject(parent) {}
13
15 if (section_ == s)
16 return;
17 section_ = s;
18 if (sectionChangeQueued_)
19 return;
20 sectionChangeQueued_ = true;
21 QMetaObject::invokeMethod(
22 this,
23 [this]() {
24 sectionChangeQueued_ = false;
25 emit sectionChanged();
26 },
27 Qt::QueuedConnection);
28}
29
31 setSection(static_cast<Section>(value));
32}
33
37
39 if (settingsCategory_ == c)
40 return;
41 settingsCategory_ = c;
42 if (settingsCategoryChangeQueued_)
43 return;
44 settingsCategoryChangeQueued_ = true;
45 QMetaObject::invokeMethod(
46 this,
47 [this]() {
48 settingsCategoryChangeQueued_ = false;
50 },
51 Qt::QueuedConnection);
52}
53
55 setSettingsCategory(static_cast<SettingsCategory>(value));
56}
57
58} // namespace ui
Declarations for the UI Navigation component.
Q_INVOKABLE void setSectionValue(int value)
Sets the active shell section from QML.
Section section
Definition Navigation.h:18
Section
Top-level shell sections shown by the desktop UI.
Definition Navigation.h:35
void sectionChanged()
Emitted when the active shell section changes.
SettingsCategory
Settings page categories shown inside the settings section.
Definition Navigation.h:56
void setSettingsCategory(SettingsCategory c)
Sets the active settings category.
void setSection(Section s)
Sets the active shell section.
Q_INVOKABLE void navigateToSection(int section)
Navigates to a top-level shell section from QML.
Q_INVOKABLE void setSettingsCategoryValue(int value)
Sets the active settings category from QML.
Navigation(QObject *parent=nullptr)
Creates the navigation state.
void settingsCategoryChanged()
Emitted when the active settings category changes.