QWebPage.ViewportAttributes Class Reference

[ QtWebKit module]

The QWebPage.ViewportAttributes class describes hints that can be applied to a viewport. 更多...

方法


详细描述

The QWebPage.ViewportAttributes class describes hints that can be applied to a viewport.

QWebPage.ViewportAttributes provides a description of a viewport, such as viewport geometry, initial scale factor with limits, plus information about whether a user should be able to scale the contents in the viewport or not, ie. by zooming.

ViewportAttributes can be set by a web author using the viewport meta tag extension, documented at Safari Reference Library: Using the Viewport Meta Tag .

All values might not be set, as such when dealing with the hints, the developer needs to check whether the values are valid. Negative values denote an invalid qreal value.


方法文档编制

ViewportAttributes.__init__ ( self )

构造空 QWebPage.ViewportAttributes .

ViewportAttributes.__init__ ( self , ViewportAttributes   other )

构造 QWebPage.ViewportAttributes which is a copy from other .

float ViewportAttributes.devicePixelRatio ( self )

float ViewportAttributes.initialScaleFactor ( self )

Returns the initial scale of the viewport as a multiplier.

bool ViewportAttributes.isUserScalable ( self )

Determines whether or not the scale can be modified by the user.

bool ViewportAttributes.isValid ( self )

Returns whether this is a valid ViewportAttributes or not.

An invalid ViewportAttributes will have 空 QSize , negative values for scale factors and true for the boolean isUserScalable.

float ViewportAttributes.maximumScaleFactor ( self )

Returns the maximum scale value of the viewport as a multiplier.

float ViewportAttributes.minimumScaleFactor ( self )

Returns the minimum scale value of the viewport as a multiplier.

QSize ViewportAttributes.size ( self )

Returns the size of the viewport.