User Tools

Site Tools


webview

WebView (QWebView)

Implemented since KBasic V1.7.

The Qt documentation in C++ of this class (QWebView) can be read here: http://doc.trolltech.com/4.4/qtwebkit.html

A control for the form object, provides a powerful full-featured web browser.

Please read the control class overview Control as well.

The property “Value” contains the text of this control. There is “OldValue” as well. Important properties are “HomeURL”. Changing the Value only works, if no HomeURL has been set.

It is possible to display files of the project (html files in your project directory) by relative path, if you need so, copy all html files and related files in your project directory (after you created the EXE, where all runtime files are located) and set HomeURL to the first page of these html files.

Local HTML files opened by relative path are only visible by running the compiled EXE!

Getting the current page works as follow. You have a WebView “Web1” and a TextBox “TextBox1”.

Private Sub Web1_OnEvent(BackwardAvailable As Boolean, ForwardAvailable As Boolean, NewURL As String)
  TextBox1.Value = NewURL  
End Sub
For https connections you need to have openssl installed.

PROPERTIES

Value

Property Value As String


OldValue

Property OldValue As String


Text

Property Text As String

Same as Value. Provided for easy-use.


HomeURL

Property HomeURL As String


METHODS

Argument

Implemented since KBasic V1.82

Function Argument(String) As String


Keys

Implemented since KBasic V1.82

Function Keys() As Strings


Values

Implemented since KBasic V1.82

Function Values() As Strings


BackwardAvailable

Function BackwardAvailable() As Boolean


ForwardAvailable

Function ForwardAvailable() As Boolean


Backward

Sub Backward()


Forward

Sub Forward()


Reload

Sub Reload()


EVENTS

OnEvent

Sub OnEvent(BackwardAvailable As Boolean, ForwardAvailable As Boolean, NewURL As String)


OnPage

Implemented since KBasic V1.82

Sub OnPage(NewPage As String)

<a href="file:///WEBVIEW/pagename">custom link</a>

With variables which can be used by Keys() and Values().

<a href="file:///WEBVIEW/pagename?name=gut&part=333">custom link</a>

OnLinkHovered

Implemented since KBasic V1.82

Sub OnLinkHovered(Link As String, Title As String, TextContent As String)


OnLoadFinished

Implemented since KBasic V1.82

Sub OnLoadFinished(Ok As Boolean)


OnLoadProgress

Implemented since KBasic V1.82

Sub OnLoadProgress(Progress As Integer)


OnLoadStarted

Implemented since KBasic V1.82

Sub OnLoadStarted()


OnWindowCloseRequested

Implemented since KBasic V1.82

Sub OnWindowCloseRequested()


webview.txt · Last modified: 2013/06/04 13:08 by 84.176.13.135