From 526f33ceba3a79831d0912ec615732558d2f172e Mon Sep 17 00:00:00 2001 From: wuyize Date: Tue, 7 Mar 2023 20:27:58 +0800 Subject: [PATCH] =?UTF-8?q?=E4=B8=BB=E5=AF=BC=E8=88=AA=E6=94=B9=E7=94=A8St?= =?UTF-8?q?ackedWidget?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .../ArchitectureColoredPainting.vcxproj | 2 +- ...rchitectureColoredPainting.vcxproj.filters | 2 +- ArchitectureColoredPainting/MainWindow.ui | 68 +++---------------- .../{ => src/Editor}/ElementPoolWidget.cpp | 0 .../src/MainWindow.cpp | 13 ++-- 5 files changed, 17 insertions(+), 68 deletions(-) rename ArchitectureColoredPainting/{ => src/Editor}/ElementPoolWidget.cpp (100%) diff --git a/ArchitectureColoredPainting/ArchitectureColoredPainting.vcxproj b/ArchitectureColoredPainting/ArchitectureColoredPainting.vcxproj index 368ffbe..5082e4f 100644 --- a/ArchitectureColoredPainting/ArchitectureColoredPainting.vcxproj +++ b/ArchitectureColoredPainting/ArchitectureColoredPainting.vcxproj @@ -104,10 +104,10 @@ - + diff --git a/ArchitectureColoredPainting/ArchitectureColoredPainting.vcxproj.filters b/ArchitectureColoredPainting/ArchitectureColoredPainting.vcxproj.filters index 3aed4a1..92d4cef 100644 --- a/ArchitectureColoredPainting/ArchitectureColoredPainting.vcxproj.filters +++ b/ArchitectureColoredPainting/ArchitectureColoredPainting.vcxproj.filters @@ -207,7 +207,7 @@ Source Files\Editor - + Source Files\Editor diff --git a/ArchitectureColoredPainting/MainWindow.ui b/ArchitectureColoredPainting/MainWindow.ui index f661869..101be92 100644 --- a/ArchitectureColoredPainting/MainWindow.ui +++ b/ArchitectureColoredPainting/MainWindow.ui @@ -40,66 +40,20 @@ 0 - - - 0 - + QLayout::SetDefaultConstraint - - - - - Segoe UI, Microsoft YaHei UI - 10 - 50 - false - false - - - - - QTabBar::tab { - height: 0px; - margin-top:0px; - } - QTabWidget::tab-bar - { - height: 0px; - top:0px; - } - QTabWidget::pane { - border: 0px; - background-color: transparent; - } - - - - QTabWidget::North - - - QTabWidget::Rounded - - - 0 - - - Qt::ElideNone - - - false - - - - 纹理编辑 - - - - - 场景渲染 - - + + 0 + + + 0 + + + + + diff --git a/ArchitectureColoredPainting/ElementPoolWidget.cpp b/ArchitectureColoredPainting/src/Editor/ElementPoolWidget.cpp similarity index 100% rename from ArchitectureColoredPainting/ElementPoolWidget.cpp rename to ArchitectureColoredPainting/src/Editor/ElementPoolWidget.cpp diff --git a/ArchitectureColoredPainting/src/MainWindow.cpp b/ArchitectureColoredPainting/src/MainWindow.cpp index f671133..505f1dd 100644 --- a/ArchitectureColoredPainting/src/MainWindow.cpp +++ b/ArchitectureColoredPainting/src/MainWindow.cpp @@ -15,14 +15,9 @@ CentralWidget::CentralWidget(QWidget* parent) : QMainWindow(parent) { ui.setupUi(this); NavigationBarWidget* navigationBarWidget = new NavigationBarWidget(); - - QHBoxLayout* tabBarLayout = new QHBoxLayout(ui.tabWidget); - tabBarLayout->setSpacing(0); - tabBarLayout->setMargin(0); - tabBarLayout->addWidget(navigationBarWidget, 0, Qt::AlignTop | Qt::AlignHCenter); - - QObject::connect(navigationBarWidget->tabs, &QtMaterialTabs::currentChanged, ui.tabWidget, &QTabWidget::setCurrentIndex); - QObject::connect(ui.tabWidget, &QTabWidget::currentChanged, + ui.gridLayout->addWidget(navigationBarWidget, 0, 0, 1, 1, Qt::AlignTop | Qt::AlignHCenter); + QObject::connect(navigationBarWidget->tabs, &QtMaterialTabs::currentChanged, ui.stackedWidget, &QStackedWidget::setCurrentIndex); + QObject::connect(ui.stackedWidget, &QStackedWidget::currentChanged, ui.rendererWidget, &Renderer::RendererWidget::currentTabChanged); } @@ -41,7 +36,7 @@ MainWindow::MainWindow(QWidget* parent, const Qt::WindowFlags flags) m_titleBar->maximizeButton()->setFixedHeight(kTitleBarHeight); m_titleBar->closeButton()->setFixedHeight(kTitleBarHeight); m_titleBar->setTitleFont(QFont(QString("Segoe UI, Microsoft YaHei UI"), 10)); - m_titleBar->chromePalette()->setTitleBarActiveBackgroundColor(QColor(0,0,0,0)); + m_titleBar->chromePalette()->setTitleBarActiveBackgroundColor(QColor(0, 0, 0, 0)); m_titleBar->chromePalette()->setTitleBarInactiveBackgroundColor(QColor(0, 0, 0, 0)); m_central_widget = new CentralWidget();