-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathlistui.cpp
More file actions
45 lines (35 loc) · 1.17 KB
/
listui.cpp
File metadata and controls
45 lines (35 loc) · 1.17 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#include "listui.h"
#include <QFile>
ListUI::ListUI(QWidget *parent) : QWidget(parent){
listFields();
setLayout(listColum);
}
void ListUI::listFields(void){
createListFields();
arrangeListFields();
}
void ListUI::createListFields(void){
listHeader = new QLabel;
listFooter = new QLabel;
listCount = new QLabel;
theList = new QListView;
listHeader->setPixmap(QPixmap(QString(":images/listHeader.png"),0,Qt::AutoColor));
listFooter->setPixmap(QPixmap(QString(":images/totalInterest.png"),0,Qt::AutoColor));
}
void ListUI::arrangeListFields(void){
listColum = new QVBoxLayout;
listTotal = new QHBoxLayout;
listTotal->addWidget(listFooter);
listTotal->addWidget(listCount);
listColum->addWidget(listHeader);
listColum->addWidget(theList);
//listColum->addLayout(listTotal);
}
void ListUI::addItem(QSqlQueryModel *model){
listCount->setText("2");
listCount->setAlignment(Qt::AlignRight);
listCount->setStyleSheet("QLabel {font-size:40px; color:#47505a; font-weight:bold;}");
theList->setModel(model);
theList->setModelColumn(2);
theList->setEditTriggers(QAbstractItemView::NoEditTriggers);
}