Hi,
there is some strangeness inside you code (at least for me...). I still can say: use utf8 since Qt use that codec. Make sure you have configured Qt Creator to use utf8!
Also QTextCodec was not used correct:
void MainReader::on_pushButton_clicked()
{
QFile file(ui
->lineEdit
->text
());
{
in.setCodec("Windows-1255");
ui->textEdit->append(line);
}
}
void MainReader::on_pushButton_2_clicked()
{
ui->textEdit->append(trUtf8("נסיון"));
}
void MainReader::on_pushButton_clicked()
{
QFile file(ui->lineEdit->text());
if(file.open(QIODevice::ReadOnly | QIODevice::Text))
{
QTextStream in(&file);
in.setCodec("Windows-1255");
QString line = in.readAll();
ui->textEdit->append(line);
}
}
void MainReader::on_pushButton_2_clicked()
{
ui->textEdit->append(trUtf8("נסיון"));
}
To copy to clipboard, switch view to plain text mode
and with the button no problem at all. And as a further suggestion: Have a look at the layout mechanism. QHBoxLayout etc.
Bookmarks