• Skip to content
  • Skip to link menu
KDE API Reference
  • KDE API Reference
  • kdelibs API Reference
  • KDE Home
  • Contact Us
 

KDEWebKit

Signals | Public Member Functions | Protected Member Functions | List of all members
KGraphicsWebView Class Reference

#include <kgraphicswebview.h>

Inheritance diagram for KGraphicsWebView:
Inheritance graph
[legend]

Signals

void linkMiddleOrCtrlClicked (const KUrl &url)
 
void linkShiftClicked (const KUrl &url)
 
void selectionClipboardUrlPasted (const KUrl &url)
 
void selectionClipboardUrlPasted (const KUrl &url, const QString &searchText)
 

Public Member Functions

 KGraphicsWebView (QGraphicsItem *parent=0, bool createCustomPage=true)
 
 ~KGraphicsWebView ()
 
bool isExternalContentAllowed () const
 
void setAllowExternalContent (bool allow)
 

Protected Member Functions

virtual void mousePressEvent (QGraphicsSceneMouseEvent *event)
 
virtual void mouseReleaseEvent (QGraphicsSceneMouseEvent *event)
 
void wheelEvent (QGraphicsSceneWheelEvent *event)
 

Detailed Description

A re-implementation of QGraphicsWebView that provides KDE integration.

This is a drop-in replacement for QGraphicsWebView that provides full KDE integration through the use of KWebPage. It also provides signals that capture middle, shift and ctrl mouse clicks on links and URL pasting from the selection clipboard.

The specific functionality provided by this class (over and above what would be acheived by using KWebPage with a QGraphicsWebView) is that scrolling * with the mouse wheel while holding down CTRL zooms the page (see QGraphicsWebView::setZoomFactor) and several useful signals are emitted when the user performs certain actions.

Author
Urs Wolfer <uwolfer @ kde.org>
Dawit Alemayehu <adawit @ kde.org>
Since
4.4

Definition at line 55 of file kgraphicswebview.h.

Constructor & Destructor Documentation

KGraphicsWebView::KGraphicsWebView ( QGraphicsItem *  parent = 0,
bool  createCustomPage = true 
)
explicit

Constructs a KGraphicsWebView object with parent parent.

Set createCustomPage to false to prevent the creation of a KWebPage object for KDE integration. Doing so allows you to avoid unnecessary object creation and deletion if you are going to use a subclass of KWebPage.

Parameters
parentthe parent object
createCustomPageif true, the view's page is set to an instance of KWebPage

Definition at line 35 of file kgraphicswebview.cpp.

KGraphicsWebView::~KGraphicsWebView ( )

Destroys the KGraphicsWebView.

Definition at line 43 of file kgraphicswebview.cpp.

Member Function Documentation

bool KGraphicsWebView::isExternalContentAllowed ( ) const

Returns true if access to remote content is allowed.

By default access to remote content is allowed.

See also
setAllowExternalContent()
KWebPage::isExternalContentAllowed()

Definition at line 48 of file kgraphicswebview.cpp.

void KGraphicsWebView::linkMiddleOrCtrlClicked ( const KUrl &  url)
signal

Emitted when a link is clicked with the middle mouse button or clicked with the left mouse button while CTRL is held down.

Typically, the user would expect this to result in the URL being opened in a new tab or window.

Parameters
urlthe URL of the clicked link
void KGraphicsWebView::linkShiftClicked ( const KUrl &  url)
signal

Emitted when a link is clicked with the left mouse button while SHIFT is held down.

A KDE user would typically expect this to result in the triggering of a "save link as" action.

Parameters
urlthe URL of the clicked link
void KGraphicsWebView::mousePressEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual
Reimplemented from superclass.

Reimplemented for internal reasons, the API is not affected.

See also
QWidget::mousePressEvent

Definition at line 68 of file kgraphicswebview.cpp.

void KGraphicsWebView::mouseReleaseEvent ( QGraphicsSceneMouseEvent *  event)
protectedvirtual
Reimplemented from superclass.

Reimplemented for internal reasons, the API is not affected.

See also
QWidget::mouseReleaseEvent

Definition at line 75 of file kgraphicswebview.cpp.

void KGraphicsWebView::selectionClipboardUrlPasted ( const KUrl &  url)
signal

Emitted when a URL from the selection clipboard is pasted on this view.

This is triggered when the user clicks on the page with the middle mouse button when there is something in the global mouse selection clipboard. This is typically only possible on X11.

Uri filters are applied to the selection clipboard to generate url.

If the content in the selection clipboard is not a valid url and a default search engine is configured, url will be set to a query to the default search engine.

Parameters
urlurl generated from the selection clipboard content
Deprecated:
use selectionClipboardUrlPasted(KUrl, bool) instead
See also
QClipboard
void KGraphicsWebView::selectionClipboardUrlPasted ( const KUrl &  url,
const QString &  searchText 
)
signal

Emitted when a URL from the selection clipboard is pasted on this view.

This is triggered when the user clicks on the page with the middle mouse button when there is something in the global mouse selection clipboard. This is typically only possible on X11.

Uri filters are applied to the selection clipboard to generate url.

If the content in the selection clipboard is not a valid URL and a default search engine is configured, searchText will be set to the content of the clipboard (250 characters maximum) and url will be set to a query to the default search engine.

Parameters
urlthe URL generated from the selection clipboard content
searchTextcontent of the selection clipboard if it is not a valid URL
See also
KUriFilter
QClipboard
Since
4.6
void KGraphicsWebView::setAllowExternalContent ( bool  allow)

Set allow to false if you want to prevent access to remote content.

If this function is set to false only resources on the local system can be accessed through this class. By default fetching external content is allowed.

See also
isExternalContentAllowed()
KWebPage::setAllowExternalContent(bool)

Definition at line 53 of file kgraphicswebview.cpp.

void KGraphicsWebView::wheelEvent ( QGraphicsSceneWheelEvent *  event)
protected
Reimplemented from superclass.

Reimplemented for internal reasons, the API is not affected.

See also
QWidget::wheelEvent

Definition at line 58 of file kgraphicswebview.cpp.


The documentation for this class was generated from the following files:
  • kgraphicswebview.h
  • kgraphicswebview.cpp
This file is part of the KDE documentation.
Documentation copyright © 1996-2014 The KDE developers.
Generated on Tue Oct 14 2014 22:51:09 by doxygen 1.8.7 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.

KDEWebKit

Skip menu "KDEWebKit"
  • Main Page
  • Alphabetical List
  • Class List
  • Class Hierarchy
  • Class Members
  • File List
  • File Members
  • Related Pages

kdelibs API Reference

Skip menu "kdelibs API Reference"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDEWebKit
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  • kjsembed
  •   WTF
  • KNewStuff
  • KParts
  • KPty
  • Kross
  • KUnitConversion
  • KUtils
  • Nepomuk
  • Nepomuk-Core
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver

Search



Report problems with this website to our bug tracking system.
Contact the specific authors with questions and comments about the page contents.

KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal