How can I open my .html file in a browser?

You can use QDesktopServices [] to open a URL with the appropriate application
for the system. So if you call

  1.     QDesktopServices::openUrl("");

then a web browser as set by the system will be invoked to display the page. The actual web browser used depends on the system settings, so this could be Firefox, Internet Explorer, Opera or Safari etc.

If you need the page to be opened in e.g Firefox only, you can use QProcess [] to start the browser and provide the appropriate arguments to Firefox.

No comments

Write a comment

Sorry, you must be logged in to post a comment.