|
|
This class is khtml's main class. It features an almost complete web browser, and html renderer.
The easiest way to use this class (if you just want to display a an HTML page at some URL) is the following:
KURL url = "http://www.kde.org"; KHTMLPart *w = new KHTMLPart(); w->openURL(url); w->view()->resize(500, 400); w->show();
By default Java and JavaScript support are disabled. You can enable them by using the enableJava() and enableJScript() methods.
Some apps want to write their HTML code directly into the widget instead of it opening an url. You can also do that in the following way:
QString myHTMLCode = ...; KHTMLPart *w = new KHTMLPart(); w->begin(); w->write(myHTMLCode); ... w->end();
You can do as many calls to write as you want. But there are two
write() methods, one accepting a QString one accepting a
char @p * argument. You should use one or the other
(but not both) since the method using
the char @p * argument does an additional decoding step to convert the
written data to Unicode.
| void |
[signal]
Emitted if the cursor is moved over an URL.
| void |
[signal]
Emitted when the user clicks the right mouse button on the document.
| void |
[signal]
This signal is emitted when the selection changes.
| void |
[signal]
This signal is emitted when an element retrieves the keyboard focus. Note that the signal argument can be a null node if no element is active, meaning a node has explicitly been deactivated without a new one becoming active.
| bool |
[protected virtual]
Reimplementation of KParts::ReadOnlyPart::event .
| bool |
[protected virtual]
Reimplementation of QObject::eventFilter .
| void |
[protected virtual]
Eventhandler of the khtml::MousePressEvent.
| void |
[protected virtual]
Eventhandler for the khtml::MouseDoubleClickEvent.
| void |
[protected virtual]
Eventhandler for the khtml::MouseDoubleClickEvent.
| void |
[protected virtual]
Eventhandler for the khtml::MouseMoveEvent.
| void |
[protected virtual]
Eventhandler for the khtml::DrawContentsEvent.
| void |
[protected virtual]
Internal reimplementation of KParts::Part::guiActivateEvent .
Reimplemented from ReadOnlyPart
| bool |
[protected virtual]
Internal empty reimplementation of KParts::ReadOnlyPart::openFile .
Reimplemented from ReadOnlyPart
| void |
[protected virtual]
| void |
[protected virtual]
| bool |
[protected]
| void |
[protected virtual]
| void |
[protected virtual]
| KParts::ReadOnlyPart * |
[protected virtual]
This method is called when a new embedded object (include html frames) is to be created. Reimplement it if you want to add support for certain embeddable objects without registering them in the KDE wide registry system (KSyCoCa) . Another reason for re-implementing this method could be if you want to derive from KTHMLPart and also want all html frame objects to be a object of your derived type, in which case you should return a new instance for the mimetype 'text/html' .
| void |
[protected]
| void |
[protected]
| void |
[slot]
Call this method to explicitly pass the focus to a certain element of the current document.
| void |
[slot]
Stops all animated images on the current and child pages
| void |
[protected slot]
Internal. Called by the BrowserExtension .