Hi,
I wrote this sample code to test the situation described on the title:
: QDialog(parent
), ui
(new Ui
::DialogClass) {
ui->setupUi(this);
A.setFileName(ui->filenameA->text());
//B.setFileName(ui->filenameB->text());
B.open();
do {
line = in.readLine();
out << "##" << line << endl;
} while (!line.isNull());
ui->textEditA->setPlainText(in.readAll());
A.close();
B.close();
}
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();
}
To copy to clipboard, switch view to plain text mode
in line 20 i want the content of the stream to be loaded into textEditA.
Where am i thinking wrong here?
Thanks
Bookmarks