QWebInspector Class

The QWebInspector class allows the placement and control of a QWebPage 's inspector. The inspector can display a page's hierarchy, its loading statistics and the current state of its individual elements. It is mostly used by web developers. 更多...

頭: #include <QWebInspector>
Since: Qt 4.6
繼承: QWidget

公共函數

QWebInspector (QWidget * parent = 0)
~QWebInspector ()
QWebPage * page () const
void setPage (QWebPage * page )

重實現公共函數

virtual bool event (QEvent * ev )
virtual QSize sizeHint () const

重實現保護函數

virtual void closeEvent (QCloseEvent * event )
virtual void hideEvent (QHideEvent * event )
virtual void resizeEvent (QResizeEvent * event )
virtual void showEvent (QShowEvent * event )

額外繼承成員

詳細描述

The QWebInspector class allows the placement and control of a QWebPage 's inspector. The inspector can display a page's hierarchy, its loading statistics and the current state of its individual elements. It is mostly used by web developers.

The QWebPage to be inspected must be specified using the setPage () 方法。

A typical use of QWebInspector follows:

    // ...
    QWebPage *page = new QWebPage;
    // ...
    QWebInspector *inspector = new QWebInspector;
    inspector->setPage(page);
					

A QWebInspector can be made visible either programmatically using setVisible (), or by the user through the attached QWebPage 's context menu.

注意: A QWebInspector will display a blank widget if either:

資源

This class acts mostly as a container and a controller for the inspector. Most of the resources needed by the inspector are owned by the associated QWebPage and are allocated the first time that:

Inspector configuration persistence

The inspector allows the user to configure some options through its user interface (e.g. the resource tracking "Always enable" option). These settings will be persisted automatically by QtWebKit only if your application previously called QCoreApplication::setOrganizationName () 和 QCoreApplication::setApplicationName ()。見 QSettings 's default constructor documentation for an explanation of why this is necessary.

成員函數文檔編製

QWebInspector:: QWebInspector ( QWidget * parent = 0)

Constructs an unbound QWebInspector with parent as its parent.

QWebInspector:: ~QWebInspector ()

Destroys the inspector.

[virtual protected] void QWebInspector:: closeEvent ( QCloseEvent * event )

重實現自 QWidget::closeEvent ().

[虛擬] bool QWebInspector:: event ( QEvent * ev )

重實現自 QObject::event ().

[virtual protected] void QWebInspector:: hideEvent ( QHideEvent * event )

重實現自 QWidget::hideEvent ().

QWebPage * QWebInspector:: page () const

Returns the inspected QWebPage . If no web page is currently associated, a null pointer is returned.

另請參閱 setPage ().

[virtual protected] void QWebInspector:: resizeEvent ( QResizeEvent * event )

重實現自 QWidget::resizeEvent ().

void QWebInspector:: setPage ( QWebPage * page )

Bind this inspector to the QWebPage to be inspected.

注意事項:

  • There can only be one QWebInspector associated with a QWebPage and vice versa.
  • Calling this method with a null page will break the current association, if any.
  • page is already associated to another QWebInspector , the association will be replaced and the previous QWebInspector will become unbound

另請參閱 page ().

[virtual protected] void QWebInspector:: showEvent ( QShowEvent * event )

重實現自 QWidget::showEvent ().

[虛擬] QSize QWebInspector:: sizeHint () const

重實現自 QWidget::sizeHint ().