Hi, m new to QT, i got a TEXTBROWSER in my MAINWINDOW which contains data that keeps on changing ...now i need to pass this changing data to my another TEXTBROWSER in QDIALOG....
Below is my code, using which i m only able to pass the first value of data, it's not updating itself.....HELP!
MainWindow.h
Private:
QString txtoutput;
//this holds the data that keeps on updating private slots:
void cmdOutputDialog();
Private:
QString txtoutput; //this holds the data that keeps on updating
private slots:
void cmdOutputDialog();
To copy to clipboard, switch view to plain text mode
MainWindow.cpp
connect(ui->buttonclicked, SIGNAL(clicked()), this, SLOT(cmdOutputDialog()));
void MainWindow::cmdOutputDialog()
{
CmdOutputDialog *dlg=new CmdOutputDialog(this);
dlg->display(txtoutput);
dlg->exec();
}
connect(ui->buttonclicked, SIGNAL(clicked()), this, SLOT(cmdOutputDialog()));
void MainWindow::cmdOutputDialog()
{
CmdOutputDialog *dlg=new CmdOutputDialog(this);
dlg->display(txtoutput);
dlg->exec();
}
To copy to clipboard, switch view to plain text mode
MyDialog.h
public slots:
private:
public slots:
void display(QString &text);
private:
QString m_disp;
To copy to clipboard, switch view to plain text mode
MyDialog.cpp
void MyDialog
::display(QString &text
) {
m_disp=text;
ui->textbrowser->setText(m_disp);
}
void MyDialog::display(QString &text)
{
m_disp=text;
ui->textbrowser->setText(m_disp);
}
To copy to clipboard, switch view to plain text mode
Bookmarks