-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
42 lines (34 loc) · 1.17 KB
/
mainwindow.cpp
File metadata and controls
42 lines (34 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
#include "mainwindow.h"
#include "./ui_mainwindow.h"
#include "component/componentmanager.h" // Use ComponentManager
#include "component/navigationcomponent.h"
#include "widget/menuwidget.h"
using namespace navigation;
void navigation::toMainWindow(NavigationComponent* navController, const QString& tag) {
auto window = new MainWindow(tag);
auto childNavigation = new NavigationComponent(navController);
auto entry = new navigation::NavigationEntry(navigation::WINDOW, window, childNavigation);
navController->enter(entry);
}
MainWindow::MainWindow(const QString &tag, QWidget *parent)
: BaseWindow(tag, parent)
, ui(new Ui::MainWindow)
{
ui->setupUi(this);
}
MainWindow::~MainWindow()
{
// m_navigationComponent is no longer owned by MainWindow
delete ui;
}
void MainWindow::reloadLocal() {
ui->retranslateUi(this);
}
void MainWindow::onCreate(navigation::NavigationArgs *args) {
BaseWindow::onCreate(args);
navigation::toHome(getChildNavigation(), new NavigationEntry(CHILD_IN_WINDOW, nullptr, nullptr, ui->mainStackedWidget));
}
void MainWindow::updateMenu()
{
ui->menuWidget->updateMenu();
}