This commit is contained in:
2020-09-08 16:56:59 +08:00
parent 71012d1ad5
commit 93c56f4347
91 changed files with 199 additions and 79 deletions
+19 -2
View File
@@ -20,12 +20,12 @@ Setting::Setting(QWidget *parent) :
index1 = new Index1(this);;
connect(this,SIGNAL(IndexChanged(int)),
this,SLOT(onTabIndexChanged(int)));
setPushButtonState(state::Selected,
state::unSelected);
CurrentIndex = 0;
emit IndexChanged(CurrentIndex);
@@ -58,6 +58,17 @@ void Setting::resizeEvent(QResizeEvent *event)
update();
}
void Setting::setPushButtonState(uint8_t state1,uint8_t state2)
{
ui->pushButton_software->setProperty("state",state1);
ui->pushButton_software->style()->unpolish(ui->pushButton_software);
ui->pushButton_software->style()->polish(ui->pushButton_software);
ui->pushButton_plane->setProperty("state",state2);
ui->pushButton_plane->style()->unpolish(ui->pushButton_plane);
ui->pushButton_plane->style()->polish(ui->pushButton_plane);
}
void Setting::onTabIndexChanged(const int &index)//界面选择管理
@@ -73,12 +84,18 @@ void Setting::onTabIndexChanged(const int &index)//界面选择管理
void Setting::on_pushButton_software_clicked()
{
setPushButtonState(state::Selected,
state::unSelected);
update();
CurrentIndex = 0;
emit IndexChanged(CurrentIndex);
}
void Setting::on_pushButton_plane_clicked()
{
setPushButtonState(state::unSelected,
state::Selected);
update();
CurrentIndex = 1;
emit IndexChanged(CurrentIndex);
}