User Tools

Site Tools


DzTextBrowser

DAZScript wrapper for QTextBrowser.

More...

Inherits :

Properties

Constructors

DAZ Script
DzTextBrowser ( DzWidget parent )

Methods

DAZ Script
voidbackward ()
voidclearHistory ()
voidforward ()
StringhistoryTitle ( Number index )
StringhistoryUrl ( Number index )
voidhome ()
voidreload ()

Signals

voidanchorClicked ( String name, String link )
voidbackwardAvailable ( Boolean available )
voidforwardAvailable ( Boolean available )
voidhighlighted ( String link )
voidhistoryChanged ()
voidlinkClicked ( String link )
voidsourceChanged ( String src )

Detailed Description

A DzTextBrowser extends DzTextEdit (in read-only mode), adding functionality that allows users to navigate hyper-linked documents.

Properties


Number : backwardCount

Holds the number of locations backward in the history. (Read Only)

Since:

  • 4.9.3.93

Number : forwardCount

Holds the number of locations forward in the history. (Read Only)

Since:

  • 4.9.3.93

Boolean : isBackwardAvailable

Holds whether or not the browser can go backward in the document history. (Read Only)

Since:

  • 4.9.3.93

Boolean : isForwardAvailable

Holds whether or not the browser can go forward in the document history. (Read Only)

Since:

  • 4.9.3.93

Boolean : openExternalLinks

Holds whether or not the browser should open links to external sources using App.showUrl() instead of emitting the anchorClicked signal. Links are considered external if their scheme is not 'file://'. (since 4.9.3.93)


Boolean : openLinks

Holds whether or not the browser should automatically open links the user tries to activate by mouse or keyboard.

Since:

  • 4.9.3.93

Array : searchPaths

Holds the search paths used by the browser to find supporting content.

Since:

  • 4.9.3.93

String : source

Holds the name of the displayed document. This will be empty if the URL is invalid, if no document is displayed, or if the source is unknown.

When setting this property the browser attempts to find a document with the specified name in searchPaths and the directory of the current source, unless the value is an absolute path. It also checks for optional anchors and scrolls the document accordingly.

If the first tag in the document is <qt type=detail>, the document is displayed as a popup rather than as new document in the browser itself. Otherwise, the document is displayed normally in the browser with the text set to the contents of the named document with DzTextEdit::html.

Constructors


DzTextBrowser( DzWidget parent )

Creates a text browser widget as a child of the given parent widget.

Parameter(s):

  • parent - The widget parent for the text browser.

Methods


void : backward()

Changes the document displayed to the previous document in the list built by navigating links. Does nothing if there is no previous document.


void : clearHistory()

Clears the history of visited documents and disables the forward and backward navigation.

Since:

  • 4.9.3.93

void : forward()

Changes the document displayed to the next document in the list built by navigating links. Does nothing if there is no next document.


String : historyTitle( Number index )

Parameter(s):

  • index - The zero-based index of the history item. * index < 0 : backward() history
    • index == 0 : current
    • index > 0 : forward() history

Return Value:

Since:

  • 4.9.3.93

String : historyUrl( Number index )

Parameter(s):

  • index - The zero-based index of the history item. * index < 0 : backward() history

Return Value:

  • The URL of the history item.

Since:

  • 4.9.3.93

void : home()

Changes the current document displayed to be the first document displayed.


void : reload()

Reloads the current document.

Signals


void : anchorClicked( String name, String link )

Signature:“anchorClicked(const QString&,const QString&)”

Emitted when the user clicks an anchor.

Parameter(s):

  • name - The value of the href, or the name of the target document
  • link - The name of the anchor

void : backwardAvailable( Boolean available )

Signature:“backwardAvailable(bool)”

Emitted when the availability of backward() changes.

Parameter(s):

  • available - false when user is at home(), otherwise true.

void : forwardAvailable( Boolean available )

Signature:“forwardAvailable(bool)”

Emitted when the availability of forward() changes.

Parameter(s):

  • available - true when the user navigates backward(), false when the user goes forward() or if there is no next document.

void : highlighted( String link )

Signature:“highlighted(const QString&)”

Emitted when the user selects a link but does not activate it.

Parameter(s):

  • link - The selected link.

void : historyChanged()

Signature:“historyChanged()”

Emitted when the history changes.


void : linkClicked( String link )

Signature:“linkClicked(const QString&)”

Emitted when the user clicks a link.

Parameter(s):

  • link - The value of the href, or the name of the target document.

Attention:

  • The link will be the absolute location of the document, based on the value of the anchor's href tag.

void : sourceChanged( String src )

Signature:“sourceChanged(const QString&)”

Emitted when the mime source of the browser changes.

Parameter(s):

  • src - The name of the document being displayed in the browser.