QObject::connect(ui->pushButton, SIGNAL(clicked()), ui->lineEdit, SLOT(setText("123")));
MainWindow::MainWindow(...) { ... QObject::connect(ui->pushButton, SIGNAL(clicked()), this, SLOT(insertText())); ...}MainWindow::insertText() { ui->lineEdit->setText("123");}
cUpdateProgram *UpdateProgram; UpdateProgram = new cUpdateProgram;
UpdateProgram = new cUpdateProgram;
#ifndef CUPDATEPROGRAM_H#define CUPDATEPROGRAM_H#include <QObject>class cUpdateProgram : public QObject{ Q_OBJECTpublic: explicit cUpdateProgram(QObject *parent = 0);signals:public slots:};#endif // CUPDATEPROGRAM_H
#include "cupdateprogram.h"cUpdateProgram::cUpdateProgram(QObject *parent) : QObject(parent){}