Re: Open odt files with Qt
For me it works (I tried only in Windows).
Are your environment configured to launch OpenOffice Writer to read ODT files?
Can you post the code?
This in my code
Code:
// Ask the user to select a ODT file
void Widget::on_openUrlButton_clicked()
{
this,
tr ("Open File"),
".",
tr ("Open Document Text Files (*.odt)"));
if (!fileName.isEmpty ()) {
ui->urlEdit->setText (fileName);
}
}
// Launch proper application to read selected file
void Widget::on_goButton_clicked()
{
QUrl url
= QUrl::fromLocalFile (ui
->urlEdit
->text
());
if (!result)
qWarning () << "Failed to open URL " << url;
}
Re: Open odt files with Qt
Thank u for your reply. I'm on ubuntu, but your reply helped great. There where too much slashes in my code. It was my mistake :( . But if I create my QUrl like you, the problem had not ever occured.