|
@@ -0,0 +1,56 @@
|
|
|
+#include "MainWindow.h"
|
|
|
+
|
|
|
+#include <DateTime/DatePicker.h>
|
|
|
+#include <QFramelessWindow.h>
|
|
|
+#include <TitleBar.h>
|
|
|
+
|
|
|
+#include <Widgets/StackedWidget.h>
|
|
|
+
|
|
|
+#include <QDebug>
|
|
|
+
|
|
|
+StackedWidget::StackedWidget(QWidget *parent) : QFrame(parent) {
|
|
|
+ m_hBoxLayout = new QHBoxLayout(this);
|
|
|
+ m_view = new PopUpAniStackedWidget(this);
|
|
|
+
|
|
|
+ m_hBoxLayout->setContentsMargins(0, 0, 0, 0);
|
|
|
+ m_hBoxLayout->addWidget(m_view);
|
|
|
+
|
|
|
+ connect(
|
|
|
+ m_view, &PopUpAniStackedWidget::currentChanged, this,
|
|
|
+ [this](int index) { emit currentWidgetChanged(m_view->widget(index)); });
|
|
|
+}
|
|
|
+
|
|
|
+void StackedWidget::addWidget(QWidget *widget) { m_view->addWidget(widget); }
|
|
|
+
|
|
|
+///
|
|
|
+/// @todo widget.verticalScrollBar().setValue(0)
|
|
|
+///
|
|
|
+void StackedWidget::setCurrentWidget(QWidget *widget, bool popOut) {
|
|
|
+ if (popOut) {
|
|
|
+ m_view->setCurrentWidget(widget, true, false, 200, QEasingCurve::InQuad);
|
|
|
+ } else {
|
|
|
+ m_view->setCurrentWidget(widget, false, true, 300);
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
+void StackedWidget::setCurrentIndex(int index, bool popOut) {
|
|
|
+ setCurrentWidget(m_view->widget(index), popOut);
|
|
|
+}
|
|
|
+
|
|
|
+PopUpAniStackedWidget *StackedWidget::view() const { return m_view; }
|
|
|
+
|
|
|
+MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) {
|
|
|
+ QFramelessHelper *helper = new QFramelessHelper(this);
|
|
|
+ StandardTitleBar *titleBar = new StandardTitleBar(this);
|
|
|
+ helper->setTitleBar(titleBar);
|
|
|
+
|
|
|
+ setMinimumSize(QSize(800, 600));
|
|
|
+
|
|
|
+ QIcon icon = QIcon(":/resource/logo.png");
|
|
|
+ setWindowIcon(icon);
|
|
|
+ titleBar->setIcon(icon);
|
|
|
+
|
|
|
+ setWindowTitle("专家评定数据分析软件");
|
|
|
+}
|
|
|
+
|
|
|
+MainWindow::~MainWindow() {}
|