|
@@ -4,6 +4,7 @@
|
|
#include <QFramelessWindow.h>
|
|
#include <QFramelessWindow.h>
|
|
#include <TitleBar.h>
|
|
#include <TitleBar.h>
|
|
|
|
|
|
|
|
+#include <Navigation/NavigationInterface.h>
|
|
#include <Widgets/StackedWidget.h>
|
|
#include <Widgets/StackedWidget.h>
|
|
|
|
|
|
#include <QDebug>
|
|
#include <QDebug>
|
|
@@ -40,17 +41,47 @@ void StackedWidget::setCurrentIndex(int index, bool popOut) {
|
|
PopUpAniStackedWidget *StackedWidget::view() const { return m_view; }
|
|
PopUpAniStackedWidget *StackedWidget::view() const { return m_view; }
|
|
|
|
|
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|
- QFramelessHelper *helper = new QFramelessHelper(this);
|
|
|
|
- StandardTitleBar *titleBar = new StandardTitleBar(this);
|
|
|
|
- helper->setTitleBar(titleBar);
|
|
|
|
|
|
+ initWindow();
|
|
|
|
+ initLayout();
|
|
|
|
+}
|
|
|
|
|
|
- setMinimumSize(QSize(800, 600));
|
|
|
|
|
|
+MainWindow::~MainWindow() {}
|
|
|
|
+
|
|
|
|
+void MainWindow::initWindow() {
|
|
|
|
+
|
|
|
|
+ QWidget *w = new QWidget();
|
|
|
|
+ m_hBoxLayout = new QHBoxLayout(w);
|
|
|
|
+ setCentralWidget(w);
|
|
|
|
+
|
|
|
|
+ m_widgetLayout = new QHBoxLayout();
|
|
|
|
+ m_stackWidget = new StackedWidget(this);
|
|
|
|
+ m_navigationInterface = new NavigationInterface(true, true, this);
|
|
|
|
+
|
|
|
|
+ QFramelessHelper *helper = new QFramelessHelper(this);
|
|
|
|
+ m_titleBar = new StandardTitleBar(this);
|
|
|
|
+ m_titleBar->setGeometry(QRect(46, 0, width() - 46, m_titleBar->height()));
|
|
|
|
+ helper->setTitleBar(m_titleBar);
|
|
|
|
|
|
QIcon icon = QIcon(":/resource/logo.png");
|
|
QIcon icon = QIcon(":/resource/logo.png");
|
|
setWindowIcon(icon);
|
|
setWindowIcon(icon);
|
|
- titleBar->setIcon(icon);
|
|
|
|
|
|
+ m_titleBar->setIcon(icon);
|
|
|
|
|
|
setWindowTitle("专家评定数据分析软件");
|
|
setWindowTitle("专家评定数据分析软件");
|
|
|
|
+ setMinimumSize(QSize(800, 600));
|
|
}
|
|
}
|
|
|
|
|
|
-MainWindow::~MainWindow() {}
|
|
|
|
|
|
+void MainWindow::initLayout() {
|
|
|
|
+ m_hBoxLayout->setSpacing(0);
|
|
|
|
+ m_hBoxLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
|
+ m_hBoxLayout->addWidget(m_navigationInterface);
|
|
|
|
+ m_hBoxLayout->addLayout(m_widgetLayout);
|
|
|
|
+ m_hBoxLayout->setStretchFactor(m_widgetLayout, 1);
|
|
|
|
+
|
|
|
|
+ m_widgetLayout->addWidget(m_stackWidget);
|
|
|
|
+ m_widgetLayout->setContentsMargins(0, 32, 0, 0);
|
|
|
|
+}
|
|
|
|
+
|
|
|
|
+void MainWindow::resizeEvent(QResizeEvent *event) {
|
|
|
|
+ m_navigationInterface->resize(m_navigationInterface->width(), height());
|
|
|
|
+ m_titleBar->resize(width() - 46, m_titleBar->height());
|
|
|
|
+}
|