![]() |
LeechCraft
0.6.70-15082-g543737046d
Modular cross-platform feature rich live environment.
|
A "browser" that shows HTML either via QTextBrowser or a browser plugin. More...
#include "selectablebrowser.h"
Public Member Functions | |
SelectableBrowser (QWidget *parent=nullptr) | |
Constructs the browser with the given parent. More... | |
void | Construct (IWebBrowser *browser) |
Initialize the widget with the browser plugin. More... | |
void | SetHtml (const QString &html, const QUrl &base=QUrl()) |
Sets the HTML content to display. More... | |
void | SetNavBarVisible (bool visible) |
Sets whether navigation bar should be visible. More... | |
void | SetEverythingElseVisible (bool visible) |
Sets whether other UI elements should be visible. More... | |
A "browser" that shows HTML either via QTextBrowser or a browser plugin.
This class is used to display HTML content via some web browser plugin (like Poshuku) and, if such plugins aren't available, downgrade to QTextBrowser.
Currently using this class is generally discouraged. QtWebKit isn't as new and uncommon as it was a couple of years ago, so in most cases it's easier to just embed a QWebView.
Definition at line 38 of file selectablebrowser.h.
|
explicit |
Constructs the browser with the given parent.
By default, if no other functions are called, this browser widget will use QTextBrowser to display content. Call Construct() and pass a pointer to a web browser plugin to use it.
[in] | parent | The parent widget. |
Definition at line 20 of file selectablebrowser.cpp.
void LC::Util::SelectableBrowser::Construct | ( | IWebBrowser * | browser | ) |
Initialize the widget with the browser plugin.
After calling this function the widget will use the browser plugin to show HTML content.
If the browser is nullptr, this function does nothing and the widget still uses the QTextBrowser.
Any HTML content currently set will be cleared after calling this function.
[in] | browser | The browser to use. |
Definition at line 31 of file selectablebrowser.cpp.
void LC::Util::SelectableBrowser::SetEverythingElseVisible | ( | bool | visible | ) |
Sets whether other UI elements should be visible.
Sometimes it's not desirable to show, for example, browser history or bookmarks panes. Use this function to hide them.
The default state is unspecified.
[in] | visible | Whether irrelevant UI elements should be visible. |
Definition at line 61 of file selectablebrowser.cpp.
void LC::Util::SelectableBrowser::SetHtml | ( | const QString & | html, |
const QUrl & | base = QUrl () |
||
) |
Sets the HTML content to display.
[in] | html | The HTML content to display. |
[in] | base | The base URL which is used to resolve relative URLs found in the HTML content. |
Definition at line 47 of file selectablebrowser.cpp.
void LC::Util::SelectableBrowser::SetNavBarVisible | ( | bool | visible | ) |
Sets whether navigation bar should be visible.
The navigation bar typically includes the address edit button with back/forward/reload buttons. Some plugins may find it undesirable.
The default state is unspecified.
[in] | visible | Whether navigation bar should be visible. |
Definition at line 55 of file selectablebrowser.cpp.