qfedu-qt-level/qtdemo03/form2.cpp

22 lines
381 B
C++
Raw Permalink Normal View History

#include "form2.h"
#include "ui_form2.h"
Form2::Form2(QWidget *parent) :
QWidget(parent),
ui(new Ui::Form2)
{
ui->setupUi(this);
}
Form2::~Form2()
{
delete ui;
}
void Form2::on_btn_clicked()
{
QString r12 = ui->rb1->isChecked()?"放学了":"还没放";
QString r34 = ui->rb3->isChecked()?"吃饭了":"还没吃";
ui->result->setText(r12+", "+r34);
}