[Prev: Creating Scripts Using Qt Script for Applications] [Home]

QSA Input Dialog Framework

Enabling the Use of the QSA Input Dialog Framework

To get access to the QSA Input Dialog framework in the interpreter you need to instanciate the QSInputDialogFactory and add it to the interpreter, using the function QSInterpreter::addObjectFactory(QSObjectFactory *).

QSProject project;
QSInputDialogFactory inputDialogFactory;
QSInterpreter *interpreter = project.interpreter();
interpreter->addObjectFactory( &inputDialogFactory );

The following is a list of QSA's public classes and their properties:

CheckBox

The CheckBox widget provides a checkbox with a text label. CheckBox is an option button; it can be switched on (checked) or off (unchecked).

Properties

ComboBox

The ComboBox widget is a combined button and popup list. A combobox is a selection widget which displays the current item and can pop up a list of items. A combobox may be editable in which case the user can enter arbitrary strings.

Properties

DateEdit

The DateEdit class provides a date editor. DateEdit allows the user to edit dates by using the keyboard or the arrow keys to increase/decrease date values. The arrow keys can be used to move from section to section within the DateEdit box. Dates appear in accordance with the local date/time settings or in year, month, day order if the system doesn't provide this information.

Properties

Dialog

The Dialog class is the base class of dialog windows.A dialog window is a top-level window mostly used for short-term tasks and brief communications with the user. Dialogs may be modal or modeless.

Properties

Input

The Input class provides a simple convenience dialog to get a single value from the user.

Properties

GroupBox

The GroupBox widget provides a group box frame with a title and it displays various other widgets inside itself.

Properties

LineEdit

The QLineEdit widget is a one-line text editor.

Properties

NumberEdit

The NumberEdit class provides range checking of floating-point numbers. NumberEdit provides an upper bound, a lower bound and a limit on the number of digits after the decimal point.

Properties

RadioButton

The RadioButton widget provides a radio button with a text label. RadioButton is an option button; it can be switched on (checked) or off (unchecked).

Properties

SpinBox

The SpinBox class provides a spin box widget (spin button). SpinBox allows the user to choose a value either by clicking the up/down buttons to increase/decrease the value currently displayed or by typing the value directly into the spin box. If the value is entered directly into the spin box, Enter (or Return) must be pressed to apply the new value. The value is usually an integer.

Properties

TextEdit

The QTextEdit widget provides a multi-line text editor.

Properties

TimeEdit

The TimeEdit class provides a time editor. TimeEdit allows the user to edit times by using the keyboard or the arrow keys to increase/decrease time values. The arrow keys can be used to move from section to section within the TimeEdit box.

Properties

Convenience Functions

Convenience classes with static functions provide a means of getting a value from the user without using any complex widget hierarchies.

Message Box

This class provides a simple way of popping up a message box window for the user. The following lines of code present a pop up messagebox with a warning and query the user to click Yes or No.

MessageBox.warning( "Do you wish to abort!", MessageBox.Yes, MessageBox.No );

Properties

Button types

The button types are used to describe what the text of the buttons should be. The following are available.

Functions

The following is a list of message box functions. Each function returns the button type corresponding to the one that the user pressed.

File Dialog

This class provides dialogs that allow users to select files or directories.

Properties

Functions

Input

This class provides convenience functions for getting simple input from the user.

Functions