diff --git a/src/sui.cpp b/src/sui.cpp index 5979319..9d39db7 100644 --- a/src/sui.cpp +++ b/src/sui.cpp @@ -16,7 +16,7 @@ sui::~sui() void sui::init_layout() { m_title=new sui_title(this); - m_title->set_title_txt(tr("XSteam")); + m_title->set_title(tr("XSteam")); setObjectName(tr("m_widget")); m_layout->addWidget(m_title); m_title->setMouseTracking(true); diff --git a/src/sui_title.cpp b/src/sui_title.cpp index db038e6..ae0af85 100644 --- a/src/sui_title.cpp +++ b/src/sui_title.cpp @@ -273,8 +273,9 @@ void sui_title::up_maximize() void sui_title::set_type(QD_TYPE _type) { m_type = _type; + disconnect(m_icon_button, SIGNAL(clicked(bool)), this, SLOT(slots_ico_menu())); } -void sui_title::set_title_txt(QString str) +void sui_title::set_title(QString str) { m_title_label->setText(str); } \ No newline at end of file diff --git a/src/sui_title.h b/src/sui_title.h index b88c1ea..4f77d7f 100644 --- a/src/sui_title.h +++ b/src/sui_title.h @@ -30,7 +30,7 @@ class sui_title: public QWidget public: explicit sui_title(QWidget *parent = nullptr); ~sui_title(); - void set_title_txt(QString str); + void set_title(QString str); void set_type(QD_TYPE _type); protected: //双击标题栏进行界面的最大化/还原 diff --git a/src/xsteam_about_ui.cpp b/src/xsteam_about_ui.cpp index 8e338cd..2245183 100644 --- a/src/xsteam_about_ui.cpp +++ b/src/xsteam_about_ui.cpp @@ -2,6 +2,7 @@ xsteam_about_ui::xsteam_about_ui() { + m_widget=new QWidget(); m_Layout = new QVBoxLayout(); f_Layout =new QHBoxLayout(); copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved.")); @@ -15,7 +16,8 @@ xsteam_about_ui::xsteam_about_ui() load_about(); setWindowTitle(tr("About XSteam")); m_Layout->setContentsMargins(0, 0, 0, 0); - setLayout(m_Layout); + m_widget->setLayout(m_Layout); + layout()->addWidget(m_widget); } xsteam_about_ui::~xsteam_about_ui() { diff --git a/src/xsteam_about_ui.h b/src/xsteam_about_ui.h index 91f5968..f3af99c 100644 --- a/src/xsteam_about_ui.h +++ b/src/xsteam_about_ui.h @@ -10,8 +10,8 @@ #include #include #include - -class xsteam_about_ui :public QDialog{ +#include "sui.h" +class xsteam_about_ui :public sui{ Q_OBJECT public: static xsteam_about_ui *Instance() @@ -23,6 +23,8 @@ public: if (!_instance) { _instance = new xsteam_about_ui(); + _instance->title()->set_type(QD_CLOSE); + _instance->title()->set_title(tr("XSteam关于")); } mutex.unlock(); } @@ -35,6 +37,7 @@ private: const xsteam_about_ui &operator=(const xsteam_about_ui &other); static xsteam_about_ui* _instance; static QMutex mutex; + QWidget* m_widget={}; QVBoxLayout* m_Layout={}; QHBoxLayout* f_Layout={}; QTextEdit* info={}; diff --git a/src/xsteam_set_ui.cpp b/src/xsteam_set_ui.cpp index c625313..0693627 100644 --- a/src/xsteam_set_ui.cpp +++ b/src/xsteam_set_ui.cpp @@ -10,7 +10,7 @@ xsteam_set_ui::~xsteam_set_ui() } void xsteam_set_ui::init_set() { - setWindowTitle(tr("XSteam设置")); + main_qwidget=new QWidget; main_layout = new QVBoxLayout; foot_layout = new QHBoxLayout; body_layout = new QVBoxLayout; @@ -72,8 +72,9 @@ void xsteam_set_ui::init_set() main_layout->addLayout(foot_layout); main_layout->setStretch(0, 8); main_layout->setStretch(1, 2); - main_layout->setContentsMargins(5, 5, 5, 5); - setLayout(main_layout); + main_layout->setContentsMargins(5, 5, 5, 5); + main_qwidget->setLayout(main_layout); + layout()->addWidget(main_qwidget); connect_slots(); } void xsteam_set_ui::connect_slots(){ diff --git a/src/xsteam_set_ui.h b/src/xsteam_set_ui.h index 287733a..8fb553b 100644 --- a/src/xsteam_set_ui.h +++ b/src/xsteam_set_ui.h @@ -1,7 +1,6 @@ #ifndef XSTEAM_SET_UI_H #define XSTEAM_SET_UI_H -#include #include #include #include @@ -15,7 +14,8 @@ #include #include "xsteam_base.h" #include "xsteam_ex.h" -class xsteam_set_ui :public QDialog{ +#include "sui.h" +class xsteam_set_ui :public sui{ Q_OBJECT public: static xsteam_set_ui *Instance() @@ -27,6 +27,8 @@ public: if (!_instance) { _instance = new xsteam_set_ui(); + _instance->title()->set_type(QD_CLOSE); + _instance->title()->set_title(tr("XSteam设置")); } mutex.unlock(); } @@ -41,6 +43,7 @@ private: static QMutex mutex; void init_set(); void connect_slots(); + QWidget* main_qwidget; QVBoxLayout* main_layout; QVBoxLayout* body_layout; QHBoxLayout* foot_layout; diff --git a/src/xsteam_src_edit_ui.h b/src/xsteam_src_edit_ui.h index 444108b..2c925e9 100644 --- a/src/xsteam_src_edit_ui.h +++ b/src/xsteam_src_edit_ui.h @@ -1,7 +1,6 @@ #ifndef XSTEAM_SRC_EDIT_UI_H #define XSTEAM_SRC_EDIT_UI_H -#include #include #include #include @@ -33,6 +32,7 @@ public: { _instance = new xsteam_src_edit_ui(); _instance->title()->set_type(QD_CLOSE); + _instance->title()->set_title(tr("XSteam源地址管理")); } mutex.unlock(); } diff --git a/src/xsteam_update_ui.cpp b/src/xsteam_update_ui.cpp index 7516cda..b7a7ee2 100644 --- a/src/xsteam_update_ui.cpp +++ b/src/xsteam_update_ui.cpp @@ -2,6 +2,7 @@ xsteam_update_ui::xsteam_update_ui() { + m_widget=new QWidget(); m_Layout = new QVBoxLayout(); f_Layout =new QHBoxLayout(); copyright_tips_txt=new QLabel(tr("Copyright © 2024 JackLee_CN. All rights reserved.")); @@ -15,7 +16,8 @@ xsteam_update_ui::xsteam_update_ui() load_about(); setWindowTitle(tr("About XSteam")); m_Layout->setContentsMargins(0, 0, 0, 0); - setLayout(m_Layout); + m_widget->setLayout(m_Layout); + layout()->addWidget(m_widget); } xsteam_update_ui::~xsteam_update_ui() { diff --git a/src/xsteam_update_ui.h b/src/xsteam_update_ui.h index 932cae2..95b334c 100644 --- a/src/xsteam_update_ui.h +++ b/src/xsteam_update_ui.h @@ -1,7 +1,6 @@ #ifndef XSTEAM_UPDATE_UI_H #define XSTEAM_UPDATE_UI_H -#include #include #include #include @@ -10,8 +9,8 @@ #include #include #include - -class xsteam_update_ui :public QDialog{ +#include "sui.h" +class xsteam_update_ui :public sui{ Q_OBJECT public: static xsteam_update_ui *Instance() @@ -23,6 +22,8 @@ public: if (!_instance) { _instance = new xsteam_update_ui(); + _instance->title()->set_type(QD_CLOSE); + _instance->title()->set_title(tr("XSteam更新")); } mutex.unlock(); } @@ -35,6 +36,7 @@ private: const xsteam_update_ui &operator=(const xsteam_update_ui &other); static xsteam_update_ui* _instance; static QMutex mutex; + QWidget* m_widget={}; QVBoxLayout* m_Layout={}; QHBoxLayout* f_Layout={}; QTextEdit* info={};