forked from Liniyous/ElaWidgetTools
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathT_Card.cpp
More file actions
83 lines (70 loc) · 3.22 KB
/
T_Card.cpp
File metadata and controls
83 lines (70 loc) · 3.22 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
#include "T_Card.h"
#include <QVBoxLayout>
#include "ElaLCDNumber.h"
#include "ElaPromotionCard.h"
#include "ElaPromotionView.h"
T_Card::T_Card(QWidget* parent)
: T_BasePage(parent)
{
// 预览窗口标题
setWindowTitle("ElaCard");
// 顶部元素
createCustomWidget("一些常用的卡片组件被放置于此,可在此界面体验其效果并按需添加进项目中");
_lcdNumber = new ElaLCDNumber(this);
_lcdNumber->setIsUseAutoClock(true);
_lcdNumber->setIsTransparent(false);
// _lcdNumber->setAutoClockFormat("hh:mm:ss");
_lcdNumber->setFixedHeight(100);
_promotionCard = new ElaPromotionCard(this);
_promotionCard->setFixedSize(600, 300);
_promotionCard->setCardPixmap(QPixmap(":/Resource/Image/Card/miku.png"));
_promotionCard->setCardTitle("MiKu");
_promotionCard->setPromotionTitle("SONG~");
_promotionCard->setTitle("STYX HELIX");
_promotionCard->setSubTitle("Never close your eyes, Searching for a true fate");
_promotionView = new ElaPromotionView(this);
ElaPromotionCard* exampleCard1 = new ElaPromotionCard(this);
exampleCard1->setCardPixmap(QPixmap(":/Resource/Image/Card/miku.png"));
exampleCard1->setCardTitle("MiKu");
exampleCard1->setPromotionTitle("SONG~");
exampleCard1->setTitle("STYX HELIX");
exampleCard1->setSubTitle("Never close your eyes, Searching for a true fate");
ElaPromotionCard* exampleCard2 = new ElaPromotionCard(this);
exampleCard2->setCardPixmap(QPixmap(":/Resource/Image/Card/beach.png"));
exampleCard2->setCardTitle("Beach");
exampleCard2->setPromotionTitle("SONG~");
exampleCard2->setTitle("STYX HELIX");
exampleCard2->setSubTitle("Never close your eyes, Searching for a true fate");
ElaPromotionCard* exampleCard3 = new ElaPromotionCard(this);
exampleCard3->setCardPixmap(QPixmap(":/Resource/Image/Card/dream.png"));
exampleCard3->setCardTitle("Dream");
exampleCard3->setPromotionTitle("SONG~");
exampleCard3->setTitle("STYX HELIX");
exampleCard3->setSubTitle("Never close your eyes, Searching for a true fate");
ElaPromotionCard* exampleCard4 = new ElaPromotionCard(this);
exampleCard4->setCardPixmap(QPixmap(":/Resource/Image/Card/classroom.png"));
exampleCard4->setCardTitle("Classroom");
exampleCard4->setPromotionTitle("SONG~");
exampleCard4->setTitle("STYX HELIX");
exampleCard4->setSubTitle("Never close your eyes, Searching for a true fate");
_promotionView->appendPromotionCard(exampleCard1);
_promotionView->appendPromotionCard(exampleCard2);
_promotionView->appendPromotionCard(exampleCard3);
_promotionView->appendPromotionCard(exampleCard4);
_promotionView->setIsAutoScroll(true);
QWidget* centralWidget = new QWidget(this);
centralWidget->setWindowTitle("ElaCard");
QVBoxLayout* centerLayout = new QVBoxLayout(centralWidget);
centerLayout->setContentsMargins(0, 0, 0, 0);
centerLayout->addWidget(_lcdNumber);
centerLayout->addSpacing(20);
centerLayout->addWidget(_promotionCard);
centerLayout->addSpacing(20);
centerLayout->addWidget(_promotionView);
centerLayout->addSpacing(100);
centerLayout->addStretch();
addCentralWidget(centralWidget, true, true, 0);
}
T_Card::~T_Card()
{
}