ViewScriptInterface Class

The ViewScriptInterface class enables you to manage generic device and display properties. More...

Header: #include <ViewScriptInterface>

Public Types

enum Orientation { topUp, topDown, leftUp, rightUp }


Public Functions

int currentDeviceIndex() const
QString currentDeviceName() const
int deviceCount() const
QString deviceOrientation() const
int displayHeight() const
int displayWidth() const
void setDevice(const QString &dev)
void setDevice(int index)
bool setDeviceOrientation(QString newOrientation)
void setZoom(int z)
QStringList supportedOrientations() const
int zoom() const

Detailed Description

The ViewScriptInterface class enables you to manage generic device and display properties.

Some devices are predefined for the emulator. The device determines the screen size, default orientation, and resolution of the screen.

The ViewScriptInterface class is exposed as emulator.

Member Type Documentation

enum ViewScriptInterface::Orientation

This enum type holds the orientation of the device.

ViewScriptInterface::topUp0x0000001The top of the device is pointing up.
ViewScriptInterface::topDown0x0000002The device is upside down.
ViewScriptInterface::leftUp0x0000004The left side of the device is pointing up.
ViewScriptInterface::rightUp0x0000008The right side of the device is pointing up.

Property Documentation

zoom : int

This property holds the device scaling.

The value can be between between 0 for real-world size and 100 for pixel equivalence.

Access functions:

int zoom() const
void setZoom(int z)

Member Function Documentation

int ViewScriptInterface::currentDeviceIndex() const

Returns the index of the current device.

See also setDevice() and deviceCount().

QString ViewScriptInterface::currentDeviceName() const

Returns the name of the current device.

See also setDevice().

int ViewScriptInterface::deviceCount() const

Returns the number of available device models.

See also setDevice() and currentDeviceIndex().

QString ViewScriptInterface::deviceOrientation() const

Returns the current device orientation.

See also setDeviceOrientation().

int ViewScriptInterface::displayHeight() const

Returns the height of the device display.

int ViewScriptInterface::displayWidth() const

Returns the width of the device display.

void ViewScriptInterface::setDevice(const QString &dev)

Sets the current device to be the one identified by dev.

See also currentDeviceName().

void ViewScriptInterface::setDevice(int index)

Sets the current device to the one with index.

See also deviceCount() and currentDeviceIndex().

bool ViewScriptInterface::setDeviceOrientation(QString newOrientation)

Rotates the current device to the orientation specified by newOrientation.

Returns true on success.

See also deviceOrientation().

QStringList ViewScriptInterface::supportedOrientations() const

Returns the list of screen orientations.

Available under certain Qt licenses.
Find out more.