| 8 | #include "ElaText.h" |
| 9 | #include "T_ListViewModel.h" |
| 10 | T_ListView::T_ListView(QWidget* parent) |
| 11 | : T_BasePage(parent) |
| 12 | { |
| 13 | // 预览窗口标题 |
| 14 | setWindowTitle("ElaListView"); |
| 15 | |
| 16 | // 顶部元素 |
| 17 | createCustomWidget("列表视图被放置于此,可在此界面体验其效果并按需添加进项目中"); |
| 18 | |
| 19 | //ElaListView |
| 20 | ElaText* listText = new ElaText("ElaListView", this); |
| 21 | listText->setTextPixelSize(18); |
| 22 | _listView = new ElaListView(this); |
| 23 | _listView->setFixedHeight(450); |
| 24 | // _listView->setAlternatingRowColors(true); |
| 25 | _listView->setModel(new T_ListViewModel(this)); |
| 26 | ElaScrollBar* listViewFloatScrollBar = new ElaScrollBar(_listView->verticalScrollBar(), _listView); |
| 27 | listViewFloatScrollBar->setIsAnimation(true); |
| 28 | QHBoxLayout* listViewLayout = new QHBoxLayout(); |
| 29 | listViewLayout->setContentsMargins(0, 0, 10, 0); |
| 30 | listViewLayout->addWidget(_listView); |
| 31 | |
| 32 | QWidget* centralWidget = new QWidget(this); |
| 33 | centralWidget->setWindowTitle("ElaView"); |
| 34 | QVBoxLayout* centerVLayout = new QVBoxLayout(centralWidget); |
| 35 | centerVLayout->setContentsMargins(0, 0, 0, 0); |
| 36 | centerVLayout->addWidget(listText); |
| 37 | centerVLayout->addSpacing(10); |
| 38 | centerVLayout->addLayout(listViewLayout); |
| 39 | centerVLayout->addStretch(); |
| 40 | addCentralWidget(centralWidget, true, false, 0); |
| 41 | } |
| 42 | |
| 43 | T_ListView::~T_ListView() |
| 44 | { |
nothing calls this directly
no test coverage detected