From a134d4b24b67615b13cf961bb1bcad7f439fe98b Mon Sep 17 00:00:00 2001 From: zhoubin Date: Thu, 21 Nov 2024 19:50:09 +0800 Subject: [PATCH] fix: option MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Description: 292745 【设置】选项中没有意见反馈功能项 Log: 292745 【设置】选项中没有意见反馈功能项 Signed-off-by: zhoubin --- shell/mainwindow.cpp | 17 +++++++---------- shell/mainwindow.h | 3 ++- 2 files changed, 9 insertions(+), 11 deletions(-) diff --git a/shell/mainwindow.cpp b/shell/mainwindow.cpp index 859dc00..5ba4b28 100644 --- a/shell/mainwindow.cpp +++ b/shell/mainwindow.cpp @@ -451,7 +451,7 @@ void MainWindow::initTileBar() { backBtn = new QPushButton(this); backBtn->setObjectName("go-home"); backBtn->setToolTip(tr("Back home")); - mOptionBtn = new QToolButton(this); + mOptionBtn = new KMenuButton(this); minBtn = new QPushButton(this); maxBtn = new QPushButton(this); closeBtn = new QPushButton(this); @@ -575,16 +575,13 @@ void MainWindow::onF1ButtonClicked() { void MainWindow::initUkccAbout() { mOptionBtn->setPopupMode(QToolButton::InstantPopup); - QMenu* ukccMain = new QMenu(this); - ukccMain->setObjectName("mainMenu"); - mOptionBtn->setMenu(ukccMain); - QAction* ukccHelp = new QAction(tr("Help"),this); - ukccMain->addAction(ukccHelp); - QAction* ukccAbout = new QAction(tr("About"),this); - ukccMain->addAction(ukccAbout); - QAction* ukccExit = new QAction(tr("Exit"),this); - ukccMain->addAction(ukccExit); + QAction* ukccHelp = mOptionBtn->assistAction(); + QAction* ukccAbout = mOptionBtn->aboutAction(); + QAction* ukccExit = mOptionBtn->quitAction(); + + mOptionBtn->themeAction()->setVisible(false); + mOptionBtn->settingAction()->setVisible(false); connect(ukccExit, SIGNAL(triggered()), this, SLOT(close())); diff --git a/shell/mainwindow.h b/shell/mainwindow.h index eedd903..e1d7f61 100644 --- a/shell/mainwindow.h +++ b/shell/mainwindow.h @@ -34,6 +34,7 @@ #include #include #include +#include #include "kaboutdialog.h" #include "interface.h" @@ -92,7 +93,7 @@ private: SearchWidget * m_searchWidget; QPushButton *backBtn; - QToolButton *mOptionBtn; + KMenuButton *mOptionBtn; QPushButton *minBtn; QPushButton *maxBtn; QPushButton *closeBtn;