diff options
Diffstat (limited to 'doc/tutorial.doc')
-rw-r--r-- | doc/tutorial.doc | 54 |
1 files changed, 27 insertions, 27 deletions
diff --git a/doc/tutorial.doc b/doc/tutorial.doc index 3f25932b9..eff571709 100644 --- a/doc/tutorial.doc +++ b/doc/tutorial.doc @@ -111,7 +111,7 @@ mentions at the top which file needs to be included to use that class. QPushButton is a classical GUI push button that the user can press and release. It manages its own look and feel, like every other \l -QWidget. A widget is a user interface object that can process user +TQWidget. A widget is a user interface object that can process user input and draw graphics. The programmer can change both the overall \link QApplication::setStyle() look and feel\endlink and many minor properties of it (such as color), as well as the widget's content. A @@ -263,14 +263,14 @@ QApplication::setFont()) for the whole application. \printline connect connect() is perhaps \e the most central feature of Qt. -Note that connect() is a static function in QObject. Do not confuse it +Note that connect() is a static function in TQObject. Do not confuse it with the connect() function in the socket library. This line establishes a one-way connection between two TQt objects (objects -that inherit QObject, directly or indirectly). Every TQt object can have +that inherit TQObject, directly or indirectly). Every TQt object can have both \c signals (to send messages) and \c slots (to receive messages). All -widgets are TQt objects. They inherit QWidget which in turn inherits -QObject. +widgets are TQt objects. They inherit TQWidget which in turn inherits +TQObject. Here, the \e clicked() signal of \e quit is connected to the \e quit() slot of \e a, so that when the button is clicked, the @@ -328,7 +328,7 @@ We add an include of ntqvbox.h to get the layout class we'll use. Here we simply create a vertical box container. The QVBox arranges its child widgets in a vertical row, one above the other, handing out -space according to each child's \l QWidget::sizePolicy(). +space according to each child's \l TQWidget::sizePolicy(). \printline resize @@ -350,15 +350,15 @@ the parent has. \printline show When a parent widget is shown, it will call show for all its children -(except those on which you have done an explicit \l QWidget::hide()). +(except those on which you have done an explicit \l TQWidget::hide()). \section1 Behavior The button no longer fills the entire widget. Instead, it gets a "natural" size. This is because there is now a new top-level widget, which uses the button's size hint and size change policy to set the -button's size and position. (See \l QWidget::sizeHint() and \l -QWidget::setSizePolicy() for more information about these functions.) +button's size and position. (See \l TQWidget::sizeHint() and \l +TQWidget::setSizePolicy() for more information about these functions.) (See \link tutorial1-01.html#compiling Compiling\endlink for how to create a makefile and build the application.) @@ -395,12 +395,12 @@ minimum and maximum sizes of a widget, and introduces widget names. \skipto MyWidget \printuntil } -Here we create a new class. Because this class inherits from QWidget, +Here we create a new class. Because this class inherits from TQWidget, the new class is a widget and may be a top level window or a child widget (like the push button in Chapter 3). This class has only one member, a constructor (in addition to the -members it inherits from QWidget). The constructor is a standard Qt +members it inherits from TQWidget). The constructor is a standard Qt widget constructor; you should always include a similar constructor when you create widgets. @@ -411,15 +411,15 @@ defaults to be a top-level window. The second argument is the widget's name. This is \e not the text that appears in the window's title bar or in the button. It is a name associated with a widget to make it possible to \link -QObject::queryList() look up \endlink this widget later, and there is -also a \link QObject::dumpObjectTree() handy debugging function +TQObject::queryList() look up \endlink this widget later, and there is +also a \link TQObject::dumpObjectTree() handy debugging function \endlink that will list a complete widget hierarchy. \printline MyWidget -\printline QWidget +\printline TQWidget The implementation of the constructor starts here. Like most widgets, -it just passes on the \c parent and \c name to the QWidget +it just passes on the \c parent and \c name to the TQWidget constructor. \printuntil setMaximumSize @@ -514,7 +514,7 @@ here because we use Qt's automatic layout support. \target constructor \printuntil { -MyWidget is now derived from QVBox instead of QWidget. That way we use +MyWidget is now derived from QVBox instead of TQWidget. That way we use the layout of the QVBox (which places all of its children vertically inside itself). Resizes are now handled automatically by the QVBox and therefore by MyWidget, too. @@ -931,7 +931,7 @@ CannonField is a new custom widget that knows how to display itself. \skipto class \printuntil parent=0 -CannonField inherits QWidget, and we use the same idiom as for LCDRange. +CannonField inherits TQWidget, and we use the same idiom as for LCDRange. \printuntil angleChanged @@ -941,7 +941,7 @@ provide an interface using the same idiom as for value in LCDRange. \printline protected \printline paintEvent -This is the second of the many event handlers in QWidget that we +This is the second of the many event handlers in TQWidget that we encounter. This virtual function is called by TQt whenever a widget needs to update itself (i.e., paint the widget's surface). @@ -977,7 +977,7 @@ important to only emit the signal angleChanged() when the angle \e really has changed. Then we set the new angle value and repaint our widget. The \l -QWidget::repaint() function clears the widget (usually filling it with +TQWidget::repaint() function clears the widget (usually filling it with its background color) and sends a paint event to the widget. This results in a call to the paint event function of the widget. @@ -995,7 +995,7 @@ contains the region in the widget that must be updated. For the time being, we will be lazy and just paint everything. Our code displays the angle value in the widget at a fixed position. -First we create a QString with some text and the angle; then we create +First we create a TQString with some text and the angle; then we create a QPainter operating on this widget and use it to paint the string. We'll come back to QPainter later; it can do a great many things. @@ -1428,7 +1428,7 @@ coordinates. First we create a rectangle with the size 50x50 and then move it so its bottom left corner is equal to the widget's own bottom- left corner. -The \l QWidget::rect() function returns the widget's enclosing +The \l TQWidget::rect() function returns the widget's enclosing rectangle in the widget's own coordinates (where the top left corner is 0, 0). @@ -2011,7 +2011,7 @@ Make a moving target. Make sure that the target is always created entirely on-screen. Make sure that the widget cannot be resized so that the target isn't -visible. Hint: \l QWidget::setMinimumSize() is your friend. +visible. Hint: \l TQWidget::setMinimumSize() is your friend. Not easy; make it possible to have several shots in the air at the same time. Hint: make a Shot object. @@ -2071,9 +2071,9 @@ implementation. \quotefile t13/lcdrange.h \skipto include -\printuntil QWidget +\printuntil TQWidget -We inherit QWidget rather than QVBox. QVBox is very easy to use, but +We inherit TQWidget rather than QVBox. QVBox is very easy to use, but again it showed its limitations so we switch to the more powerful and slightly harder to use QVBoxLayout. (As you remember, QVBoxLayout is not a widget, it manages one.) @@ -2089,9 +2089,9 @@ We need to include ntqlayout.h now to get the other layout management API. \printline LCDRange -\printline QWidget +\printline TQWidget -We inherit QWidget in the usual way. +We inherit TQWidget in the usual way. The other constructor has the same change. init() is unchanged, except that we've added some lines at the end: @@ -2487,7 +2487,7 @@ coordinate system. This is another TQt event handler. It is called when the user already has pressed the mouse button inside this widget and then moves/drags the mouse. (You can make TQt send mouse move events even when no -buttons are pressed. See \l QWidget::setMouseTracking().) +buttons are pressed. See \l TQWidget::setMouseTracking().) This handler repositions the cannon's barrel according to the position of the mouse cursor. |