qt_demoe/control/imageswitch/frmimageswitch.cpp

42 lines
1.2 KiB
C++
Raw Normal View History

2020-02-11 08:22:51 +00:00
#pragma execution_character_set("utf-8")
#include "frmimageswitch.h"
#include "ui_frmimageswitch.h"
2022-04-28 00:35:52 +00:00
#include "qdebug.h"
2020-02-11 08:22:51 +00:00
frmImageSwitch::frmImageSwitch(QWidget *parent) : QWidget(parent), ui(new Ui::frmImageSwitch)
{
ui->setupUi(this);
this->initForm();
}
frmImageSwitch::~frmImageSwitch()
{
delete ui;
}
void frmImageSwitch::initForm()
{
ui->imageSwitch1->setChecked(true);
ui->imageSwitch2->setChecked(true);
ui->imageSwitch3->setChecked(true);
2022-04-28 00:35:52 +00:00
2021-11-03 06:13:56 +00:00
ui->imageSwitch1->setFixedSize(87, 30);
ui->imageSwitch2->setFixedSize(87, 30);
ui->imageSwitch3->setFixedSize(87, 30);
2022-04-28 00:35:52 +00:00
2020-02-11 08:22:51 +00:00
ui->imageSwitch1->setButtonStyle(ImageSwitch::ButtonStyle_1);
ui->imageSwitch2->setButtonStyle(ImageSwitch::ButtonStyle_2);
ui->imageSwitch3->setButtonStyle(ImageSwitch::ButtonStyle_3);
2022-04-28 00:35:52 +00:00
//绑定选中切换信号
connect(ui->imageSwitch1, SIGNAL(checkedChanged(bool)), this, SLOT(checkedChanged(bool)));
connect(ui->imageSwitch2, SIGNAL(checkedChanged(bool)), this, SLOT(checkedChanged(bool)));
connect(ui->imageSwitch3, SIGNAL(checkedChanged(bool)), this, SLOT(checkedChanged(bool)));
}
void frmImageSwitch::checkedChanged(bool checked)
{
qDebug() << sender() << checked;
2020-02-11 08:22:51 +00:00
}