summaryrefslogtreecommitdiffstats
path: root/doc/html/tutorial2-08.html
diff options
context:
space:
mode:
authorTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-26 23:32:43 -0600
committerTimothy Pearson <kb9vqf@pearsoncomputing.net>2012-01-26 23:32:43 -0600
commitea318d1431c89e647598c510c4245c6571aa5f46 (patch)
tree996d29b80c30d453dda86d1a23162d441628f169 /doc/html/tutorial2-08.html
parentaaf89d4b48f69c9293feb187db26362e550b5561 (diff)
downloadtqt3-ea318d1431c89e647598c510c4245c6571aa5f46.tar.gz
tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.zip
Update to latest tqt3 automated conversion
Diffstat (limited to 'doc/html/tutorial2-08.html')
-rw-r--r--doc/html/tutorial2-08.html174
1 files changed, 87 insertions, 87 deletions
diff --git a/doc/html/tutorial2-08.html b/doc/html/tutorial2-08.html
index ebffded5..331ee3db 100644
--- a/doc/html/tutorial2-08.html
+++ b/doc/html/tutorial2-08.html
@@ -40,12 +40,12 @@ enter label text and choose a label color for each label.
<p> (Extracts from <tt>setdataform.h</tt>.)
<p>
-<pre> class SetDataForm: public <a href="qdialog.html">TQDialog</a>
+<pre> class SetDataForm: public <a href="ntqdialog.html">TQDialog</a>
{
<a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a>
public:
SetDataForm( ElementVector *elements, int decimalPlaces,
- <a href="qwidget.html">TQWidget</a> *parent = 0, const char *name = "set data form",
+ <a href="ntqwidget.html">TQWidget</a> *parent = 0, const char *name = "set data form",
bool modal = TRUE, WFlags f = 0 );
~SetDataForm() {}
@@ -59,10 +59,10 @@ enter label text and choose a label color for each label.
void accept();
private:
- <a href="qtable.html">TQTable</a> *table;
- <a href="qpushbutton.html">TQPushButton</a> *colorPushButton;
- <a href="qpushbutton.html">TQPushButton</a> *okPushButton;
- <a href="qpushbutton.html">TQPushButton</a> *cancelPushButton;
+ <a href="ntqtable.html">TQTable</a> *table;
+ <a href="ntqpushbutton.html">TQPushButton</a> *colorPushButton;
+ <a href="ntqpushbutton.html">TQPushButton</a> *okPushButton;
+ <a href="ntqpushbutton.html">TQPushButton</a> *cancelPushButton;
protected:
<a href="qvboxlayout.html">TQVBoxLayout</a> *tableButtonBox;
@@ -88,20 +88,20 @@ TQt supports. We'll use these in the pattern combobox.
<p> <h2> The Constructor
</h2>
<a name="1"></a><p> <pre> SetDataForm::SetDataForm( ElementVector *elements, int decimalPlaces,
- <a href="qwidget.html">TQWidget</a>* parent, const char* name,
+ <a href="ntqwidget.html">TQWidget</a>* parent, const char* name,
bool modal, WFlags f )
- : <a href="qdialog.html">TQDialog</a>( parent, name, modal, f )
+ : <a href="ntqdialog.html">TQDialog</a>( parent, name, modal, f )
{
m_elements = elements;
m_decimalPlaces = decimalPlaces;
</pre>
-<p> We pass most of the arguments to the <a href="qdialog.html">TQDialog</a> superclass. We assign the
+<p> We pass most of the arguments to the <a href="ntqdialog.html">TQDialog</a> superclass. We assign the
elements vector pointer and the number of decimal places to display to
member variables so that they are accessible by all SetDataForm's
member functions.
-<p> <pre> <a href="qwidget.html#setCaption">setCaption</a>( "Chart -- Set Data" );
- <a href="qwidget.html#resize">resize</a>( 540, 440 );
+<p> <pre> <a href="ntqwidget.html#setCaption">setCaption</a>( "Chart -- Set Data" );
+ <a href="ntqwidget.html#resize">resize</a>( 540, 440 );
</pre>
<p> We set a caption for the dialog and resize it.
<p> <pre> tableButtonBox = new <a href="qvboxlayout.html">TQVBoxLayout</a>( this, 11, 6, "table button box layout" );
@@ -109,26 +109,26 @@ member functions.
<p> The layout of the form is quite simple. The buttons will be grouped
together in a horizontal layout and the table and the button layout
will be grouped together vertically using the tableButtonBox layout.
-<p> <pre> table = new <a href="qtable.html">TQTable</a>( this, "data table" );
- <a name="x2621"></a> table-&gt;<a href="qtable.html#setNumCols">setNumCols</a>( 5 );
- <a name="x2622"></a> table-&gt;<a href="qtable.html#setNumRows">setNumRows</a>( ChartForm::MAX_ELEMENTS );
- <a name="x2619"></a> table-&gt;<a href="qtable.html#setColumnReadOnly">setColumnReadOnly</a>( 1, TRUE );
- table-&gt;<a href="qtable.html#setColumnReadOnly">setColumnReadOnly</a>( 2, TRUE );
- table-&gt;<a href="qtable.html#setColumnReadOnly">setColumnReadOnly</a>( 4, TRUE );
- <a name="x2620"></a> table-&gt;<a href="qtable.html#setColumnWidth">setColumnWidth</a>( 0, 80 );
- table-&gt;<a href="qtable.html#setColumnWidth">setColumnWidth</a>( 1, 60 ); // Columns 1 and 4 must be equal
- table-&gt;<a href="qtable.html#setColumnWidth">setColumnWidth</a>( 2, 60 );
- table-&gt;<a href="qtable.html#setColumnWidth">setColumnWidth</a>( 3, 200 );
- table-&gt;<a href="qtable.html#setColumnWidth">setColumnWidth</a>( 4, 60 );
- <a name="x2616"></a> <a href="qheader.html">TQHeader</a> *th = table-&gt;<a href="qtable.html#horizontalHeader">horizontalHeader</a>();
- <a name="x2605"></a> th-&gt;<a href="qheader.html#setLabel">setLabel</a>( 0, "Value" );
- th-&gt;<a href="qheader.html#setLabel">setLabel</a>( 1, "Color" );
- th-&gt;<a href="qheader.html#setLabel">setLabel</a>( 2, "Pattern" );
- th-&gt;<a href="qheader.html#setLabel">setLabel</a>( 3, "Label" );
- th-&gt;<a href="qheader.html#setLabel">setLabel</a>( 4, "Color" );
+<p> <pre> table = new <a href="ntqtable.html">TQTable</a>( this, "data table" );
+ <a name="x2621"></a> table-&gt;<a href="ntqtable.html#setNumCols">setNumCols</a>( 5 );
+ <a name="x2622"></a> table-&gt;<a href="ntqtable.html#setNumRows">setNumRows</a>( ChartForm::MAX_ELEMENTS );
+ <a name="x2619"></a> table-&gt;<a href="ntqtable.html#setColumnReadOnly">setColumnReadOnly</a>( 1, TRUE );
+ table-&gt;<a href="ntqtable.html#setColumnReadOnly">setColumnReadOnly</a>( 2, TRUE );
+ table-&gt;<a href="ntqtable.html#setColumnReadOnly">setColumnReadOnly</a>( 4, TRUE );
+ <a name="x2620"></a> table-&gt;<a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 0, 80 );
+ table-&gt;<a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 1, 60 ); // Columns 1 and 4 must be equal
+ table-&gt;<a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 2, 60 );
+ table-&gt;<a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 3, 200 );
+ table-&gt;<a href="ntqtable.html#setColumnWidth">setColumnWidth</a>( 4, 60 );
+ <a name="x2616"></a> <a href="ntqheader.html">TQHeader</a> *th = table-&gt;<a href="ntqtable.html#horizontalHeader">horizontalHeader</a>();
+ <a name="x2605"></a> th-&gt;<a href="ntqheader.html#setLabel">setLabel</a>( 0, "Value" );
+ th-&gt;<a href="ntqheader.html#setLabel">setLabel</a>( 1, "Color" );
+ th-&gt;<a href="ntqheader.html#setLabel">setLabel</a>( 2, "Pattern" );
+ th-&gt;<a href="ntqheader.html#setLabel">setLabel</a>( 3, "Label" );
+ th-&gt;<a href="ntqheader.html#setLabel">setLabel</a>( 4, "Color" );
tableButtonBox-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( table );
</pre>
-<p> We create a new <a href="qtable.html">TQTable</a> with five columns, and the same number of rows
+<p> We create a new <a href="ntqtable.html">TQTable</a> with five columns, and the same number of rows
as we have elements in the elements vector. We make the color and
pattern columns read only: this is to prevent the user typing in them.
We will make the color changeable by the user clicking on a color or
@@ -139,9 +139,9 @@ column and finally add the table to the tableButtonBox layout.
<p> <pre> buttonBox = new <a href="qhboxlayout.html">TQHBoxLayout</a>( 0, 0, 6, "button box layout" );
</pre>
<p> We create a horizontal box layout to hold the buttons.
-<p> <pre> colorPushButton = new <a href="qpushbutton.html">TQPushButton</a>( this, "color button" );
- <a name="x2598"></a> colorPushButton-&gt;<a href="qbutton.html#setText">setText</a>( "&amp;Color..." );
- colorPushButton-&gt;<a href="qwidget.html#setEnabled">setEnabled</a>( FALSE );
+<p> <pre> colorPushButton = new <a href="ntqpushbutton.html">TQPushButton</a>( this, "color button" );
+ <a name="x2598"></a> colorPushButton-&gt;<a href="ntqbutton.html#setText">setText</a>( "&amp;Color..." );
+ colorPushButton-&gt;<a href="ntqwidget.html#setEnabled">setEnabled</a>( FALSE );
buttonBox-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( colorPushButton );
</pre>
<p> We create a color button and add it to the buttonBox layout. We
@@ -153,14 +153,14 @@ on a color cell.
</pre>
<p> Since we want to separate the color button from the OK and Cancel
buttons we next create a spacer and add that to the buttonBox layout.
-<p> <pre> okPushButton = new <a href="qpushbutton.html">TQPushButton</a>( this, "ok button" );
- okPushButton-&gt;<a href="qbutton.html#setText">setText</a>( "OK" );
- <a name="x2607"></a> okPushButton-&gt;<a href="qpushbutton.html#setDefault">setDefault</a>( TRUE );
+<p> <pre> okPushButton = new <a href="ntqpushbutton.html">TQPushButton</a>( this, "ok button" );
+ okPushButton-&gt;<a href="ntqbutton.html#setText">setText</a>( "OK" );
+ <a name="x2607"></a> okPushButton-&gt;<a href="ntqpushbutton.html#setDefault">setDefault</a>( TRUE );
buttonBox-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( okPushButton );
- cancelPushButton = new <a href="qpushbutton.html">TQPushButton</a>( this, "cancel button" );
- cancelPushButton-&gt;<a href="qbutton.html#setText">setText</a>( "Cancel" );
- <a name="x2597"></a> cancelPushButton-&gt;<a href="qbutton.html#setAccel">setAccel</a>( Key_Escape );
+ cancelPushButton = new <a href="ntqpushbutton.html">TQPushButton</a>( this, "cancel button" );
+ cancelPushButton-&gt;<a href="ntqbutton.html#setText">setText</a>( "Cancel" );
+ <a name="x2597"></a> cancelPushButton-&gt;<a href="ntqbutton.html#setAccel">setAccel</a>( Key_Escape );
buttonBox-&gt;<a href="qboxlayout.html#addWidget">addWidget</a>( cancelPushButton );
</pre>
<p> The OK and Cancel buttons are created and added to the buttonBox. We
@@ -170,22 +170,22 @@ key an accelerator for the Cancel button.
</pre>
<p> We add the buttonBox layout to the tableButtonBox and the layout is
complete.
-<p> <pre> <a name="x2612"></a> <a href="qobject.html#connect">connect</a>( table, SIGNAL( <a href="qtable.html#clicked">clicked</a>(int,int,int,const <a href="qpoint.html">TQPoint</a>&amp;) ),
+<p> <pre> <a name="x2612"></a> <a href="ntqobject.html#connect">connect</a>( table, SIGNAL( <a href="ntqtable.html#clicked">clicked</a>(int,int,int,const <a href="ntqpoint.html">TQPoint</a>&amp;) ),
this, SLOT( setColor(int,int) ) );
- <a name="x2613"></a> <a href="qobject.html#connect">connect</a>( table, SIGNAL( <a href="qtable.html#currentChanged">currentChanged</a>(int,int) ),
+ <a name="x2613"></a> <a href="ntqobject.html#connect">connect</a>( table, SIGNAL( <a href="ntqtable.html#currentChanged">currentChanged</a>(int,int) ),
this, SLOT( currentChanged(int,int) ) );
- <a name="x2626"></a> <a href="qobject.html#connect">connect</a>( table, SIGNAL( <a href="qtable.html#valueChanged">valueChanged</a>(int,int) ),
+ <a name="x2626"></a> <a href="ntqobject.html#connect">connect</a>( table, SIGNAL( <a href="ntqtable.html#valueChanged">valueChanged</a>(int,int) ),
this, SLOT( valueChanged(int,int) ) );
- <a name="x2596"></a> <a href="qobject.html#connect">connect</a>( colorPushButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), this, SLOT( setColor() ) );
- <a href="qobject.html#connect">connect</a>( okPushButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), this, SLOT( <a href="qdialog.html#accept">accept</a>() ) );
- <a href="qobject.html#connect">connect</a>( cancelPushButton, SIGNAL( <a href="qbutton.html#clicked">clicked</a>() ), this, SLOT( <a href="qdialog.html#reject">reject</a>() ) );
+ <a name="x2596"></a> <a href="ntqobject.html#connect">connect</a>( colorPushButton, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( setColor() ) );
+ <a href="ntqobject.html#connect">connect</a>( okPushButton, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( <a href="ntqdialog.html#accept">accept</a>() ) );
+ <a href="ntqobject.html#connect">connect</a>( cancelPushButton, SIGNAL( <a href="ntqbutton.html#clicked">clicked</a>() ), this, SLOT( <a href="ntqdialog.html#reject">reject</a>() ) );
</pre>
<p> We now "wire up" the form.
<ul>
<li> If the user clicks a cell we call the setColor() slot; this will
check that the cell is one that holds a color, and if it is, will
invoke the color dialog.
-<li> We connect the <a href="qtable.html">TQTable</a>'s currentChanged() signal to our own
+<li> We connect the <a href="ntqtable.html">TQTable</a>'s currentChanged() signal to our own
currentChanged() slot; this will be used to enable/disable the color
button for example, depending on which column the user is in.
<li> We connect the table's valueChanged() signal to our own
@@ -194,7 +194,7 @@ correct number of decimal places.
<li> If the user clicks the Color button we call a setColor() slot.
<li> The OK button is connected to the accept() slot; we will update the
elements vector in this slot.
-<li> The Cancel button is connected to the <a href="qdialog.html">TQDialog</a> reject() slot, and
+<li> The Cancel button is connected to the <a href="ntqdialog.html">TQDialog</a> reject() slot, and
requires no further code or action on our part.
</ul>
<p> <pre> TQPixmap patterns[MAX_PATTERNS];
@@ -202,8 +202,8 @@ requires no further code or action on our part.
patterns[1] = TQPixmap( pattern02 );
</pre>
<p> We create a pixmap for every brush pattern and store them in the <tt>patterns</tt> array.
-<p> <pre> <a name="x2610"></a> <a href="qrect.html">TQRect</a> rect = table-&gt;<a href="qtable.html#cellRect">cellRect</a>( 0, 1 );
- <a href="qpixmap.html">TQPixmap</a> pix( rect.<a href="qrect.html#width">width</a>(), rect.<a href="qrect.html#height">height</a>() );
+<p> <pre> <a name="x2610"></a> <a href="ntqrect.html">TQRect</a> rect = table-&gt;<a href="ntqtable.html#cellRect">cellRect</a>( 0, 1 );
+ <a href="ntqpixmap.html">TQPixmap</a> pix( rect.<a href="ntqrect.html#width">width</a>(), rect.<a href="ntqrect.html#height">height</a>() );
</pre>
<p> We obtain the rectangle that will be occupied by each color cell and
create a blank pixmap of that size.
@@ -211,28 +211,28 @@ create a blank pixmap of that size.
Element element = (*m_elements)[i];
if ( element.isValid() )
- table-&gt;<a href="qtable.html#setText">setText</a>(
+ table-&gt;<a href="ntqtable.html#setText">setText</a>(
i, 0,
TQString( "%1" ).arg( element.value(), 0, 'f',
m_decimalPlaces ) );
- <a href="qcolor.html">TQColor</a> color = element.valueColor();
- pix.<a href="qpixmap.html#fill">fill</a>( color );
- table-&gt;<a href="qtable.html#setPixmap">setPixmap</a>( i, 1, pix );
- table-&gt;<a href="qtable.html#setText">setText</a>( i, 1, color.<a href="qcolor.html#name">name</a>() );
+ <a href="ntqcolor.html">TQColor</a> color = element.valueColor();
+ pix.<a href="ntqpixmap.html#fill">fill</a>( color );
+ table-&gt;<a href="ntqtable.html#setPixmap">setPixmap</a>( i, 1, pix );
+ table-&gt;<a href="ntqtable.html#setText">setText</a>( i, 1, color.<a href="ntqcolor.html#name">name</a>() );
- <a href="qcombobox.html">TQComboBox</a> *combobox = new <a href="qcombobox.html">TQComboBox</a>;
+ <a href="ntqcombobox.html">TQComboBox</a> *combobox = new <a href="ntqcombobox.html">TQComboBox</a>;
for ( int j = 0; j &lt; MAX_PATTERNS; ++j )
- combobox-&gt;<a href="qcombobox.html#insertItem">insertItem</a>( patterns[j] );
- <a name="x2603"></a> combobox-&gt;<a href="qcombobox.html#setCurrentItem">setCurrentItem</a>( element.valuePattern() - 1 );
- <a name="x2618"></a> table-&gt;<a href="qtable.html#setCellWidget">setCellWidget</a>( i, 2, combobox );
+ combobox-&gt;<a href="ntqcombobox.html#insertItem">insertItem</a>( patterns[j] );
+ <a name="x2603"></a> combobox-&gt;<a href="ntqcombobox.html#setCurrentItem">setCurrentItem</a>( element.valuePattern() - 1 );
+ <a name="x2618"></a> table-&gt;<a href="ntqtable.html#setCellWidget">setCellWidget</a>( i, 2, combobox );
- table-&gt;<a href="qtable.html#setText">setText</a>( i, 3, element.label() );
+ table-&gt;<a href="ntqtable.html#setText">setText</a>( i, 3, element.label() );
color = element.labelColor();
- <a name="x2606"></a> pix.<a href="qpixmap.html#fill">fill</a>( color );
- <a name="x2623"></a> table-&gt;<a href="qtable.html#setPixmap">setPixmap</a>( i, 4, pix );
- <a name="x2624"></a><a name="x2600"></a> table-&gt;<a href="qtable.html#setText">setText</a>( i, 4, color.<a href="qcolor.html#name">name</a>() );
+ <a name="x2606"></a> pix.<a href="ntqpixmap.html#fill">fill</a>( color );
+ <a name="x2623"></a> table-&gt;<a href="ntqtable.html#setPixmap">setPixmap</a>( i, 4, pix );
+ <a name="x2624"></a><a name="x2600"></a> table-&gt;<a href="ntqtable.html#setText">setText</a>( i, 4, color.<a href="ntqcolor.html#name">name</a>() );
</pre>
<p> For each element in the element vector we must populate the table.
<p> If the element is valid we write its value in the first column (column
@@ -246,16 +246,16 @@ CanvasText subclass) and store the color there. But we've taken a
simpler route: we set the cell's text to the name of the color.
<p> Next we populate the pattern combobox with the patterns. We will use
the position of the chosen pattern in the combobox to determine which
-pattern the user has selected. <a href="qtable.html">TQTable</a> can make use of <a href="qcombotableitem.html">TQComboTableItem</a>
+pattern the user has selected. <a href="ntqtable.html">TQTable</a> can make use of <a href="qcombotableitem.html">TQComboTableItem</a>
items; but these only support text, so we use setCellWidget() to
-insert <a href="qcombobox.html">TQComboBox</a>'s into the table instead.
+insert <a href="ntqcombobox.html">TQComboBox</a>'s into the table instead.
<p> Next we insert the element's label. Finally we set the label color in
the same way as we set the value color.
<p> <h2> The Slots
</h2>
<a name="2"></a><p> <pre> void SetDataForm::currentChanged( int, int col )
{
- colorPushButton-&gt;<a href="qwidget.html#setEnabled">setEnabled</a>( col == 1 || col == 4 );
+ colorPushButton-&gt;<a href="ntqwidget.html#setEnabled">setEnabled</a>( col == 1 || col == 4 );
}
</pre>
<p> As the user navigates through the table currentChanged() signals are
@@ -265,13 +265,13 @@ we enable the colorPushButton; otherwise we disable it.
{
if ( col == 0 ) {
bool ok;
- <a name="x2625"></a> double d = table-&gt;<a href="qtable.html#text">text</a>( row, col ).toDouble( &amp;ok );
+ <a name="x2625"></a> double d = table-&gt;<a href="ntqtable.html#text">text</a>( row, col ).toDouble( &amp;ok );
if ( ok &amp;&amp; d &gt; EPSILON )
- table-&gt;<a href="qtable.html#setText">setText</a>(
+ table-&gt;<a href="ntqtable.html#setText">setText</a>(
row, col, TQString( "%1" ).arg(
d, 0, 'f', m_decimalPlaces ) );
- else if ( !table-&gt;<a href="qtable.html#text">text</a>( row, col ).isEmpty() )
- table-&gt;<a href="qtable.html#setText">setText</a>( row, col, table-&gt;<a href="qtable.html#text">text</a>( row, col ) + "?" );
+ else if ( !table-&gt;<a href="ntqtable.html#text">text</a>( row, col ).isEmpty() )
+ table-&gt;<a href="ntqtable.html#setText">setText</a>( row, col, table-&gt;<a href="ntqtable.html#text">text</a>( row, col ) + "?" );
}
}
</pre>
@@ -279,8 +279,8 @@ we enable the colorPushButton; otherwise we disable it.
number of decimal places, or indicate that it is invalid.
<p> <pre> void SetDataForm::setColor()
{
- <a name="x2615"></a><a name="x2614"></a> setColor( table-&gt;<a href="qtable.html#currentRow">currentRow</a>(), table-&gt;<a href="qtable.html#currentColumn">currentColumn</a>() );
- table-&gt;<a href="qwidget.html#setFocus">setFocus</a>();
+ <a name="x2615"></a><a name="x2614"></a> setColor( table-&gt;<a href="ntqtable.html#currentRow">currentRow</a>(), table-&gt;<a href="ntqtable.html#currentColumn">currentColumn</a>() );
+ table-&gt;<a href="ntqwidget.html#setFocus">setFocus</a>();
}
</pre>
<p> If the user presses the Color button we call the other setColor()
@@ -290,49 +290,49 @@ function and put the focus back into the table.
if ( !( col == 1 || col == 4 ) )
return;
- <a name="x2601"></a> <a href="qcolor.html">TQColor</a> color = TQColorDialog::<a href="qcolordialog.html#getColor">getColor</a>(
- TQColor( table-&gt;<a href="qtable.html#text">text</a>( row, col ) ),
+ <a name="x2601"></a> <a href="ntqcolor.html">TQColor</a> color = TQColorDialog::<a href="ntqcolordialog.html#getColor">getColor</a>(
+ TQColor( table-&gt;<a href="ntqtable.html#text">text</a>( row, col ) ),
this, "color dialog" );
- <a name="x2599"></a> if ( color.<a href="qcolor.html#isValid">isValid</a>() ) {
- <a name="x2617"></a> <a href="qpixmap.html">TQPixmap</a> pix = table-&gt;<a href="qtable.html#pixmap">pixmap</a>( row, col );
- pix.<a href="qpixmap.html#fill">fill</a>( color );
- table-&gt;<a href="qtable.html#setPixmap">setPixmap</a>( row, col, pix );
- table-&gt;<a href="qtable.html#setText">setText</a>( row, col, color.<a href="qcolor.html#name">name</a>() );
+ <a name="x2599"></a> if ( color.<a href="ntqcolor.html#isValid">isValid</a>() ) {
+ <a name="x2617"></a> <a href="ntqpixmap.html">TQPixmap</a> pix = table-&gt;<a href="ntqtable.html#pixmap">pixmap</a>( row, col );
+ pix.<a href="ntqpixmap.html#fill">fill</a>( color );
+ table-&gt;<a href="ntqtable.html#setPixmap">setPixmap</a>( row, col, pix );
+ table-&gt;<a href="ntqtable.html#setText">setText</a>( row, col, color.<a href="ntqcolor.html#name">name</a>() );
}
}
</pre>
<p> If this function is called with the focus on a color cell we call
-the static <a href="qcolordialog.html#getColor">TQColorDialog::getColor</a>() dialog to get the user's choice of
+the static <a href="ntqcolordialog.html#getColor">TQColorDialog::getColor</a>() 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.
-<p> <pre> <a name="x2604"></a>void SetDataForm::<a href="qdialog.html#accept">accept</a>()
+<p> <pre> <a name="x2604"></a>void SetDataForm::<a href="ntqdialog.html#accept">accept</a>()
{
bool ok;
for ( int i = 0; i &lt; ChartForm::MAX_ELEMENTS; ++i ) {
Element &amp;element = (*m_elements)[i];
- double d = table-&gt;<a href="qtable.html#text">text</a>( i, 0 ).toDouble( &amp;ok );
+ double d = table-&gt;<a href="ntqtable.html#text">text</a>( i, 0 ).toDouble( &amp;ok );
if ( ok )
element.setValue( d );
else
element.setValue( Element::INVALID );
- element.setValueColor( TQColor( table-&gt;<a href="qtable.html#text">text</a>( i, 1 ) ) );
+ element.setValueColor( TQColor( table-&gt;<a href="ntqtable.html#text">text</a>( i, 1 ) ) );
element.setValuePattern(
- <a name="x2611"></a> ((TQComboBox*)table-&gt;<a href="qtable.html#cellWidget">cellWidget</a>( i, 2 ))-&gt;currentItem() + 1 );
- element.setLabel( table-&gt;<a href="qtable.html#text">text</a>( i, 3 ) );
- element.setLabelColor( TQColor( table-&gt;<a href="qtable.html#text">text</a>( i, 4 ) ) );
+ <a name="x2611"></a> ((TQComboBox*)table-&gt;<a href="ntqtable.html#cellWidget">cellWidget</a>( i, 2 ))-&gt;currentItem() + 1 );
+ element.setLabel( table-&gt;<a href="ntqtable.html#text">text</a>( i, 3 ) );
+ element.setLabelColor( TQColor( table-&gt;<a href="ntqtable.html#text">text</a>( i, 4 ) ) );
}
- TQDialog::<a href="qdialog.html#accept">accept</a>();
+ TQDialog::<a href="ntqdialog.html#accept">accept</a>();
}
</pre>
<p> 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 <tt>INVALID</tt> if the value is invalid. We set the value color
-and the label color by constructing <a href="qcolor.html">TQColor</a> temporaries that take a
+and the label color by constructing <a href="ntqcolor.html">TQColor</a> 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).
-<p> Finally we call <a href="qdialog.html#accept">TQDialog::accept</a>().
+<p> Finally we call <a href="ntqdialog.html#accept">TQDialog::accept</a>().
<p> <p align="right">
<a href="tutorial2-07.html">&laquo; File Handling</a> |
<a href="tutorial2.html">Contents</a> |