MCPcopy Create free account
hub / github.com/Codeya-IDE/deepin-ide / initUI

Method initUI

src/plugins/chat/widgets/historylistwidget.cpp:54–100  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

52}
53
54void HistoryListWidget::initUI()
55{
56 QVBoxLayout *mainLayout = new QVBoxLayout;
57 mainLayout->setSpacing(10);
58 setLayout(mainLayout);
59
60 QHBoxLayout *headerLayout = new QHBoxLayout;
61
62 closeButton = new DPushButton(this);
63 closeButton->setText("<");
64 closeButton->setFixedSize(QSize(36, 36));
65 headerLayout->addWidget(closeButton);
66
67 DLabel *title = new DLabel(this);
68 title->setText(tr("History"));
69 auto font = title->font();
70 font.setPixelSize(16);
71 title->setFont(font);
72 headerLayout->addWidget(title);
73
74 headerLayout->addStretch(1);
75
76 mainLayout->addLayout(headerLayout);
77
78 DWidget *itemsContainer = new DWidget(this);
79 mainLayout->addWidget(itemsContainer);
80
81 QVBoxLayout *containerLayout = new QVBoxLayout;
82 containerLayout->setMargin(0);
83 containerLayout->setSpacing(10);
84 itemsContainer->setLayout(containerLayout);
85
86 for (int i = 0; i < kMaxItemCountInOnePage; ++i) {
87 auto item = new SessionRecordItem(itemsContainer);
88 containerLayout->addWidget(item, 0);
89 item->setVisible(false);
90
91 itemsList.append(item);
92 connect(item, &SessionRecordItem::closeHistoryWidget, this, &HistoryListWidget::requestCloseHistoryWidget);
93 }
94
95 mainLayout->addStretch(1);
96
97 pageController = new PageControlComponent(this);
98 mainLayout->addWidget(pageController);
99 pageController->updatePageControl(10);
100}
101
102void HistoryListWidget::initConnection()
103{

Callers

nothing calls this directly

Calls 10

connectFunction · 0.85
setFixedSizeMethod · 0.80
fontMethod · 0.80
setVisibleMethod · 0.80
updatePageControlMethod · 0.80
setTextMethod · 0.45
addWidgetMethod · 0.45
setFontMethod · 0.45
setMarginMethod · 0.45
appendMethod · 0.45

Tested by

no test coverage detected