qfedu-qt-level/Project02/settingswidget.cpp

58 lines
1.6 KiB
C++

#include "settingswidget.h"
#include "ui_settingswidget.h"
SettingsWidget::SettingsWidget(QWidget *parent) :
QWidget(parent),
ui(new Ui::SettingsWidget)
{
ui->setupUi(this);
// 启用所有按钮
ui->classifier_btn->setEnabled(true);
ui->operational_log_btn->setEnabled(true);
ui->password_setting_btn->setEnabled(true);
ui->serial_port_debugging_btn->setEnabled(true);
}
SettingsWidget::~SettingsWidget()
{
delete ui;
}
void SettingsWidget::on_classifier_btn_clicked()
{
ui->settings_stacked_widget->setCurrentIndex(0);
ui->classifier_btn->setEnabled(false);
ui->operational_log_btn->setEnabled(true);
ui->password_setting_btn->setEnabled(true);
ui->serial_port_debugging_btn->setEnabled(true);
}
void SettingsWidget::on_operational_log_btn_clicked()
{
ui->settings_stacked_widget->setCurrentIndex(1);
ui->classifier_btn->setEnabled(true);
ui->operational_log_btn->setEnabled(false);
ui->password_setting_btn->setEnabled(true);
ui->serial_port_debugging_btn->setEnabled(true);
}
void SettingsWidget::on_password_setting_btn_clicked()
{
ui->settings_stacked_widget->setCurrentIndex(2);
ui->classifier_btn->setEnabled(true);
ui->operational_log_btn->setEnabled(true);
ui->password_setting_btn->setEnabled(false);
ui->serial_port_debugging_btn->setEnabled(true);
}
void SettingsWidget::on_serial_port_debugging_btn_clicked()
{
ui->settings_stacked_widget->setCurrentIndex(3);
ui->classifier_btn->setEnabled(true);
ui->operational_log_btn->setEnabled(true);
ui->password_setting_btn->setEnabled(true);
ui->serial_port_debugging_btn->setEnabled(false);
}