i have checked everything about the URLs as well as Image plugins.
Well the issue is the another PC not have any specific image viewer so that QDesktopServices::OpenUrl fails to open jpg files, but it successfully opens other files.
When i installed the image viewer than ::OpenUrl starts opening the jpg(Image) files.
well now i want to show an popup when ::OpenUrl fails to open image files.
but unfortunatly it also return "true".
filePath
)
)
)
) {
tr("View document"),
tr("Unable to find proper viewer for document"),
qDebug()<<"Unable to open document";
} else {
qDebug()<<"document opened successfully";
}
if(!QDesktopServices::openUrl(
QUrl::fromLocalFile(
QString(
filePath
)
)
)
) {
QMessageBox::information(this,
tr("View document"),
tr("Unable to find proper viewer for document"),
QMessageBox::Ok);
qDebug()<<"Unable to open document";
} else {
qDebug()<<"document opened successfully";
}
To copy to clipboard, switch view to plain text mode
in the above code qDebug "document opened successfully" shows even is image file not get opened.
anyone have idea about that?
Why ::OpenUrl return true even if it not open Image file.
Bookmarks