MCPcopy Create free account
hub / github.com/Liniyous/ElaWidgetTools / T_Card

Method T_Card

ElaWidgetToolsExample/ExamplePage/T_Card.cpp:8–79  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

6#include "ElaPromotionCard.h"
7#include "ElaPromotionView.h"
8T_Card::T_Card(QWidget* parent)
9 : T_BasePage(parent)
10{
11 // 预览窗口标题
12 setWindowTitle("ElaCard");
13
14 // 顶部元素
15 createCustomWidget("一些常用的卡片组件被放置于此,可在此界面体验其效果并按需添加进项目中");
16
17 _lcdNumber = new ElaLCDNumber(this);
18 _lcdNumber->setIsUseAutoClock(true);
19 _lcdNumber->setIsTransparent(false);
20 // _lcdNumber->setAutoClockFormat("hh:mm:ss");
21 _lcdNumber->setFixedHeight(100);
22
23 _promotionCard = new ElaPromotionCard(this);
24 _promotionCard->setFixedSize(600, 300);
25 _promotionCard->setCardPixmap(QPixmap(":/Resource/Image/Card/miku.png"));
26 _promotionCard->setCardTitle("MiKu");
27 _promotionCard->setPromotionTitle("SONG~");
28 _promotionCard->setTitle("STYX HELIX");
29 _promotionCard->setSubTitle("Never close your eyes, Searching for a true fate");
30
31 _promotionView = new ElaPromotionView(this);
32
33 ElaPromotionCard* exampleCard1 = new ElaPromotionCard(this);
34 exampleCard1->setCardPixmap(QPixmap(":/Resource/Image/Card/miku.png"));
35 exampleCard1->setCardTitle("MiKu");
36 exampleCard1->setPromotionTitle("SONG~");
37 exampleCard1->setTitle("STYX HELIX");
38 exampleCard1->setSubTitle("Never close your eyes, Searching for a true fate");
39
40 ElaPromotionCard* exampleCard2 = new ElaPromotionCard(this);
41 exampleCard2->setCardPixmap(QPixmap(":/Resource/Image/Card/beach.png"));
42 exampleCard2->setCardTitle("Beach");
43 exampleCard2->setPromotionTitle("SONG~");
44 exampleCard2->setTitle("STYX HELIX");
45 exampleCard2->setSubTitle("Never close your eyes, Searching for a true fate");
46
47 ElaPromotionCard* exampleCard3 = new ElaPromotionCard(this);
48 exampleCard3->setCardPixmap(QPixmap(":/Resource/Image/Card/dream.png"));
49 exampleCard3->setCardTitle("Dream");
50 exampleCard3->setPromotionTitle("SONG~");
51 exampleCard3->setTitle("STYX HELIX");
52 exampleCard3->setSubTitle("Never close your eyes, Searching for a true fate");
53
54 ElaPromotionCard* exampleCard4 = new ElaPromotionCard(this);
55 exampleCard4->setCardPixmap(QPixmap(":/Resource/Image/Card/classroom.png"));
56 exampleCard4->setCardTitle("Classroom");
57 exampleCard4->setPromotionTitle("SONG~");
58 exampleCard4->setTitle("STYX HELIX");
59 exampleCard4->setSubTitle("Never close your eyes, Searching for a true fate");
60
61 _promotionView->appendPromotionCard(exampleCard1);
62 _promotionView->appendPromotionCard(exampleCard2);
63 _promotionView->appendPromotionCard(exampleCard3);
64 _promotionView->appendPromotionCard(exampleCard4);
65 _promotionView->setIsAutoScroll(true);

Callers

nothing calls this directly

Calls 7

setIsUseAutoClockMethod · 0.80
setFixedHeightMethod · 0.80
setFixedSizeMethod · 0.80
appendPromotionCardMethod · 0.80
setIsAutoScrollMethod · 0.80
addWidgetMethod · 0.80
setIsTransparentMethod · 0.45

Tested by

no test coverage detected