| 52 | } |
| 53 | |
| 54 | void 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 | |
| 102 | void HistoryListWidget::initConnection() |
| 103 | { |
nothing calls this directly
no test coverage detected