mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 04:42:03 +08:00
实现应用列表和SpkResource
SpkResource现有已知问题:首次使用不会完全进行所有任务。
This commit is contained in:
38
inc/page/spkpageapplist.h
Normal file
38
inc/page/spkpageapplist.h
Normal file
@@ -0,0 +1,38 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <QList>
|
||||
#include "spkresource.h"
|
||||
#include "spkappitem.h"
|
||||
#include "page/spkpagebase.h"
|
||||
#include "spkstretchlayout.h"
|
||||
|
||||
namespace SpkUi
|
||||
{
|
||||
class SpkPageAppList : public SpkPageBase
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkPageAppList(QWidget *parent = nullptr);
|
||||
|
||||
void AddApplicationEntry(QString name, QString pkgName, QString description, QString iconUrl,
|
||||
int appId);
|
||||
void ClearAll();
|
||||
|
||||
private:
|
||||
|
||||
public:
|
||||
|
||||
private:
|
||||
SpkStretchLayout *mItemLay;
|
||||
QList<SpkAppItem *> mAppItemList;
|
||||
|
||||
signals:
|
||||
void ApplicationClicked(QString name, QString pkgName);
|
||||
|
||||
public slots:
|
||||
void ResourceAcquisitionFinished(int id, ResourceResult result);
|
||||
void Activated();
|
||||
};
|
||||
}
|
||||
27
inc/page/spkpagebase.h
Normal file
27
inc/page/spkpagebase.h
Normal file
@@ -0,0 +1,27 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QScrollArea>
|
||||
#include <spkresource.h>
|
||||
|
||||
class SpkPageBase : public QScrollArea
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkPageBase(QWidget *parent = nullptr);
|
||||
|
||||
public slots:
|
||||
/**
|
||||
* @brief This signal is emitted by resource manager when a resource acquisition requested
|
||||
* has finished.
|
||||
* @param id The request ID
|
||||
* @param result The data retrieved
|
||||
*/
|
||||
virtual void ResourceAcquisitionFinished(int id, ResourceResult result);
|
||||
|
||||
/**
|
||||
* @brief This is an optional signal for Resource Context objects, mainly used for notifying the
|
||||
* context that it is now activated (therefore it needs to acquire the resource manager).
|
||||
*/
|
||||
virtual void Activated();
|
||||
};
|
||||
53
inc/page/spkpageuitest.h
Normal file
53
inc/page/spkpageuitest.h
Normal file
@@ -0,0 +1,53 @@
|
||||
#pragma once
|
||||
|
||||
#include <QWidget>
|
||||
#include <QSplitter>
|
||||
#include <QPushButton>
|
||||
#include <QRadioButton>
|
||||
#include <QCheckBox>
|
||||
#include <QGroupBox>
|
||||
#include <QTextEdit>
|
||||
#include <QLineEdit>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
#include <QSlider>
|
||||
#include "spkappitem.h"
|
||||
|
||||
#include "spkloading.h"
|
||||
|
||||
namespace SpkUi
|
||||
{
|
||||
class SpkPageUiTest : public QSplitter
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkPageUiTest(QWidget *parent = nullptr);
|
||||
QWidget *WidL, *WidR;
|
||||
QVBoxLayout *VLayWidgets,
|
||||
*VLayTestWidgets,
|
||||
*VLayInput;
|
||||
QHBoxLayout *HLay4Slider,
|
||||
*HLayInputBtns;
|
||||
QTextEdit *TextStylesheet;
|
||||
QPushButton *BtnApply;
|
||||
QPushButton *BtnFetch;
|
||||
|
||||
QPushButton *Btn;
|
||||
QCheckBox *Chk;
|
||||
QRadioButton *Rad;
|
||||
QGroupBox *Group;
|
||||
QSlider *SlideH;
|
||||
QSlider *SlideV;
|
||||
SpkLoading *Loading;
|
||||
SpkAppItem *AppItem;
|
||||
|
||||
QLineEdit *PopupText;
|
||||
QPushButton *ShowPopup,
|
||||
*ShowAbout;
|
||||
|
||||
public slots:
|
||||
void SetStylesheet();
|
||||
void FetchStylesheet();
|
||||
void ShowPopupSlot();
|
||||
};
|
||||
}
|
||||
Reference in New Issue
Block a user