mirror of
https://gitee.com/spark-store-project/spark-store
synced 2025-12-14 12:52:04 +08:00
新增了SpkAppItem,更改style型对象名,修复侧边栏bug
This commit is contained in:
31
inc/spkappitem.h
Normal file
31
inc/spkappitem.h
Normal file
@@ -0,0 +1,31 @@
|
||||
|
||||
#pragma once
|
||||
|
||||
#include <QLabel>
|
||||
#include <QVBoxLayout>
|
||||
#include <QHBoxLayout>
|
||||
|
||||
class SpkAppItem : public QWidget
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
SpkAppItem(QWidget *parent = nullptr);
|
||||
|
||||
void SetIcon(QPixmap p) { mIcon->setPixmap(p); }
|
||||
void SetTitle(QString s) { mTitle->setText(s); }
|
||||
void SetDescription(QString s) { mDescription->setText(s); }
|
||||
|
||||
protected:
|
||||
void paintEvent(QPaintEvent *e);
|
||||
|
||||
private:
|
||||
QLabel *mIcon;
|
||||
QLabel *mTitle;
|
||||
QLabel *mDescription;
|
||||
|
||||
QVBoxLayout *mLayText;
|
||||
QHBoxLayout *mMainLay;
|
||||
|
||||
static constexpr int IconSize = 72;
|
||||
};
|
||||
|
||||
Reference in New Issue
Block a user