diff options
Diffstat (limited to 'doc/html/statistics-example.html')
-rw-r--r-- | doc/html/statistics-example.html | 100 |
1 files changed, 50 insertions, 50 deletions
diff --git a/doc/html/statistics-example.html b/doc/html/statistics-example.html index dc6b75913..7fb5fa0ac 100644 --- a/doc/html/statistics-example.html +++ b/doc/html/statistics-example.html @@ -33,7 +33,7 @@ body { background: #ffffff; color: black; } <p> -Another <a href="qtable.html">TQTable</a> example. +Another <a href="ntqtable.html">TQTable</a> example. <p> <hr> <p> Header file: <p> <pre>/**************************************************************************** @@ -49,30 +49,30 @@ Another <a href="qtable.html">TQTable</a> example. #ifndef STATISTICS_H #define STATISTICS_H -#include <<a href="qtable-h.html">qtable.h</a>> -#include <<a href="qcombobox-h.html">qcombobox.h</a>> +#include <<a href="qtable-h.html">ntqtable.h</a>> +#include <<a href="qcombobox-h.html">ntqcombobox.h</a>> class TableItem : public <a href="qtableitem.html">TQTableItem</a> { public: - TableItem( <a href="qtable.html">TQTable</a> *t, EditType et, const <a href="qstring.html">TQString</a> &txt ) : <a href="qtableitem.html">TQTableItem</a>( t, et, txt ) {} - void paint( <a href="qpainter.html">TQPainter</a> *p, const <a href="qcolorgroup.html">TQColorGroup</a> &cg, const <a href="qrect.html">TQRect</a> &cr, bool selected ); + TableItem( <a href="ntqtable.html">TQTable</a> *t, EditType et, const <a href="ntqstring.html">TQString</a> &txt ) : <a href="qtableitem.html">TQTableItem</a>( t, et, txt ) {} + void paint( <a href="ntqpainter.html">TQPainter</a> *p, const <a href="qcolorgroup.html">TQColorGroup</a> &cg, const <a href="ntqrect.html">TQRect</a> &cr, bool selected ); }; class ComboItem : public <a href="qtableitem.html">TQTableItem</a> { public: - ComboItem( <a href="qtable.html">TQTable</a> *t, EditType et ); - <a href="qwidget.html">TQWidget</a> *createEditor() const; - void setContentFromEditor( <a href="qwidget.html">TQWidget</a> *w ); - void setText( const <a href="qstring.html">TQString</a> &s ); + ComboItem( <a href="ntqtable.html">TQTable</a> *t, EditType et ); + <a href="ntqwidget.html">TQWidget</a> *createEditor() const; + void setContentFromEditor( <a href="ntqwidget.html">TQWidget</a> *w ); + void setText( const <a href="ntqstring.html">TQString</a> &s ); private: - <a href="qcombobox.html">TQComboBox</a> *cb; + <a href="ntqcombobox.html">TQComboBox</a> *cb; }; -class Table : public <a href="qtable.html">TQTable</a> +class Table : public <a href="ntqtable.html">TQTable</a> { <a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a> @@ -105,10 +105,10 @@ private: #include "statistics.h" -#include <<a href="qdir-h.html">qdir.h</a>> -#include <<a href="qstringlist-h.html">qstringlist.h</a>> -#include <<a href="qheader-h.html">qheader.h</a>> -#include <<a href="qcombobox-h.html">qcombobox.h</a>> +#include <<a href="qdir-h.html">ntqdir.h</a>> +#include <<a href="qstringlist-h.html">ntqstringlist.h</a>> +#include <<a href="qheader-h.html">ntqheader.h</a>> +#include <<a href="qcombobox-h.html">ntqcombobox.h</a>> #include <stdlib.h> const char* dirs[] = { @@ -125,30 +125,30 @@ const char* dirs[] = { }; <a name="f578"></a>Table::Table() - : <a href="qtable.html">TQTable</a>( 10, 100, 0, "table" ) + : <a href="ntqtable.html">TQTable</a>( 10, 100, 0, "table" ) { - <a href="qtable.html#setSorting">setSorting</a>( TRUE ); - <a href="qtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 0, tr( "File" ) ); - <a href="qtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 1, tr( "Size (bytes)" ) ); - <a href="qtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 2, tr( "Use in Sum" ) ); + <a href="ntqtable.html#setSorting">setSorting</a>( TRUE ); + <a href="ntqtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 0, tr( "File" ) ); + <a href="ntqtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 1, tr( "Size (bytes)" ) ); + <a href="ntqtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 2, tr( "Use in Sum" ) ); initTable(); - <a href="qtable.html#adjustColumn">adjustColumn</a>( 0 ); + <a href="ntqtable.html#adjustColumn">adjustColumn</a>( 0 ); // if the user edited something we might need to recalculate the sum - <a href="qobject.html#connect">connect</a>( this, SIGNAL( <a href="qtable.html#valueChanged">valueChanged</a>( int, int ) ), + <a href="ntqobject.html#connect">connect</a>( this, SIGNAL( <a href="ntqtable.html#valueChanged">valueChanged</a>( int, int ) ), this, SLOT( recalcSum( int, int ) ) ); } void <a name="f579"></a>Table::initTable() { // read all the TQt source and header files into a list - <a href="qstringlist.html">TQStringList</a> all; + <a href="ntqstringlist.html">TQStringList</a> all; int i = 0; - <a href="qstring.html">TQString</a> srcdir( "../../../src/" ); + <a href="ntqstring.html">TQString</a> srcdir( "../../../src/" ); while ( dirs[ i ] ) { - <a href="qdir.html">TQDir</a> dir( srcdir + dirs[ i ] ); -<a name="x2780"></a> <a href="qstringlist.html">TQStringList</a> lst = dir.<a href="qdir.html#entryList">entryList</a>( "*.cpp; *.h" ); -<a name="x2791"></a><a name="x2789"></a> for ( TQStringList::Iterator it = lst.<a href="qvaluelist.html#begin">begin</a>(); it != lst.<a href="qvaluelist.html#end">end</a>(); ++it ) { + <a href="ntqdir.html">TQDir</a> dir( srcdir + dirs[ i ] ); +<a name="x2780"></a> <a href="ntqstringlist.html">TQStringList</a> lst = dir.<a href="ntqdir.html#entryList">entryList</a>( "*.cpp; *.h" ); +<a name="x2791"></a><a name="x2789"></a> for ( TQStringList::Iterator it = lst.<a href="ntqvaluelist.html#begin">begin</a>(); it != lst.<a href="ntqvaluelist.html#end">end</a>(); ++it ) { if ( ( *it ).contains( "moc" ) ) continue; all << (TQString( dirs[ i ] ) + "/" + *it); @@ -157,25 +157,25 @@ void <a name="f579"></a>Table::initTable() } // set the number of rows we'll need for the table -<a name="x2790"></a> <a href="qtable.html#setNumRows">setNumRows</a>( all.<a href="qvaluelist.html#count">count</a>() + 1 ); +<a name="x2790"></a> <a href="ntqtable.html#setNumRows">setNumRows</a>( all.<a href="ntqvaluelist.html#count">count</a>() + 1 ); i = 0; int sum = 0; // insert the data into the table - for ( TQStringList::Iterator it = all.<a href="qvaluelist.html#begin">begin</a>(); it != all.<a href="qvaluelist.html#end">end</a>(); ++it ) { - <a href="qtable.html#setText">setText</a>( i, 0, *it ); - <a href="qfile.html">TQFile</a> f( srcdir + *it ); -<a name="x2781"></a> <a href="qtable.html#setText">setText</a>( i, 1, TQString::number( (ulong)f.<a href="qfile.html#size">size</a>() ) ); + for ( TQStringList::Iterator it = all.<a href="ntqvaluelist.html#begin">begin</a>(); it != all.<a href="ntqvaluelist.html#end">end</a>(); ++it ) { + <a href="ntqtable.html#setText">setText</a>( i, 0, *it ); + <a href="ntqfile.html">TQFile</a> f( srcdir + *it ); +<a name="x2781"></a> <a href="ntqtable.html#setText">setText</a>( i, 1, TQString::number( (ulong)f.<a href="ntqfile.html#size">size</a>() ) ); ComboItem *ci = new ComboItem( this, TQTableItem::WhenCurrent ); - <a href="qtable.html#setItem">setItem</a>( i++, 2, ci ); - sum += f.<a href="qfile.html#size">size</a>(); + <a href="ntqtable.html#setItem">setItem</a>( i++, 2, ci ); + sum += f.<a href="ntqfile.html#size">size</a>(); } // last row should show the sum TableItem *i1 = new TableItem( this, TQTableItem::Never, tr( "Sum" ) ); - <a href="qtable.html#setItem">setItem</a>( i, 0, i1 ); + <a href="ntqtable.html#setItem">setItem</a>( i, 0, i1 ); TableItem *i2 = new TableItem( this, TQTableItem::Never, TQString::number( sum ) ); - <a href="qtable.html#setItem">setItem</a>( i, 1, i2 ); + <a href="ntqtable.html#setItem">setItem</a>( i, 1, i2 ); } void <a name="f580"></a>Table::recalcSum( int, int col ) @@ -199,20 +199,20 @@ void <a name="f580"></a>Table::recalcSum( int, int col ) setItem( numRows() - 1, 1, i2 ); } -<a name="x2784"></a>void Table::<a href="qtable.html#sortColumn">sortColumn</a>( int col, bool ascending, bool /*wholeRows*/ ) +<a name="x2784"></a>void Table::<a href="ntqtable.html#sortColumn">sortColumn</a>( int col, bool ascending, bool /*wholeRows*/ ) { // sum row should not be sorted, so get rid of it for now clearCell( numRows() - 1, 0 ); clearCell( numRows() - 1, 1 ); // do sort - TQTable::<a href="qtable.html#sortColumn">sortColumn</a>( col, ascending, TRUE ); + TQTable::<a href="ntqtable.html#sortColumn">sortColumn</a>( col, ascending, TRUE ); // re-insert sum row recalcSum( 0, 1 ); } -<a name="x2786"></a>void TableItem::<a href="qtableitem.html#paint">paint</a>( <a href="qpainter.html">TQPainter</a> *p, const <a href="qcolorgroup.html">TQColorGroup</a> &cg, const <a href="qrect.html">TQRect</a> &cr, bool selected ) +<a name="x2786"></a>void TableItem::<a href="qtableitem.html#paint">paint</a>( <a href="ntqpainter.html">TQPainter</a> *p, const <a href="qcolorgroup.html">TQColorGroup</a> &cg, const <a href="ntqrect.html">TQRect</a> &cr, bool selected ) { <a href="qcolorgroup.html">TQColorGroup</a> g( cg ); // last row is the sum row - we want to make it more visible by @@ -225,7 +225,7 @@ void <a name="f580"></a>Table::recalcSum( int, int col ) -<a name="f577"></a>ComboItem::ComboItem( <a href="qtable.html">TQTable</a> *t, EditType et ) +<a name="f577"></a>ComboItem::ComboItem( <a href="ntqtable.html">TQTable</a> *t, EditType et ) : <a href="qtableitem.html">TQTableItem</a>( t, et, "Yes" ), cb( 0 ) { // we do not want this item to be replaced @@ -235,8 +235,8 @@ void <a name="f580"></a>Table::recalcSum( int, int col ) <a name="x2785"></a>TQWidget *ComboItem::<a href="qtableitem.html#createEditor">createEditor</a>() const { // create an editor - a combobox in our case - ( (ComboItem*)this )->cb = new <a href="qcombobox.html">TQComboBox</a>( <a href="qtableitem.html#table">table</a>()->viewport() ); - TQObject::<a href="qobject.html#connect">connect</a>( cb, SIGNAL( activated( int ) ), table(), SLOT( doValueChanged() ) ); + ( (ComboItem*)this )->cb = new <a href="ntqcombobox.html">TQComboBox</a>( <a href="qtableitem.html#table">table</a>()->viewport() ); + TQObject::<a href="ntqobject.html#connect">connect</a>( cb, SIGNAL( activated( int ) ), table(), SLOT( doValueChanged() ) ); cb->insertItem( "Yes" ); cb->insertItem( "No" ); // and initialize it @@ -244,17 +244,17 @@ void <a name="f580"></a>Table::recalcSum( int, int col ) return cb; } -<a name="x2787"></a>void ComboItem::<a href="qtableitem.html#setContentFromEditor">setContentFromEditor</a>( <a href="qwidget.html">TQWidget</a> *w ) +<a name="x2787"></a>void ComboItem::<a href="qtableitem.html#setContentFromEditor">setContentFromEditor</a>( <a href="ntqwidget.html">TQWidget</a> *w ) { // the user changed the value of the combobox, so synchronize the // value of the item (its text), with the value of the combobox -<a name="x2783"></a> if ( w-><a href="qobject.html#inherits">inherits</a>( "TQComboBox" ) ) +<a name="x2783"></a> if ( w-><a href="ntqobject.html#inherits">inherits</a>( "TQComboBox" ) ) <a href="qtableitem.html#setText">setText</a>( ( (TQComboBox*)w )->currentText() ); else TQTableItem::<a href="qtableitem.html#setContentFromEditor">setContentFromEditor</a>( w ); } -<a name="x2788"></a>void ComboItem::<a href="qtableitem.html#setText">setText</a>( const <a href="qstring.html">TQString</a> &s ) +<a name="x2788"></a>void ComboItem::<a href="qtableitem.html#setText">setText</a>( const <a href="ntqstring.html">TQString</a> &s ) { if ( cb ) { // initialize the combobox from the text @@ -280,15 +280,15 @@ void <a name="f580"></a>Table::recalcSum( int, int col ) *****************************************************************************/ #include "statistics.h" -#include <<a href="qapplication-h.html">qapplication.h</a>> +#include <<a href="qapplication-h.html">ntqapplication.h</a>> int main( int argc, char **argv ) { - <a href="qapplication.html">TQApplication</a> a(argc,argv); + <a href="ntqapplication.html">TQApplication</a> a(argc,argv); Table t; - a.<a href="qapplication.html#setMainWidget">setMainWidget</a>( &t ); - t.<a href="qwidget.html#show">show</a>(); - return a.<a href="qapplication.html#exec">exec</a>(); + a.<a href="ntqapplication.html#setMainWidget">setMainWidget</a>( &t ); + t.<a href="ntqwidget.html#show">show</a>(); + return a.<a href="ntqapplication.html#exec">exec</a>(); } </pre> |