Screen Object
Information about screens. In order to use this Screen
object, the Squish screen
library has to be included in the script file, and Squish must be hooked into/attached to an AUT.
source(findFile("scripts", "javascript/screen.js")); function main() { startApplication("myaut"); // ... var scr = Screen.byIndex(0); var geom = scr.geometry; test.log("Screen is " + geom.width + " by " + geom.height); }
use strict; use utf8; use warnings; use Squish::Screen; sub main { startApplication("myaut"); # ... my $scr = Squish::Screen->byIndex(0); my $geom = $scr->geometry; test::log("Screen is " . $geom->width . " by " . $geom->height); }
# -*- coding: utf-8 -*- from screen import Screen def main(): startApplication("myaut") # ... scr = Screen.byIndex(0) geom = scr.geometry test.log("Screen is " + str(geom.width) + " by " + str(geom.height))
# encoding: UTF-8 require 'squish' require 'squish/screen' def main startApplication("myaut") # ... scr = Screen::byIndex(0) geom = scr.geometry Test.log("Screen is " + geom.width.to_s + " by " + geom.height.to_s)
package require squish::screen # ... set scr [Squish::Screen byIndex 0] set geom [$scr geometry] test log [concat "Screen is " [property get $geom width] " by " [property get $geom height]]
Screen.count()
This method returns the number of Screen
objects available.
Screen.byIndex(index)
This method returns a Screen
object. The specified index
must be in the range of 0
till Screen.count() - 1
.
index
Read-only property of a Screen
object which is the index of this Screen
object in the list of all available Screen
objects.
geometry
Read-only property of a Screen
object that returns a ScreenRectangle containing the dimensions of this Screen
object.
orientation
Read-Write property of a Screen
object specifying the orientation of this Screen
using one of the following 4 properties. Instead of the following properties it's also possible to use numbers to specify the orientation, 1 for LandscapeOrientation, 2 for PortraitOrientation, 4 for ReverseLandscapeOrientation and 8 for ReversePortraitOrientation.
Screen.LandscapeOrientation
Screen.PortraitOrientation
Screen.ReverseLandscapeOrientation
Screen.ReversePortraitOrientation
Note: Due to language constraints, these orientation properties start with a lowercase letter.
© 2024 The Qt Company Ltd.
Documentation contributions included herein are the copyrights of
their respective owners.
The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation.
Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property
of their respective owners.