#include "mainwindow.h" #include "mediapanel.h" #include "planpanel.h" #include #include #include #include #include #include #include #include #include #include #include #include #include MainWindow::MainWindow() { resize(1280, 800); setWindowTitle("Compass"); setCorner(Qt::BottomRightCorner, Qt::RightDockWidgetArea); setCentralWidget(liveEditor = new LiveEditor); tabPorper = new QTabWidget; tabPorper->setMinimumWidth(360); tabPorper->setStyleSheet("QTabWidget::pane{border:none;}"); auto scroll = new QScrollArea; scroll->setFrameShape(QFrame::NoFrame); scroll->setHorizontalScrollBarPolicy(Qt::ScrollBarAlwaysOff); scroll->setWidgetResizable(true); tabPorper->addTab(scroll, tr("Properties")); auto mediapanel = new MediaPanel; tabPorper->addTab(mediapanel, tr("Library")); tabPorper->setCurrentIndex(1); auto dockProperties = new QDockWidget; dockProperties->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); dockProperties->setAllowedAreas(Qt::LeftDockWidgetArea | Qt::RightDockWidgetArea); dockProperties->setWidget(tabPorper); addDockWidget(Qt::RightDockWidgetArea, dockProperties); auto dockPlan = new QDockWidget(tr("Plan")); dockPlan->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); dockPlan->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); dockPlan->setWidget(new PlanPanel); addDockWidget(Qt::BottomDockWidgetArea, dockPlan); auto dockProgress = new QDockWidget(tr("Progress")); dockProgress->setFeatures(QDockWidget::DockWidgetMovable | QDockWidget::DockWidgetFloatable); dockProgress->setAllowedAreas(Qt::TopDockWidgetArea | Qt::BottomDockWidgetArea); //dockProgress->setWidget(dockWidgetContents); addDockWidget(Qt::BottomDockWidgetArea, dockProgress); splitDockWidget(dockPlan, dockProgress, Qt::Vertical); auto toolBar = new QToolBar; toolBar->setFloatable(false); toolBar->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); toolBar->setIconSize(QSize(46, 40)); auto action = new QAction(QIcon(":/res/program/Save.png"), tr("Save")); toolBar->addAction(action); action = new QAction(QIcon(":/res/program/Setting.png"), tr("Setting")); toolBar->addAction(action); toolBar->addSeparator(); }