#include <QProcess>
private:
QProcess myProcess;
void startProcess();
public slots:
void readOutput();
#include <QDebug>
// The signal 'readyReadStandardOutput' is emitted when the process has made new data available through its standard output channel (stdout)
connect(&myProcess, SIGNAL(readyReadStandardOutput()),
this, SLOT(readOutput()));
void myClass::startProcess() {
// The process itself (starting)
myProcess.start("gconftool-2 -R /apps/osso/hildon-desktop/views", QProcess::ReadOnly);
}
void myClass::readOutput() {
// Put the output in a QString
QString outData = myProcess.readAllStandardOutput();
qDebug() << outData;
}

| The Following 2 Users Say Thank You to Berserk For This Useful Post: | ||
QString outData; outData.append(myProcess.readAllStandardOutput());
| The Following 2 Users Say Thank You to Berserk For This Useful Post: | ||


testDialog = new QDialog(this);
connect(testDialog->testButton, SIGNAL(clicked()),
testDialog, SLOT(close()));
connect(testDialog->testButton, SIGNAL(clicked()),
this, SLOT(yourFunction()));

class yourDialog {
friend class yourMainWindow;
protected:
int parameter;
}
testDialog = new QDialog(this);
connect(testDialog->testButton, SIGNAL(clicked()),
testDialog, SLOT(close()));
connect(testDialog->testButton, SIGNAL(clicked()),
this, SLOT(yourFunction()));

class yourDialog {
friend class yourMainWindow;
protected:
int parameter;
}
protected: dialog* diagWin;
class dialog : public QDialog
{
Q_OBJECT
friend class MainWindow;
diagWin = new dialog(this); diagWin->show();
).
map<int, QLabel *> Labels;
Labels[1] = ui->label_1;
Labels[2] = ui->label_2;
for (number=1; number<=10; number++)
Labels[number]->setText("asdf");