UiTypes Namespace

Squish provides the UiTypes namespace (in languages where namespaces make sense) through which items of generic types can be created.

DateTime Type

The UiTypes.DateTime type (plain DateTime in Tcl) is capable of holding a date and time value.

DateTime UiTypes.DateTime()

DateTime UiTypes.DateTime(year, month, dayOfMonth)

DateTime UiTypes.DateTime(year, month, dayOfMonth, hour, minute, second)

This construction function creates a DateTime object. If no arguments are given all the values are set to -1 (i.e., the DateTime is invalid). Here is how to create a valid DateTime:

moonLanding = UiTypes.DateTime(1969, 7, 20)
var moonLanding = new UiTypes.DateTime(1969, 7, 20);
my $moonLanding = UiTypes::DateTime->new(1969, 7, 20);
moonLanding = UiTypes::DateTime.new(1969, 7, 20)
set moonLanding [construct DateTime 1969 7 20]

The Squish UiTypes namespace is inside the Squish namespace that is automatically imported into test scripts—except for Ruby where the script file should begin with a require 'squish' statement.

DateTime objects have the following properties:

int UiTypes.DateTime.year

This read/write property holds the date/time's year.

int UiTypes.DateTime.month

This read/write property holds the date/time's month (1-12).

int UiTypes.DateTime.day

This read/write property holds the date/time's day of the month (1-31).

int UiTypes.DateTime.hour

This read/write property holds the date/time's hour (0-23).

int UiTypes.DateTime.minute

This read/write property holds the date/time's minutes (0-59).

int UiTypes.DateTime.second

This read/write property holds the date/time's seconds (0-59).

UiTypes.ScreenPoint Class

A point element representing a position on screen. Objects of this type have the following properties:

Integer x

Read/write property that specifies the horizontal coordinate of this point.

Integer y

Read/write property that specifies the vertical coordinate of this point.

UiTypes.ScreenRectangle Class

A rectangle type that represents a screen position and size.

ScreenRectangle UiTypes.ScreenRectangle()

Constructs an invalid ScreenRectangle whose properties are all set to the value -1.

ScreenRectangle UiTypes.ScreenRectangle(otherScreenRectangle)

Constructs a copy of otherScreenRectangle.

ScreenRectangle UiTypes.ScreenRectangle(x, y, width, height)

Constructs a ScreenRectangle with the given position and size.

someRect = UiTypes.ScreenRectangle(13, 27, 800, 600)
var someRect = new UiTypes.ScreenRectangle(13, 27, 800, 600);
my $someRect = UiTypes::ScreenRectangle->new(13, 27, 800, 600);
someRect = UiTypes::ScreenRectangle.new(13, 27, 800, 600)
set someRect [construct ScreenRectangle 13 27 800 600]

Integer x

The x-coordinate of the rectangle's left edge or -1 in case of an invalid object.

Integer y

The y-coordinate of the rectangle's top edge or -1 in case of an invalid object.

Integer width

The width of the rectangle or -1 in case of an invalid object.

Integer height

The height of the rectangle or -1 in case of an invalid object.

ScreenPoint center()

Returns the center of the rectangle object as a ScreenPoint object.

© 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.

Search Results