码迷,mamicode.com
首页 > 其他好文 > 详细

Qt 5 Designer使用一

时间:2014-10-14 23:22:29      阅读:329      评论:0      收藏:0      [点我收藏+]

标签:des   style   blog   http   color   使用   ar   sp   div   

   bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣

bubuko.com,布布扣bubuko.com,布布扣

#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()
{

}

bubuko.com,布布扣

Qt 5 Designer使用一

标签:des   style   blog   http   color   使用   ar   sp   div   

原文地址:http://www.cnblogs.com/qiu0130/p/4025232.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!