Files
GUI/src/AdminSettingForm.cpp

78 lines
2.2 KiB
C++
Raw Normal View History

//
// Created by Krad on 2021/11/22.
//
#include "AdminSettingForm.h"
#include <QHBoxLayout>
#include <QStackedWidget>
#include <QStringListModel>
#include <QListWidget>
#include "tabformwidget.h"
#include <QListWidgetItem>
#include "ui_tabformwidget.h"
#include <QLabel>
2021-11-23 13:22:00 +08:00
#include "UserOperationLogForm.h"
2021-12-07 14:13:55 +08:00
#include "generalform.h"
#include <QPushButton>
#include "systemsettingform.h"
2021-12-08 15:10:56 +08:00
#include "AccountTableForm.h"
2021-12-07 14:13:55 +08:00
AdminSettingForm::AdminSettingForm(QWidget* parent, Qt::WindowFlags f) : TabFormWidget(parent) {
2021-12-07 14:13:55 +08:00
QHBoxLayout* layout = new QHBoxLayout(this);
2021-12-08 17:50:30 +08:00
layout->setMargin(0);
2021-12-07 14:13:55 +08:00
this->ui->contentWidget->setLayout(layout);
QListWidget* widget = new QListWidget(this);
widget->setFixedWidth(250);
QStringList menus;
menus << tr("General") << tr("Account Manage") << tr("System Setting") << tr("System Information") << tr("Operation Log") << tr("About");
widget->addItems(menus);
widget->setSpacing(3);
for (int i = 0; i < menus.count(); ++i) {
widget->item(i)->setTextAlignment(Qt::AlignCenter);
}
layout->addWidget(widget);
QStackedWidget* stackedWidget = new QStackedWidget(this);
2021-12-07 14:13:55 +08:00
QWidget* spacerLine2 = new QWidget(this);
spacerLine2->setFixedWidth(2);
spacerLine2->setObjectName("verSpaceLine");
layout->addWidget(spacerLine2);
layout->addWidget(stackedWidget);
this->ui->commandWidget->hide();
2021-12-07 14:13:55 +08:00
GeneralForm* generalForm = new GeneralForm(this);
stackedWidget->addWidget(generalForm);
2021-12-08 15:10:56 +08:00
AccountTableForm* acc = new AccountTableForm(this);
2021-12-07 14:13:55 +08:00
stackedWidget->addWidget(acc);
2021-12-07 14:13:55 +08:00
systemSettingForm* systemSetting = new systemSettingForm(this);
stackedWidget->addWidget(systemSetting);
2021-11-23 13:22:00 +08:00
2021-12-07 14:13:55 +08:00
//QLabel* systemSetting = new QLabel(this);
//systemSetting->setText("systemSetting");
//stackedWidget->addWidget(systemSetting);
2021-11-23 13:22:00 +08:00
2021-12-07 14:13:55 +08:00
QLabel* Info = new QLabel(this);
Info->setText("info");
stackedWidget->addWidget(Info);
UserOperationLogForm* operationLogForm = new UserOperationLogForm(this);
stackedWidget->addWidget(operationLogForm);
QLabel* about = new QLabel(this);
about->setText("About");
stackedWidget->addWidget(about);
widget->setCurrentRow(0);
connect(widget, &QListWidget::currentRowChanged, [=](int rowindex) {
stackedWidget->setCurrentIndex(rowindex);
2021-12-08 17:50:30 +08:00
});
}
AdminSettingForm::~AdminSettingForm() {
}