-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMyListGUI.cpp
29 lines (26 loc) · 870 Bytes
/
MyListGUI.cpp
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
#include "MyListGUI.h"
#include <qtableview.h>
#include "PictureDelegate.h"
MyListGUI::MyListGUI(Service& service, QWidget *parent)
: QWidget(parent), service{service}
{
ui.setupUi(this);
this->table_model = new MyListModel{ service };
this->ui.tableView->setModel(this->table_model);
this->ui.tableView->setItemDelegate(new PictureDelegate{ service });
this->ui.tableView->resizeColumnsToContents();
this->ui.tableView->resizeRowsToContents();
this->ui.tableView->verticalHeader()->hide();
}
MyListGUI::~MyListGUI()
{
}
void MyListGUI::update()
{
this->table_model = new MyListModel{ service };
this->ui.tableView->setModel(this->table_model);
this->ui.tableView->setItemDelegate(new PictureDelegate{ service });
this->ui.tableView->resizeColumnsToContents();
this->ui.tableView->resizeRowsToContents();
this->ui.tableView->verticalHeader()->hide();
}