SpkPageQssTest重命名为SpkPageUiTest

This commit is contained in:
RigoLigoRLC 2021-07-22 19:26:00 +08:00
parent 3eb2a0d63a
commit 4f0990293a
7 changed files with 25 additions and 19 deletions

View File

@ -62,7 +62,7 @@ set(SOURCE_FILES
inc/spkmsgbox.h gui/spkmsgbox.cpp
inc/spkdialog.h gui/spkdialog.cpp
inc/spkabout.h gui/spkabout.cpp
inc/spkpageqsstest.h gui/spkpageqsstest.cpp
inc/spkpageuitest.h gui/spkpageuitest.cpp
inc/spkloading.h gui/spkloading.cpp
inc/spksidebartree.h gui/spksidebartree.cpp
inc/spkpopup.h gui/spkpopup.cpp

View File

@ -1,9 +1,8 @@
#include <QEventLoop>
#include "spkdialog.h"
#include <QEventLoop>
SpkDialog::SpkDialog(QWidget *parent) :
SpkWindow(parent, Qt::Dialog)
SpkDialog::SpkDialog(QWidget *parent) : SpkWindow(parent, Qt::Dialog)
{
mDialogWidget = new QWidget;
mMainVLay = new QVBoxLayout(mDialogWidget);
@ -30,7 +29,7 @@ SpkDialog::~SpkDialog()
auto itp = mParentsList.begin();
for(auto itw = mWidgetsList.begin(); itw != mWidgetsList.end(); itw++)
{
(*itw)->setParent(*(itp++)); // We shall never take the ownership of these widgets
(*itw)->setParent(*(itp++));// We shall never take the ownership of these widgets
}
delete mDialogWidget;
}
@ -103,3 +102,8 @@ void SpkDialog::ForceClose()
disconnect(this, &SpkDialog::CloseWindow, this, &QMainWindow::close);
emit ExitEventLoop(-1);
}
void SpkDialog::SetMargin(int left, int top, int right, int bottom)
{
mWidgetsVLay->setContentsMargins(left, top, right, bottom);
}

View File

@ -170,7 +170,7 @@ SpkUi::SpkMainWidget::SpkMainWidget(QWidget *parent) : QFrame(parent)
HorizontalDivide->addLayout(VLayMain);
// Initialize pages
PageQssTest = new SpkUi::SpkPageQssTest(this);
PageQssTest = new SpkUi::SpkPageUiTest(this);
Pager->addWidget(PageQssTest);
setLayout(HorizontalDivide);

View File

@ -1,10 +1,10 @@
#include <QApplication>
#include "spkpageqsstest.h"
#include "spkpageuitest.h"
#include "spkpopup.h"
#include "spkui_general.h"
SpkUi::SpkPageQssTest::SpkPageQssTest(QWidget *parent) : QSplitter(parent)
SpkUi::SpkPageUiTest::SpkPageUiTest(QWidget *parent) : QSplitter(parent)
{
setObjectName("spk_pg_qsstest");
@ -15,12 +15,12 @@ SpkUi::SpkPageQssTest::SpkPageQssTest(QWidget *parent) : QSplitter(parent)
BtnApply = new QPushButton(this);
BtnApply->setObjectName("spk_pg_qsstest_btnapply");
BtnApply->setText("Apply");
connect(BtnApply, &QPushButton::pressed, this, &SpkPageQssTest::SetStylesheet);
connect(BtnApply, &QPushButton::pressed, this, &SpkPageUiTest::SetStylesheet);
BtnFetch = new QPushButton(this);
BtnFetch->setObjectName("spk_pg_qsstest_btnfetch");
BtnFetch->setText("Fetch Stylesheet");
connect(BtnFetch, &QPushButton::pressed, this, &SpkPageQssTest::FetchStylesheet);
connect(BtnFetch, &QPushButton::pressed, this, &SpkPageUiTest::FetchStylesheet);
HLayInputBtns = new QHBoxLayout;
HLayInputBtns->setObjectName("spk_pg_qsstest_hlay_inputbtns");
@ -49,7 +49,7 @@ SpkUi::SpkPageQssTest::SpkPageQssTest(QWidget *parent) : QSplitter(parent)
ShowPopup = new QPushButton(this);
ShowPopup->setText("Show Popup");
connect(ShowPopup, &QPushButton::clicked, this, &SpkPageQssTest::ShowPopupSlot);
connect(ShowPopup, &QPushButton::clicked, this, &SpkPageUiTest::ShowPopupSlot);
SlideV = new QSlider(this);
SlideV->setObjectName("spk_pg_qsstest_slider_v");
@ -104,17 +104,17 @@ SpkUi::SpkPageQssTest::SpkPageQssTest(QWidget *parent) : QSplitter(parent)
addWidget(WidR);
}
void SpkUi::SpkPageQssTest::SetStylesheet()
void SpkUi::SpkPageUiTest::SetStylesheet()
{
qApp->setStyleSheet(TextStylesheet->toPlainText());
}
void SpkUi::SpkPageQssTest::FetchStylesheet()
void SpkUi::SpkPageUiTest::FetchStylesheet()
{
TextStylesheet->setPlainText(SpkUi::CurrentStylesheet);
}
void SpkUi::SpkPageQssTest::ShowPopupSlot()
void SpkUi::SpkPageUiTest::ShowPopupSlot()
{
SpkUi::Popup->Show(PopupText->text());
}

View File

@ -18,6 +18,7 @@ class SpkDialog : public SpkWindow
void AddLayout(QLayout*);
void AddSpacing(int);
void SetMargin(int);
void SetMargin(int, int, int, int);
int Exec();
private slots:
@ -28,8 +29,9 @@ class SpkDialog : public SpkWindow
void ExitEventLoop(int);
void CloseWindow();
private:
protected:
QWidget *mDialogWidget;
private:
QVBoxLayout *mMainVLay, *mWidgetsVLay;
QHBoxLayout *mBtnLay;
QButtonGroup *mBtnGroup;

View File

@ -11,7 +11,7 @@
#include <QJsonObject>
#include "spksidebartree.h" // In place of #include <QTreeWidget>
#include <QPointer>
#include "spkpageqsstest.h"
#include "spkpageuitest.h"
class QNetworkReply;
@ -142,7 +142,7 @@ namespace SpkUi
QTreeWidgetItem *CategoryParentItem;
//Pages
SpkPageQssTest *PageQssTest;
SpkPageUiTest *PageQssTest;
};
}

View File

@ -16,11 +16,11 @@
namespace SpkUi
{
class SpkPageQssTest : public QSplitter
class SpkPageUiTest : public QSplitter
{
Q_OBJECT
public:
SpkPageQssTest(QWidget *parent = nullptr);
SpkPageUiTest(QWidget *parent = nullptr);
QWidget *WidL, *WidR;
QVBoxLayout *VLayWidgets,
*VLayBtn,