Reputation: 3
I use help button (from QDialog) to open an HTML file, but i want it to open on specific header (<h1>, <h2>, etc.), depending on from which window i use help button.
This is how i open HTML:
QDesktopServices::openUrl(QUrl(QCoreApplication::applicationDirPath() + "/HELP.html"));
How can i do it?
Upvotes: 0
Views: 180
Reputation: 3747
When you add id
attributes to your headlines, you can use anchor links:
<h1 id="somename">my headline</h1>
Your link can then look like this:
QDesktopServices::openUrl(QUrl(QCoreApplication::applicationDirPath() + "/HELP.html#somename"));
Upvotes: 0