#ifndef DIALOG_H
#define DIALOG_H
#include <QDialog>
#include <QLabel>
#include <QLineEdit>
#include <QPushButton>
class Dialog : public QDialog
{
Q_OBJECT
public:
Dialog(QWidget *parent = 0);
~Dialog();
private:
QLabel *radiusLabel, *areaLabel;
QLineEdit *radiusLineEdit, *areaLineEdit;
QPushButton *countPushButton;
private slots:
void showArea();
};
#endif // DIALOG_H
#include "dialog.h"
#include <QGridLayout>
#include <QVBoxLayout>
#include <QHBoxLayout>
Dialog::Dialog(QWidget *parent)
: QDialog(parent)
{
radiusLabel = new QLabel(this);
radiusLabel->setText(tr("半径:"));
areaLabel = new QLabel;
areaLabel->setText(tr("面积:"));
radiusLineEdit = new QLineEdit(this);
areaLineEdit = new QLineEdit;
countPushButton = new QPushButton;
countPushButton-&g