|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.trolltech.qt.internal.QSignalEmitterInternal
com.trolltech.qt.QSignalEmitter
com.trolltech.qt.QtJambiObject
com.trolltech.qt.core.QObject
com.trolltech.qt.webkit.QWebFrame
public final class QWebFrame
The QWebFrame class represents a frame in a web page. QWebFrame represents a frame inside a web page. Each QWebPage
object contains at least one frame, the main frame, obtained using QWebPage::mainFrame()
. Additional frames will be created for HTML <frame> or <iframe> elements.
A frame can be loaded using load()
or setUrl()
. Alternatively, if you have the HTML content readily available, you can use setHtml()
instead.
The page()
function returns a pointer to the web page object. See Elements of QWebView
for an explanation of how web frames are related to a web page and web view.
The title of an HTML frame can be accessed with the title()
property. Additionally, a frame may also specify an icon, which can be accessed using the icon()
property. If the title or the icon changes, the corresponding titleChanged()
and iconChanged()
signals will be emitted. The textSizeMultiplier()
property can be used to change the overall size of the text displayed in the frame.
QWebFrame objects are created and controlled by the web page. You can connect to the web page's frameCreated()
signal to be notified when a new frame is created.
The hitTestContent()
function can be used to programmatically examine the contents of a frame.
A QWebFrame can be printed onto a QPrinter
using the print()
function. This function is marked as a slot and can be conveniently connected to QPrintPreviewDialog
's paintRequested()
signal.
QWebPage
.
Nested Class Summary |
---|
Nested classes/interfaces inherited from class com.trolltech.qt.QSignalEmitter |
---|
QSignalEmitter.AbstractSignal, QSignalEmitter.Signal0, QSignalEmitter.Signal1, QSignalEmitter.Signal2, QSignalEmitter.Signal3, QSignalEmitter.Signal4, QSignalEmitter.Signal5, QSignalEmitter.Signal6, QSignalEmitter.Signal7, QSignalEmitter.Signal8, QSignalEmitter.Signal9 |
Nested classes/interfaces inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
com.trolltech.qt.internal.QSignalEmitterInternal.AbstractSignalInternal |
Field Summary | |
---|---|
QSignalEmitter.Signal0 |
iconChanged
This signal is emitted when the icon ("favicon") associated with the frame has been loaded. |
QSignalEmitter.Signal0 |
initialLayoutCompleted
This signal is emitted when the frame is laid out the first time. |
QSignalEmitter.Signal0 |
javaScriptWindowObjectCleared
This signal is emitted whenever the global window object of the JavaScript environment is cleared, e. |
QSignalEmitter.Signal0 |
provisionalLoad
|
QSignalEmitter.Signal1 |
titleChanged
This signal takes 1 generic argument(s). |
QSignalEmitter.Signal1 |
urlChanged
This signal takes 1 generic argument(s). |
Fields inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
currentSender |
Method Summary | |
---|---|
void |
addToJavaScriptWindowObject(java.lang.String name,
QObject object)
Make object available under name from within the frame's JavaScript context. |
java.util.List |
childFrames()
Returns a list of all frames that are direct children of this frame. |
QSize |
contentsSize()
This property holds the size of the contents in this frame. |
java.lang.Object |
evaluateJavaScript(java.lang.String scriptSource)
Evaluate JavaScript defined by scriptSource using this frame as context. |
java.lang.String |
frameName()
The name of this frame as defined by the parent frame. |
QRect |
geometry()
Return the geometry of the frame relative to it's parent frame. |
QWebHitTestResult |
hitTestContent(QPoint pos)
Performs a hit test on the frame contents at the given position pos and returns the hit test result. |
QIcon |
icon()
This property holds the icon associated with this frame. |
void |
load(QNetworkRequest request)
Loads a network request, req, into this frame. |
void |
load(QNetworkRequest request,
QNetworkAccessManager.Operation operation)
Loads a network request, req, into this frame. |
void |
load(QNetworkRequest request,
QNetworkAccessManager.Operation operation,
QByteArray body)
Loads a network request, req, into this frame. |
void |
load(QUrl url)
Loads url into this frame. |
QWebPage |
page()
The web page that contains this frame. |
QWebFrame |
parentFrame()
Returns the parent frame of this frame, or 0 if the frame is the web pages main frame. |
QPoint |
pos()
Returns the position of the frame relative to it's parent frame. |
void |
print(QPrinter printer)
Prints the frame to the given printer. |
void |
render(QPainter painter)
Render the frame into painter. |
void |
render(QPainter painter,
QRegion clip)
Render the frame into painter clipping to clip. |
java.lang.String |
renderTreeDump()
Returns a dump of the rendering tree. |
int |
scrollBarMaximum(Qt.Orientation orientation)
Returns the maximum value for the scrollbar with orientation orientation, or 0 if no scrollbar is found for orientation. |
int |
scrollBarMinimum(Qt.Orientation orientation)
Returns the minimum value for the scrollbar with orientation orientation. |
Qt.ScrollBarPolicy |
scrollBarPolicy(Qt.Orientation orientation)
Returns the scrollbar policy for the scrollbar defined by orientation. |
int |
scrollBarValue(Qt.Orientation orientation)
Returns the current value for the scrollbar with orientation orientation, or 0 if no scrollbar is found for orientation. |
void |
setContent(QByteArray data)
Sets the content of this frame to the specified content data. |
void |
setContent(QByteArray data,
java.lang.String mimeType)
Sets the content of this frame to the specified content data. |
void |
setContent(QByteArray data,
java.lang.String mimeType,
QUrl baseUrl)
Sets the content of this frame to the specified content data. |
void |
setHtml(java.lang.String html)
Sets the content of this frame to html. |
void |
setHtml(java.lang.String html,
QUrl baseUrl)
Sets the content of this frame to html. |
void |
setScrollBarPolicy(Qt.Orientation orientation,
Qt.ScrollBarPolicy policy)
Sets the scrollbar policy for the scrollbar defined by orientation to policy. |
void |
setScrollBarValue(Qt.Orientation orientation,
int value)
Sets the current value for the scrollbar with orientation orientation. |
void |
setTextSizeMultiplier(double factor)
This property holds the scaling factor for all text in the frame. |
void |
setUrl(QUrl url)
This property holds the url of the frame currently viewed. |
double |
textSizeMultiplier()
This property holds the scaling factor for all text in the frame. |
java.lang.String |
title()
This property holds the title of the frame as defined by the HTML <title> element. |
java.lang.String |
toHtml()
Returns the frame's content, converted to HTML. |
java.lang.String |
toPlainText()
Returns the content of this frame converted to plain text. |
QUrl |
url()
This property holds the url of the frame currently viewed. |
Methods inherited from class com.trolltech.qt.core.QObject |
---|
childEvent, children, connectSlotsByName, customEvent, disposeLater, dumpObjectInfo, dumpObjectTree, dynamicPropertyNames, event, eventFilter, findChild, findChild, findChild, findChildren, findChildren, findChildren, findChildren, indexOfProperty, installEventFilter, isWidgetType, killTimer, moveToThread, objectName, parent, properties, property, removeEventFilter, setObjectName, setParent, setProperty, startTimer, timerEvent, toString, userProperty |
Methods inherited from class com.trolltech.qt.QtJambiObject |
---|
dispose, disposed, equals, finalize, reassignNativeResources, tr, tr, tr |
Methods inherited from class com.trolltech.qt.QSignalEmitter |
---|
blockSignals, disconnect, disconnect, signalsBlocked, signalSender, thread |
Methods inherited from class com.trolltech.qt.internal.QSignalEmitterInternal |
---|
__qt_signalInitialization |
Methods inherited from class java.lang.Object |
---|
clone, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface com.trolltech.qt.QtJambiInterface |
---|
disableGarbageCollection, nativeId, nativePointer, reenableGarbageCollection, setJavaOwnership |
Field Detail |
---|
public final QSignalEmitter.Signal0 iconChanged
icon()
.
public final QSignalEmitter.Signal0 initialLayoutCompleted
Note: A frame can be laid out multiple times.
public final QSignalEmitter.Signal0 javaScriptWindowObjectCleared
If you intend to add QObjects to a QWebFrame using addToJavaScriptWindowObject()
, you should add them in a slot connected to this signal. This ensures that your objects remain accessible when loading new URLs.
public final QSignalEmitter.Signal0 provisionalLoad
public final QSignalEmitter.Signal1 titleChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <java.lang.String(named: title)>:
This signal is emitted whenever the title of the frame changes. The title string specifies the new title.
title()
.
public final QSignalEmitter.Signal1 urlChanged
This signal takes 1 generic argument(s). We list their type and the name they go by in the description of this signal. <com.trolltech.qt.core.QUrl(named: url)>:
This signal is emitted with the URL of the frame when the frame's title is received. The new URL is specified by url.
url()
.
Method Detail |
---|
public final void addToJavaScriptWindowObject(java.lang.String name, QObject object)
Qt properties will be exposed as JavaScript properties and slots as JavaScript methods.
If you want to ensure that your QObjects remain accessible after loading a new URL, you should add them in a slot connected to the javaScriptWindowObjectCleared()
signal.
public final java.util.List childFrames()
parentFrame()
.
public final QSize contentsSize()
public final java.lang.Object evaluateJavaScript(java.lang.String scriptSource)
addToJavaScriptWindowObject()
, and javaScriptWindowObjectCleared()
.
public final java.lang.String frameName()
public final QRect geometry()
public final QWebHitTestResult hitTestContent(QPoint pos)
public final QIcon icon()
iconChanged()
, and QWebSettings::iconForUrl()
.
public final void load(QNetworkRequest request, QNetworkAccessManager.Operation operation)
Note: The view remains the same until enough data has arrived to display the new url.
public final void load(QNetworkRequest request)
Note: The view remains the same until enough data has arrived to display the new url.
public final void load(QNetworkRequest request, QNetworkAccessManager.Operation operation, QByteArray body)
Note: The view remains the same until enough data has arrived to display the new url.
public final void load(QUrl url)
Note: The view remains the same until enough data has arrived to display the new url.
setUrl()
, setHtml()
, and setContent()
.
public final QWebPage page()
public final QWebFrame parentFrame()
This is equivalent to qobject_cast<QWebFrame*>(frame->parent()
).
childFrames()
.
public final QPoint pos()
public final void print(QPrinter printer)
render()
.
public final void render(QPainter painter)
public final void render(QPainter painter, QRegion clip)
print()
.
public final java.lang.String renderTreeDump()
public final int scrollBarMaximum(Qt.Orientation orientation)
scrollBarMinimum()
.
public final int scrollBarMinimum(Qt.Orientation orientation)
The minimum value is always 0.
scrollBarMaximum()
.
public final Qt.ScrollBarPolicy scrollBarPolicy(Qt.Orientation orientation)
setScrollBarPolicy()
.
public final int scrollBarValue(Qt.Orientation orientation)
setScrollBarValue()
, scrollBarMinimum()
, and scrollBarMaximum()
.
public final void setContent(QByteArray data, java.lang.String mimeType)
External objects referenced in the content are located relative to baseUrl.
toHtml()
.
public final void setContent(QByteArray data)
External objects referenced in the content are located relative to baseUrl.
toHtml()
.
public final void setContent(QByteArray data, java.lang.String mimeType, QUrl baseUrl)
External objects referenced in the content are located relative to baseUrl.
toHtml()
.
public final void setHtml(java.lang.String html)
When using this method WebKit assumes that external resources such as JavaScript programs or style sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external script can be specified through the charset attribute of the HTML script tag. It is also possible for the encoding to be specified by web server.
toHtml()
.
public final void setHtml(java.lang.String html, QUrl baseUrl)
When using this method WebKit assumes that external resources such as JavaScript programs or style sheets are encoded in UTF-8 unless otherwise specified. For example, the encoding of an external script can be specified through the charset attribute of the HTML script tag. It is also possible for the encoding to be specified by web server.
toHtml()
.
public final void setScrollBarPolicy(Qt.Orientation orientation, Qt.ScrollBarPolicy policy)
scrollBarPolicy()
.
public final void setScrollBarValue(Qt.Orientation orientation, int value)
The scrollbar forces the value to be within the legal range: minimum <= value <= maximum.
Changing the value also updates the thumb position.
scrollBarValue()
, scrollBarMinimum()
, and scrollBarMaximum()
.
public final void setTextSizeMultiplier(double factor)
public final void setUrl(QUrl url)
urlChanged()
.
public final double textSizeMultiplier()
public final java.lang.String title()
titleChanged()
.
public final java.lang.String toHtml()
setHtml()
, and toPlainText()
.
public final java.lang.String toPlainText()
toHtml()
.
public final QUrl url()
urlChanged()
.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |