From 3adbef8c08b8996d405b99f12a4fcc1fa47327eb Mon Sep 17 00:00:00 2001 From: Andrew nuark G Date: Tue, 22 Dec 2020 23:05:38 +0700 Subject: [PATCH] Redone Admin panel UI --- sea_transport/adminpanel.cpp | 21 +-- sea_transport/adminpanel.h | 7 +- sea_transport/adminpanel.ui | 338 +++++++++++++++++++---------------- 3 files changed, 190 insertions(+), 176 deletions(-) diff --git a/sea_transport/adminpanel.cpp b/sea_transport/adminpanel.cpp index 868ed4e..2418e16 100644 --- a/sea_transport/adminpanel.cpp +++ b/sea_transport/adminpanel.cpp @@ -14,24 +14,23 @@ AdminPanel::AdminPanel(QWidget *parent) : QMainWindow(parent), ui(new Ui::AdminP // connect(ui->pb_users_add, &QPushButton::clicked, this, &AdminPanel::on_user_add); // connect(ui->pb_users_remove, &QPushButton::clicked, this, &AdminPanel::on_user_remove); -// connect(ui->pb_users_add, &QPushButton::clicked, this, &AdminPanel::on_storage_add); -// connect(ui->pb_users_remove, &QPushButton::clicked, this, &AdminPanel::on_storage_remove); - // connect(ui->pb_dp_add, &QPushButton::clicked, this, &AdminPanel::on_delivery_point_add); // connect(ui->pb_dp_remove, &QPushButton::clicked, this, &AdminPanel::on_delivery_point_remove); -// ui->tv_vessels->setModel(); - uvm = new UsersViewModel(this); ui->tv_users->setModel(this->uvm); -// ui->tv_dp->setModel(); + vvm = new VesselsViewModel(this); + ui->tv_vessels->setModel(vvm); -// ui->tv_storages->setModel(); + dpvm = new DeliveryPointsViewModel(this); + ui->tv_dp->setModel(dpvm); uvm->update(); + vvm->update(); + dpvm->update(); } AdminPanel::~AdminPanel() { @@ -66,14 +65,6 @@ void AdminPanel::on_user_remove() { } -void AdminPanel::on_storage_add() { - -} - -void AdminPanel::on_storage_remove() { - -} - void AdminPanel::on_delivery_point_add() { } diff --git a/sea_transport/adminpanel.h b/sea_transport/adminpanel.h index a65ce20..8152158 100644 --- a/sea_transport/adminpanel.h +++ b/sea_transport/adminpanel.h @@ -4,6 +4,8 @@ #include #include "viewmodels/usersviewmodel.h" +#include "viewmodels/vesselsviewmodel.h" +#include "viewmodels/deliverypointsviewmodel.h" #include "entities/user_entity.h" @@ -18,6 +20,8 @@ class AdminPanel : public QMainWindow user_entity user; UsersViewModel *uvm; + VesselsViewModel *vvm; + DeliveryPointsViewModel *dpvm; public: explicit AdminPanel(QWidget *parent = nullptr); @@ -38,9 +42,6 @@ private: void on_user_add(); void on_user_remove(); - void on_storage_add(); - void on_storage_remove(); - void on_delivery_point_add(); void on_delivery_point_remove(); }; diff --git a/sea_transport/adminpanel.ui b/sea_transport/adminpanel.ui index 3eaa710..98e15da 100644 --- a/sea_transport/adminpanel.ui +++ b/sea_transport/adminpanel.ui @@ -6,169 +6,21 @@ 0 0 - 1200 - 600 + 1162 + 567 + + + 0 + 0 + + MainWindow - - - - - - - Vessels - - - - - - - true - - - - - - - - - Add - - - - - - - Remove - - - - - - - - - - - - - Users - - - - - - - true - - - - - - - - - Add - - - - - - - Remove - - - - - - - - - - - - - Delivery points - - - - - - - true - - - - - - - - - Add - - - - - - - Remove - - - - - - - - - - - - - Storages - - - - - - - true - - - - - - - - - Add - - - - - - - Remove - - - - - - - - - - - Hello, user %1 - - - Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter - - - + @@ -182,6 +34,176 @@ + + + + Hello, user %1 + + + Qt::AlignRight|Qt::AlignTrailing|Qt::AlignVCenter + + + + + + + QTabWidget::Rounded + + + 2 + + + false + + + false + + + + Users + + + + + + true + + + + + + + Qt::Horizontal + + + + 953 + 20 + + + + + + + + + + Add + + + + + + + false + + + Remove + + + + + + + + + + Vessels + + + + + + + + Add + + + + + + + false + + + Remove + + + + + + + + + Qt::Horizontal + + + + 953 + 20 + + + + + + + + true + + + + + + + + Delivery points + + + + + + Qt::Horizontal + + + + 953 + 20 + + + + + + + + + + Add + + + + + + + false + + + Remove + + + + + + + + + true + + + + + + + @@ -189,7 +211,7 @@ 0 0 - 1200 + 1162 21