...
No Format | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
qsetattribute deleteonclose |
If this attribute was not set, closing the widget would merely make it invisible while still residing in memory, though sometimes this is the desired behaviour. When the deleteonclose attribute is set redisplaying the widget requires the whole widget to be recreated.
...
No Format | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
qsetwindowtitle "Hello" |
The qsetwindowtitle command sets the window title. While there may be several windows available, QTcl will simply apply the command to the most recently created widget, which in this case is the QWidget window. The most recently created widget is also the so-called current widget. It does not matter whether the widget is visible or not. This is in fact how most Qt commands work.
...
No Format | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
qvboxlayout { } |
The qvboxlayout command creates a layout manager for the window. A layout manager is also known as a geometry manager. The task of the layout manager is to arrange the widgets in a particular order. For instance, the QVBoxLayout layout manager stacks widgets vertically in their order of creation. There are two other layout managers in QTcl:
...
No Format | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
qpushbutton "Hello world!" |
The command qpushbutton creates the conventional button found in user interfaces. There are several types of buttons available in QTcl. Right now this button only has one argument which is the button text. Thus we need a second argument to tell the button what to do when being clicked.
...
No Format | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
qinformation Information "Hello world!" |
This command displays a simple information dialog with an 'OK' button.
...
No Format | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|
| ||||||||||
qshow $w |
QTcl will then draw the most recently created widget, or current widget, on to the screen. In this case the current widget is the window, which is then displayed along with its contents.
...