From fef846914f8db6dc117e206ef913d519bf6bb33e Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 29 Jul 2024 12:43:23 +0900 Subject: Rename basic widget nt* related files to equivalent tq* Signed-off-by: Michele Calgaro --- doc/html/tutorial1-07.html | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) (limited to 'doc/html/tutorial1-07.html') diff --git a/doc/html/tutorial1-07.html b/doc/html/tutorial1-07.html index 5d8fc4bec..0de193aeb 100644 --- a/doc/html/tutorial1-07.html +++ b/doc/html/tutorial1-07.html @@ -62,11 +62,11 @@ header file.

ntqvbox.h is included. LCDRange inherits TQVBox, and the header file of a parent class must always be included. We cheated a bit in the previous chapters, and we let tqwidget.h be included indirectly via -other header files such as ntqpushbutton.h. +other header files such as tqpushbutton.h.

    class TQSlider;
 

This is another classic trick, but one that's much less used often. Because -we don't need TQSlider in the interface of the class, only in the +we don't need TQSlider in the interface of the class, only in the implementation, we use a forward declaration of the class in the header file and include the header file for TQSlider in the .cpp file. @@ -110,9 +110,9 @@ signal you'll see called somethingChanged().

This file is mainly lifted from t6/main.cpp, and only the changes are noted here. -

        connect( slider, TQ_SIGNAL(valueChanged(int)),
-                 lcd, TQ_SLOT(display(int)) );
-        connect( slider, TQ_SIGNAL(valueChanged(int)),
+

        connect( slider, TQ_SIGNAL(valueChanged(int)),
+                 lcd, TQ_SLOT(display(int)) );
+        connect( slider, TQ_SIGNAL(valueChanged(int)),
                  TQ_SIGNAL(valueChanged(int)) );
 

This code is from the LCDRange constructor. @@ -125,23 +125,23 @@ the first is emitted, the second signal is also emitted.

Let's look at what happens when the user operates the slider. The slider sees that its value has changed and emits the valueChanged() signal. That signal is connected both to the display() slot of the -TQLCDNumber and to the valueChanged() signal of the LCDRange. +TQLCDNumber and to the valueChanged() signal of the LCDRange.

Thus, when the signal is emitted, LCDRange emits its own -valueChanged() signal. In addition, TQLCDNumber::display() is called +valueChanged() signal. In addition, TQLCDNumber::display() is called and shows the new number.

Note that you're not guaranteed any particular order of execution - LCDRange::valueChanged() may be emitted before or after TQLCDNumber::display()and is entirely arbitrary.

    int LCDRange::value() const
     {
-        return slider->value();
+        return slider->value();
     }
 

The implementation of value() is straightforward; it simply returns the slider's value.

    void LCDRange::setValue( int value )
     {
-        slider->setValue( value );
+        slider->setValue( value );
     }
 

The implementation of setValue() is equally straightforward. Note -- cgit v1.2.1