Use QT 5 designer 1

Source: Internet
Author: User

#ifndef DIALOG_H#define DIALOG_H#include <QDialog>namespace Ui {class Dialog;}class Dialog : public QDialog{    Q_OBJECTpublic:    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(){}

Use QT 5 designer 1

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.