标签:des style blog http color 使用 ar sp div
#ifndef DIALOG_H #define DIALOG_H #include <QDialog> namespace Ui { class Dialog; } class Dialog : public QDialog { Q_OBJECT public: explicit Dialog(QWidget *parent = 0); ~Dialog(); private slots: void on_button_clicked(); void on_radiusLineEdit_textChanged(); private: Ui::Dialog *ui; }; #endif // DIALOG_H
#include "dialog.h" #include "ui_dialog.h" #include <QPushButton> #include <QDialog> const static double PI = 3.1416; Dialog::Dialog(QWidget *parent) : QDialog(parent), ui(new Ui::Dialog) { ui->setupUi(this); connect(ui->button, SIGNAL(Dialog::on_button_clicked), ui->areaLabel_2, SLOT(Dialog::on_radiusLineEdit_textChanged)); } Dialog::~Dialog() { delete ui; } void Dialog::on_button_clicked() { bool ok; QString tempStr; QString valueStr=ui->radiusLineEdit->text(); int valueInt=valueStr.toInt(&ok); double area=valueInt*valueInt*PI; ui->areaLabel_2->setText(tempStr.setNum(area)); } void Dialog::on_radiusLineEdit_textChanged() { }
标签:des style blog http color 使用 ar sp div
原文地址:http://www.cnblogs.com/qiu0130/p/4025232.html