mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 04:42:03 +08:00
更换SpkWindow基类为QWidget并修复多个问题
修复mResizable为false时阻止窗口移动的问题 更改About窗口为固定大小
This commit is contained in:
@@ -17,6 +17,7 @@ class SpkDialog : public SpkWindow
|
||||
void AddWidget(QWidget*);
|
||||
void AddLayout(QLayout*);
|
||||
void AddSpacing(int);
|
||||
void AddStretch(int a = 0);
|
||||
void SetMargin(int);
|
||||
void SetMargin(int, int, int, int);
|
||||
int Exec();
|
||||
|
||||
@@ -50,7 +50,7 @@ class SpkTitleBar : public QWidget
|
||||
void SetTitle(QString t) { mTitle->setText(t); }
|
||||
QString GetTitle() { return mTitle->text(); }
|
||||
void SetUseIcon(bool t) { mIcon->setVisible(t); }
|
||||
void SetLinkedWindow(QMainWindow *w) { mLinkedWindow = w; }
|
||||
void SetLinkedWindow(SpkWindow *w) { mLinkedWindow = w; }
|
||||
|
||||
QHBoxLayout *GetUserSpace() { return mUserSpace; }
|
||||
protected:
|
||||
@@ -59,7 +59,7 @@ class SpkTitleBar : public QWidget
|
||||
private:
|
||||
QLabel *mIcon;
|
||||
QLabel *mTitle;
|
||||
QMainWindow *mLinkedWindow;
|
||||
SpkWindow *mLinkedWindow;
|
||||
QHBoxLayout *mMainLayout, *mUserSpace, *mBtnGroup;
|
||||
SpkTitleBarDefaultButton *mBtnMin, *mBtnMaxRestore, *mBtnClose;
|
||||
|
||||
|
||||
@@ -4,16 +4,16 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QMainWindow>
|
||||
#include <QFrame>
|
||||
#include <QHBoxLayout>
|
||||
#include <QVBoxLayout>
|
||||
#include <QPushButton>
|
||||
#include <QLabel>
|
||||
#include <QCloseEvent>
|
||||
#include "spktitlebar.h"
|
||||
|
||||
class SpkWindow : public QMainWindow
|
||||
class SpkTitleBar;
|
||||
|
||||
class SpkWindow : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@@ -21,7 +21,7 @@ class SpkWindow : public QMainWindow
|
||||
static constexpr int BorderWidth = 7;
|
||||
|
||||
private:
|
||||
QWidget *mCentralWidget, *mUserCentralWidget;
|
||||
QWidget *mUserCentralWidget;
|
||||
QVBoxLayout *mMainVLayout;
|
||||
SpkTitleBar *mTitleBarComponent;
|
||||
int mCornerRadius;
|
||||
@@ -32,7 +32,7 @@ class SpkWindow : public QMainWindow
|
||||
bool mUseCustomEvents;
|
||||
|
||||
public:
|
||||
SpkWindow(QWidget *parent = nullptr, Qt::WindowFlags flags = Qt::WindowFlags());
|
||||
SpkWindow(QWidget *parent = nullptr);
|
||||
~SpkWindow() override;
|
||||
void SetCentralWidget(QWidget *);
|
||||
bool GetUseTitleBar();
|
||||
@@ -62,4 +62,6 @@ class SpkWindow : public QMainWindow
|
||||
|
||||
private:
|
||||
void PopulateUi();
|
||||
|
||||
void paintWindowBorder();
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user