| 87 | } |
| 88 | |
| 89 | void PageControlComponent::initPageButtons() |
| 90 | { |
| 91 | pageButtonsLayout = new QHBoxLayout; |
| 92 | pageButtonsLayout->setSpacing(3); |
| 93 | pageButtonsLayout->setMargin(0); |
| 94 | |
| 95 | preButton = createPushButton(); |
| 96 | preButton->setText("<"); |
| 97 | pageButtonsLayout->addWidget(preButton); |
| 98 | |
| 99 | firstPageButton = createPushButton(); |
| 100 | firstPageButton->setText("1"); |
| 101 | pageButtonsLayout->addWidget(firstPageButton); |
| 102 | |
| 103 | leftMoreButton = createPushButton(); |
| 104 | leftMoreButton->setText("..."); |
| 105 | pageButtonsLayout->addWidget(leftMoreButton); |
| 106 | |
| 107 | for (int i = 0; i < 3; ++i) { |
| 108 | auto midBtn = createPushButton(); |
| 109 | pageButtonsLayout->addWidget(midBtn); |
| 110 | midPageButtonsList.append(midBtn); |
| 111 | } |
| 112 | |
| 113 | rightMoreButton = createPushButton(); |
| 114 | rightMoreButton->setText("..."); |
| 115 | pageButtonsLayout->addWidget(rightMoreButton); |
| 116 | |
| 117 | lastPageButton = createPushButton(); |
| 118 | pageButtonsLayout->addWidget(lastPageButton); |
| 119 | |
| 120 | nextButton = createPushButton(); |
| 121 | nextButton->setText(">"); |
| 122 | pageButtonsLayout->addWidget(nextButton); |
| 123 | |
| 124 | qobject_cast<QHBoxLayout*>(layout())->addLayout(pageButtonsLayout); |
| 125 | } |
| 126 | |
| 127 | void PageControlComponent::initConnection() |
| 128 | { |