Updates and Vessels viewmodel
This commit is contained in:
parent
72a4842800
commit
9a4b71de36
6 changed files with 34 additions and 12 deletions
|
|
@ -4,11 +4,11 @@ UsersViewModel::UsersViewModel(QObject *parent) : QAbstractTableModel(parent) {
|
|||
|
||||
}
|
||||
|
||||
int UsersViewModel::rowCount(const QModelIndex & /*parent*/) const {
|
||||
return apparatus::instance()->get_object_subsystem()->vessels().size();
|
||||
int UsersViewModel::rowCount(const QModelIndex &/*parent*/) const {
|
||||
return apparatus::instance()->get_auth_subsystem()->users().length();
|
||||
}
|
||||
|
||||
int UsersViewModel::columnCount(const QModelIndex & /*parent*/) const {
|
||||
int UsersViewModel::columnCount(const QModelIndex &/*parent*/) const {
|
||||
return 3;
|
||||
}
|
||||
|
||||
|
|
@ -61,5 +61,6 @@ QVariant UsersViewModel::data(const QModelIndex &index, int role) const {
|
|||
}
|
||||
|
||||
void UsersViewModel::update() {
|
||||
this->resetInternalData();
|
||||
this->beginResetModel();
|
||||
this->endResetModel();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -10,10 +10,10 @@ class UsersViewModel : public QAbstractTableModel
|
|||
Q_OBJECT
|
||||
public:
|
||||
UsersViewModel(QObject *parent = nullptr);
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const override;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||
int rowCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
int columnCount(const QModelIndex &parent = QModelIndex()) const;
|
||||
QVariant headerData(int section, Qt::Orientation orientation, int role) const;
|
||||
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
|
||||
|
||||
public slots:
|
||||
void update();
|
||||
|
|
|
|||
6
sea_transport/viewmodels/vesselsviewmodel.cpp
Normal file
6
sea_transport/viewmodels/vesselsviewmodel.cpp
Normal file
|
|
@ -0,0 +1,6 @@
|
|||
#include "vesselsviewmodel.h"
|
||||
|
||||
VesselsViewModel::VesselsViewModel()
|
||||
{
|
||||
|
||||
}
|
||||
13
sea_transport/viewmodels/vesselsviewmodel.h
Normal file
13
sea_transport/viewmodels/vesselsviewmodel.h
Normal file
|
|
@ -0,0 +1,13 @@
|
|||
#ifndef VESSELSVIEWMODEL_H
|
||||
#define VESSELSVIEWMODEL_H
|
||||
|
||||
#include <QAbstractTableModel>
|
||||
|
||||
class VesselsViewModel : public QAbstractTableModel
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
VesselsViewModel();
|
||||
};
|
||||
|
||||
#endif // VESSELSVIEWMODEL_H
|
||||
Loading…
Add table
Add a link
Reference in a new issue