#ifndef __HELLO_H__#define __HELLO_H__#include <QLineEdit>#include <QPushButton>class Good:public QWidget{ Q_OBJECT public: Good(QWidget *parent=0); private slots: void func1(); public: QLineEdit *edit; QPushButton *btn1;};#endif // __HELLO_H__#include "hello.h"#include <QGridLayout>#include <QDoubleValidator>#include <QString>#include <QmessageBox>int k;double arg;double res;Good::Good(QWidget *parent):QWidget(parent){ resize(300,300); edit=new QLineEdit(this); edit->setValidator(new QDoubleValidator(-999999.0, 999999.0, 6, edit)); edit->setAlignment(Qt::AlignRight); edit->setGeometry(10,10,280,25); edit->clear(); edit->setEnabled("False"); btn1=new QPushButton("1",this); QGridLayout *layout = new QGridLayout; layout->addWidget(edit,0,0); layout->addWidget(btn1,3,0); setLayout(layout); connect(btn1,SIGNAL(clicked()),this,SLOT(func1()));}void Good::func1(){ QString x = edit->text(); QString y = "1"; x.append(y); edit->setText(x);}
... myFunc(bool isEnable, ...) { if (isEnable.toString() == "True") { ...
...if ( isEnable.toString().length() < 5 ) {...