The QtxWebBrowser provides a window that can display html pages from local file system. More...
#include <QtxWebBrowser.h>

Classes | |
| class | Downloader |
| A dialog box that is used to process file links. More... | |
| class | Searcher |
| A class is used with QtxSearchTool in order to search text within the web page. More... | |
Public Slots | |
| virtual void | load (const QString &) |
| Load URL. More... | |
Public Member Functions | |
| virtual | ~QtxWebBrowser () |
| Destructor. More... | |
Static Public Member Functions | |
| static QtxWebBrowser * | webBrowser () |
| Return the only instance of the QtxWebBrowser. More... | |
| static void | loadUrl (const QString &, const QString &=QString()) |
| Load given url address and optional scroll to the specified anchor. More... | |
| static void | setResourceMgr (QtxResourceMgr *) |
| Set resource manager. More... | |
| static void | shutdown () |
| Shutdown help browser. More... | |
Protected Slots | |
| virtual void | about () |
| virtual void | linkClicked (const QUrl &) |
| Called when users activated any link at the page. More... | |
| virtual void | linkHovered (const QString &, const QString &, const QString &) |
| Called when link is hovered. More... | |
| virtual void | linkHovered (const QString &) |
Protected Member Functions | |
| QtxWebBrowser () | |
| Constructor. Construct the web browser. More... | |
| QtxResourceMgr * | resourceMgr () const |
| Get resource manager. More... | |
Private Slots | |
| void | open () |
| Open file Shows "Open file" standard dialog box to allow user to choose file to open. More... | |
| void | adjustTitle () |
| Update title of the window. More... | |
| void | finished (bool) |
| void | linkAction () |
Private Member Functions | |
| void | saveLink (const QString &) |
| Save file. More... | |
| void | openLink (const QString &, bool=false) |
| Open file. More... | |
Private Attributes | |
| QWebEngineView * | myWebView |
| QtxSearchTool * | myFindPanel |
| QUrl | myLastUrl |
Static Private Attributes | |
| static QtxWebBrowser * | myBrowser = 0 |
| The only one instance of web browser. More... | |
| static QtxResourceMgr * | myResourceMgr = 0 |
| Resources manager. More... | |
Only one instance of the QtxWebBrowser class can be created. To access the browser window, use static method QtxWebBrowser::webBrowser(), which creates an instance of the QtxWebBrowser widget (if it is not yet created) and returns a pointer to it.
You should not destroy this instance - it is done automatically after closing of the browser window. To close window programmatically use method close().
Optionally resource manager can be specified to automatically store action (open/save) and program to be used to download files in the application preferences.
The following sample demonstrates how to use web browser. In this code the browser window is created, /data/index.html file is opened and scrolled to the "anchor1" anchor on this page.
|
virtual |
References myBrowser.
|
protected |
References about(), adjustTitle(), QtxSearchTool::Basic, QtxSearchTool::Case, VTK::Find(), finished(), Horizontal, linkAction(), linkClicked(), linkHovered(), main(), myFindPanel, myWebView, open(), QtxSearchTool::setActivators(), QtxSearchTool::setSearcher(), QtxSearchTool::SlashKey, WebView, and QtxSearchTool::Wrap.
|
protectedvirtualslot |
Shows About dialog box
Reimplemented in HelpBrowser.
|
privateslot |
References myWebView.
|
privateslot |
References myLastUrl, and openLink().
|
privateslot |
References linkClicked(), myLastUrl, myWebView, openLink(), s, and saveLink().
|
protectedvirtualslot |
| url | URL being clicked |
References myWebView.
|
protectedvirtualslot |
| link | link being hovered |
| title | link title (if it is specified in the markup) |
| content | provides text within the link element, e.g., text inside an HTML anchor tag |
|
virtualslot |
| url | path to the file to be opened in the browser |
Reimplemented in HelpBrowser.
References myWebView.
| url | an url address to load |
| anchor | an anchor to scroll page to |
References Qtx::AlignCenter, Qtx::alignWidget(), load(), and webBrowser().
|
private |
| fileName | link to the file being opened Opens dialog box to allow the user to choose the program to be used to open the file. |
References QtxWebBrowser::Downloader::action(), QtxResourceMgr::booleanValue(), QtxResourceMgr::integerValue(), QtxWebBrowser::Downloader::isRepeatAction(), QtxWebBrowser::Downloader::mOpen, QtxWebBrowser::Downloader::mSave, myLastUrl, myResourceMgr, QtxWebBrowser::Downloader::program(), saveLink(), QtxResourceMgr::setValue(), and QtxResourceMgr::stringValue().
|
protected |
References myResourceMgr.
|
private |
| fileName | link to the file being saved Shows "Save file" standard dialog box to allow user to choose where to save the file. |
|
static |
| resMgr | resource manager |
References myResourceMgr.
|
static |
References myBrowser.
|
static |
References myBrowser, and QtxWebBrowser().
|
staticprivate |
|
private |
|
private |
|
staticprivate |
|
private |