summaryrefslogtreecommitdiff
path: root/client-qt/udm-client-qt/downloads_model.cpp
diff options
context:
space:
mode:
authorGluzskiy Alexandr <sss@sss.chaoslab.ru>2015-09-15 13:35:50 +0300
committerGluzskiy Alexandr <sss@sss.chaoslab.ru>2015-09-15 13:35:50 +0300
commit2f31b8c66a8f3931e1c9ee0c5b9adebf341bee9a (patch)
treef34ecdf26d22d75f43642e13fef8de3abd042515 /client-qt/udm-client-qt/downloads_model.cpp
parentf4750dc7ca9ce56c54352c03bb40affe1a64c315 (diff)
client-qt:
update model on data changes (still does not work ....) server: api: sane initialization of numeric fields in download struct
Diffstat (limited to 'client-qt/udm-client-qt/downloads_model.cpp')
-rw-r--r--client-qt/udm-client-qt/downloads_model.cpp9
1 files changed, 8 insertions, 1 deletions
diff --git a/client-qt/udm-client-qt/downloads_model.cpp b/client-qt/udm-client-qt/downloads_model.cpp
index 567b5e5..1883a6c 100644
--- a/client-qt/udm-client-qt/downloads_model.cpp
+++ b/client-qt/udm-client-qt/downloads_model.cpp
@@ -21,7 +21,7 @@
#include "downloads_model.h"
-downloads_model::downloads_model(std::vector<download> &downloads_, QObject */*parent*/) : downloads(downloads_)
+downloads_model::downloads_model(std::vector<download> &downloads_, QObject *parent) : QAbstractTableModel(parent), downloads(downloads_)
{
}
@@ -134,6 +134,13 @@ bool downloads_model::removeRows(int position, int rows, const QModelIndex &/*in
return true;
}
+void downloads_model::refresh()
+{
+ QModelIndex topLeft = createIndex(0,0), bottomRight = createIndex(downloads.size()-1, 5);
+ emit dataChanged(topLeft, bottomRight);
+}
+
+
void downloads_model::sort ( int /*column*/, Qt::SortOrder /*order*/)
{
//TODO: