From a30f5359f03c3017fa19a6770fab32d25d22cb87 Mon Sep 17 00:00:00 2001 From: Michele Calgaro Date: Mon, 15 Jul 2024 19:08:22 +0900 Subject: Rename graphics class nt* related files to equivalent tq* (part 1) Signed-off-by: Michele Calgaro --- doc/html/tutorial2-08.html | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) (limited to 'doc/html/tutorial2-08.html') diff --git a/doc/html/tutorial2-08.html b/doc/html/tutorial2-08.html index 05fb03c07..ba69ea915 100644 --- a/doc/html/tutorial2-08.html +++ b/doc/html/tutorial2-08.html @@ -216,10 +216,10 @@ create a blank pixmap of that size. TQString( "%1" ).arg( element.value(), 0, 'f', m_decimalPlaces ) ); - TQColor color = element.valueColor(); + TQColor color = element.valueColor(); pix.fill( color ); table->setPixmap( i, 1, pix ); - table->setText( i, 1, color.name() ); + table->setText( i, 1, color.name() ); TQComboBox *combobox = new TQComboBox; for ( int j = 0; j < MAX_PATTERNS; ++j ) @@ -232,7 +232,7 @@ create a blank pixmap of that size. color = element.labelColor(); pix.fill( color ); table->setPixmap( i, 4, pix ); - table->setText( i, 4, color.name() ); + table->setText( i, 4, color.name() );

For each element in the element vector we must populate the table.

If the element is valid we write its value in the first column (column @@ -290,19 +290,19 @@ function and put the focus back into the table. if ( !( col == 1 || col == 4 ) ) return; - TQColor color = TQColorDialog::getColor( + TQColor color = TQColorDialog::getColor( TQColor( table->text( row, col ) ), this, "color dialog" ); - if ( color.isValid() ) { + if ( color.isValid() ) { TQPixmap pix = table->pixmap( row, col ); pix.fill( color ); table->setPixmap( row, col, pix ); - table->setText( row, col, color.name() ); + table->setText( row, col, color.name() ); } }

If this function is called with the focus on a color cell we call -the static TQColorDialog::getColor() dialog to get the user's choice of +the static TQColorDialog::getColor() dialog to get the user's choice of color. If they chose a color we fill the color cell's pixmap with that color and set the cell's text to the new color's name.

    void SetDataForm::accept()
@@ -328,7 +328,7 @@ color and set the cell's text to the new color's name.
 

If the user clicks OK we must update the elements vector. We iterate over the vector and set each element's value to the value the user has entered or INVALID if the value is invalid. We set the value color -and the label color by constructing TQColor temporaries that take a +and the label color by constructing TQColor temporaries that take a color name as argument. The pattern is set to the pattern combobox's current item with an offset of 1 (since our pattern numbers begin at 1, but the combobox's items are indexed from 0). -- cgit v1.2.3