Widget::Widget(QWidget *parent)
: QWidget(parent)
, ui(new Ui::Widget)
{
ui->setupUi(this);
}
Widget::~Widget()
{
delete ui;
}
void Widget::on_pushButton_clicked()
{
QString result = "今天你的选择是:";
if(ui->checkBox_eat->isChecked()){
result += ui->checkBox_eat->text() + " ";
}
if(ui->checkBox_sleep->isChecked()){
result += ui->checkBox_sleep->text() + " ";
}
if(ui->checkBox_fire->isChecked()){
result += ui->checkBox_fire->text();
}
ui->label->setText(result);
}
11-02