gt.beta2
3rd March 2009, 19:42
Hi,
I wrote this sample code to test the situation described on the title:
Dialog::Dialog(QWidget *parent)
: QDialog(parent), ui(new Ui::DialogClass)
{
ui->setupUi(this);
QFile A;
QTemporaryFile B;
A.setFileName(ui->filenameA->text());
//B.setFileName(ui->filenameB->text());
A.open(QFile::ReadOnly);
B.open();
QTextStream in(&A);
QTextStream out(&B);
QString line;
do {
line = in.readLine();
out << "##" << line << endl;
} while (!line.isNull());
ui->textEditA->setPlainText(in.readAll());
A.close();
B.close();
}
in line 20 i want the content of the stream to be loaded into textEditA.
Where am i thinking wrong here?
Thanks
I wrote this sample code to test the situation described on the title:
Dialog::Dialog(QWidget *parent)
: QDialog(parent), ui(new Ui::DialogClass)
{
ui->setupUi(this);
QFile A;
QTemporaryFile B;
A.setFileName(ui->filenameA->text());
//B.setFileName(ui->filenameB->text());
A.open(QFile::ReadOnly);
B.open();
QTextStream in(&A);
QTextStream out(&B);
QString line;
do {
line = in.readLine();
out << "##" << line << endl;
} while (!line.isNull());
ui->textEditA->setPlainText(in.readAll());
A.close();
B.close();
}
in line 20 i want the content of the stream to be loaded into textEditA.
Where am i thinking wrong here?
Thanks