diff options
author | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-26 23:32:43 -0600 |
---|---|---|
committer | Timothy Pearson <kb9vqf@pearsoncomputing.net> | 2012-01-26 23:32:43 -0600 |
commit | ea318d1431c89e647598c510c4245c6571aa5f46 (patch) | |
tree | 996d29b80c30d453dda86d1a23162d441628f169 /doc/html/helpsystem-example.html | |
parent | aaf89d4b48f69c9293feb187db26362e550b5561 (diff) | |
download | tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.tar.gz tqt3-ea318d1431c89e647598c510c4245c6571aa5f46.zip |
Update to latest tqt3 automated conversion
Diffstat (limited to 'doc/html/helpsystem-example.html')
-rw-r--r-- | doc/html/helpsystem-example.html | 284 |
1 files changed, 142 insertions, 142 deletions
diff --git a/doc/html/helpsystem-example.html b/doc/html/helpsystem-example.html index 3713cea67..69c998158 100644 --- a/doc/html/helpsystem-example.html +++ b/doc/html/helpsystem-example.html @@ -37,103 +37,103 @@ body { background: #ffffff; color: black; } This example demonstrates the different TQt classes that can be used to provide context sensitive help in an application. -<p> It uses <a href="qtooltip.html">TQToolTip</a> and <a href="qwhatsthis.html">TQWhatsThis</a> to provide both static and +<p> It uses <a href="ntqtooltip.html">TQToolTip</a> and <a href="ntqwhatsthis.html">TQWhatsThis</a> to provide both static and dynamic balloon help for the widgets in the application, and <a href="qtooltipgroup.html">TQToolTipGroup</a> to display extended information for each tooltip -in the statusbar. <a href="qassistantclient.html">TQAssistantClient</a> is used to display help +in the statusbar. <a href="ntqassistantclient.html">TQAssistantClient</a> is used to display help pages using TQt Assistant. <p> The application has a user interface based on a -<a href="qmainwindow.html">TQMainWindow</a> with a menubar, statusbar and a toolbar, and uses -a <a href="qtable.html">TQTable</a> as the central widget. +<a href="ntqmainwindow.html">TQMainWindow</a> with a menubar, statusbar and a toolbar, and uses +a <a href="ntqtable.html">TQTable</a> as the central widget. -<pre> class HeaderToolTip : public <a href="qtooltip.html">TQToolTip</a> +<pre> class HeaderToolTip : public <a href="ntqtooltip.html">TQToolTip</a> { public: - HeaderToolTip( <a href="qheader.html">TQHeader</a> *header, TQToolTipGroup *group = 0 ); + HeaderToolTip( <a href="ntqheader.html">TQHeader</a> *header, TQToolTipGroup *group = 0 ); protected: - void maybeTip ( const <a href="qpoint.html">TQPoint</a> &p ); + void maybeTip ( const <a href="ntqpoint.html">TQPoint</a> &p ); }; </pre> <p> Two TQToolTip subclasses implement dynamic tooltips for -<a href="qheader.html">TQHeader</a> and TQTable by reimplementing maybeTip(). The -constructors differ from the <a href="qtooltip.html">TQToolTip</a> constructor in having a +<a href="ntqheader.html">TQHeader</a> and TQTable by reimplementing maybeTip(). The +constructors differ from the <a href="ntqtooltip.html">TQToolTip</a> constructor in having a TQHeader and a TQTable respectively as the first parameter for -the constructor instead of a <a href="qwidget.html">TQWidget</a>. This is because +the constructor instead of a <a href="ntqwidget.html">TQWidget</a>. This is because we want to ensure that only headers and tables can be passed as arguments. A <a href="qtooltipgroup.html">TQToolTipGroup</a> can be provided as the second argument to show tooltips in, for example a statusbar. -<p> <pre> class TableToolTip : public <a href="qtooltip.html">TQToolTip</a> +<p> <pre> class TableToolTip : public <a href="ntqtooltip.html">TQToolTip</a> { public: - TableToolTip( <a href="qtable.html">TQTable</a>* table, TQToolTipGroup *group = 0 ); + TableToolTip( <a href="ntqtable.html">TQTable</a>* table, TQToolTipGroup *group = 0 ); protected: - void maybeTip( const <a href="qpoint.html">TQPoint</a> &p ); + void maybeTip( const <a href="ntqpoint.html">TQPoint</a> &p ); private: - <a href="qtable.html">TQTable</a> *table; + <a href="ntqtable.html">TQTable</a> *table; }; </pre> -<p> The TableToolTip class keeps a reference to the <a href="qtable.html">TQTable</a> +<p> The TableToolTip class keeps a reference to the <a href="ntqtable.html">TQTable</a> as a member for easier access of the TQTable object later on. <p> -<pre> HeaderToolTip::HeaderToolTip( <a href="qheader.html">TQHeader</a> *header, TQToolTipGroup *group ) - : <a href="qtooltip.html">TQToolTip</a>( header, group ) +<pre> HeaderToolTip::HeaderToolTip( <a href="ntqheader.html">TQHeader</a> *header, TQToolTipGroup *group ) + : <a href="ntqtooltip.html">TQToolTip</a>( header, group ) { } </pre> <p> The HeaderToolTip constructor propagates the parameters -to the <a href="qtooltip.html">TQToolTip</a> constructor. -<pre> void HeaderToolTip::<a href="qtooltip.html#maybeTip">maybeTip</a> ( const <a href="qpoint.html">TQPoint</a>& p ) +to the <a href="ntqtooltip.html">TQToolTip</a> constructor. +<pre> void HeaderToolTip::<a href="ntqtooltip.html#maybeTip">maybeTip</a> ( const <a href="ntqpoint.html">TQPoint</a>& p ) { - <a href="qheader.html">TQHeader</a> *header = (TQHeader*)<a href="qtooltip.html#parentWidget">parentWidget</a>(); + <a href="ntqheader.html">TQHeader</a> *header = (TQHeader*)<a href="ntqtooltip.html#parentWidget">parentWidget</a>(); int section = 0; - <a name="x2676"></a> if ( header-><a href="qheader.html#orientation">orientation</a>() == Horizontal ) - <a name="x2677"></a><a name="x2675"></a> section = header-><a href="qheader.html#sectionAt">sectionAt</a>( header-><a href="qheader.html#offset">offset</a>() + p.<a href="qpoint.html#x">x</a>() ); + <a name="x2676"></a> if ( header-><a href="ntqheader.html#orientation">orientation</a>() == Horizontal ) + <a name="x2677"></a><a name="x2675"></a> section = header-><a href="ntqheader.html#sectionAt">sectionAt</a>( header-><a href="ntqheader.html#offset">offset</a>() + p.<a href="ntqpoint.html#x">x</a>() ); else - section = header-><a href="qheader.html#sectionAt">sectionAt</a>( header-><a href="qheader.html#offset">offset</a>() + p.<a href="qpoint.html#y">y</a>() ); + section = header-><a href="ntqheader.html#sectionAt">sectionAt</a>( header-><a href="ntqheader.html#offset">offset</a>() + p.<a href="ntqpoint.html#y">y</a>() ); - <a name="x2674"></a> <a href="qstring.html">TQString</a> tipString = header-><a href="qheader.html#label">label</a>( section ); - <a name="x2678"></a> <a href="qtooltip.html#tip">tip</a>( header-><a href="qheader.html#sectionRect">sectionRect</a>( section ), tipString, "This is a section in a header" ); + <a name="x2674"></a> <a href="ntqstring.html">TQString</a> tipString = header-><a href="ntqheader.html#label">label</a>( section ); + <a name="x2678"></a> <a href="ntqtooltip.html#tip">tip</a>( header-><a href="ntqheader.html#sectionRect">sectionRect</a>( section ), tipString, "This is a section in a header" ); } </pre> -<p> The implementation of maybeTip() uses the <a href="qheader.html">TQHeader</a> API +<p> The implementation of maybeTip() uses the <a href="ntqheader.html">TQHeader</a> API to get the section at the requested position and uses -<a href="qtooltip.html#tip">TQToolTip::tip</a>() to display the section's label in a +<a href="ntqtooltip.html#tip">TQToolTip::tip</a>() to display the section's label in a tooltip. The second string is used by <a href="qtooltipgroup.html">TQToolTipGroup</a> and will show up in the statusbar. -<p> <pre> TableToolTip::TableToolTip( <a href="qtable.html">TQTable</a> *tipTable, TQToolTipGroup *group ) - <a name="x2683"></a>: <a href="qtooltip.html">TQToolTip</a>( tipTable-><a href="qscrollview.html#viewport">viewport</a>(), group ), table( tipTable ) +<p> <pre> TableToolTip::TableToolTip( <a href="ntqtable.html">TQTable</a> *tipTable, TQToolTipGroup *group ) + <a name="x2683"></a>: <a href="ntqtooltip.html">TQToolTip</a>( tipTable-><a href="ntqscrollview.html#viewport">viewport</a>(), group ), table( tipTable ) { } </pre> -<p> Since <a href="qtable.html">TQTable</a> is a <a href="qscrollview.html">TQScrollView</a> all user interaction +<p> Since <a href="ntqtable.html">TQTable</a> is a <a href="ntqscrollview.html">TQScrollView</a> all user interaction happens on TQTable's viewport() . The TableToolTip constructor passes the viewport() and the tooltip -group to the <a href="qtooltip.html">TQToolTip</a> constructor, and initializes the table +group to the <a href="ntqtooltip.html">TQToolTip</a> constructor, and initializes the table member with the TQTable pointer itself. -<pre> <a name="x2684"></a>void TableToolTip::<a href="qtooltip.html#maybeTip">maybeTip</a> ( const <a href="qpoint.html">TQPoint</a> &p ) +<pre> <a name="x2684"></a>void TableToolTip::<a href="ntqtooltip.html#maybeTip">maybeTip</a> ( const <a href="ntqpoint.html">TQPoint</a> &p ) { - <a href="qpoint.html">TQPoint</a> cp = table->viewportToContents( p ); - <a name="x2680"></a> int row = table->rowAt( cp.<a href="qpoint.html#y">y</a>() ); - <a name="x2679"></a> int col = table->columnAt( cp.<a href="qpoint.html#x">x</a>() ); + <a href="ntqpoint.html">TQPoint</a> cp = table->viewportToContents( p ); + <a name="x2680"></a> int row = table->rowAt( cp.<a href="ntqpoint.html#y">y</a>() ); + <a name="x2679"></a> int col = table->columnAt( cp.<a href="ntqpoint.html#x">x</a>() ); - <a href="qstring.html">TQString</a> tipString = table->text( row, col ); + <a href="ntqstring.html">TQString</a> tipString = table->text( row, col ); - <a href="qrect.html">TQRect</a> cr = table->cellGeometry( row, col ); + <a href="ntqrect.html">TQRect</a> cr = table->cellGeometry( row, col ); </pre> <p> The implementation of maybeTip() uses the TQTable API to get information about the cell at the requested position. -The <a href="qtable.html">TQTable</a> API expects contents coordinates, and since the +The <a href="ntqtable.html">TQTable</a> API expects contents coordinates, and since the requested point is relative to the viewport we need to translate the coordinates before we can use TQTable's functions. -<pre> <a name="x2682"></a><a name="x2681"></a> cr.<a href="qrect.html#moveTopLeft">moveTopLeft</a>( table->contentsToViewport( cr.<a href="qrect.html#topLeft">topLeft</a>() ) ); - <a href="qtooltip.html#tip">tip</a>( cr, tipString, "This is a cell in a table" ); +<pre> <a name="x2682"></a><a name="x2681"></a> cr.<a href="ntqrect.html#moveTopLeft">moveTopLeft</a>( table->contentsToViewport( cr.<a href="ntqrect.html#topLeft">topLeft</a>() ) ); + <a href="ntqtooltip.html#tip">tip</a>( cr, tipString, "This is a cell in a table" ); } </pre> @@ -141,50 +141,50 @@ the coordinates before we can use TQTable's functions. <p> We translate the cell's geometry back to viewport coordinates so that the tooltip disappears when the mouse cursor leaves -the cell, and use <a href="qtooltip.html#tip">TQToolTip::tip</a>() to display the cell's label +the cell, and use <a href="ntqtooltip.html#tip">TQToolTip::tip</a>() to display the cell's label in a tooltip and to provide text for the <a href="qtooltipgroup.html">TQToolTipGroup</a> as before. -<pre> class WhatsThis : public <a href="qobject.html">TQObject</a>, public TQWhatsThis +<pre> class WhatsThis : public <a href="ntqobject.html">TQObject</a>, public TQWhatsThis { <a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a> public: - WhatsThis( <a href="qwidget.html">TQWidget</a> *w, TQWidget *watch = 0 ); + WhatsThis( <a href="ntqwidget.html">TQWidget</a> *w, TQWidget *watch = 0 ); - bool clicked( const <a href="qstring.html">TQString</a> &link ); - <a href="qwidget.html">TQWidget</a> *parentWidget() const; + bool clicked( const <a href="ntqstring.html">TQString</a> &link ); + <a href="ntqwidget.html">TQWidget</a> *parentWidget() const; signals: - void linkClicked( const <a href="qstring.html">TQString</a> &link ); + void linkClicked( const <a href="ntqstring.html">TQString</a> &link ); private: - <a href="qwidget.html">TQWidget</a> *widget; + <a href="ntqwidget.html">TQWidget</a> *widget; }; </pre> -<p> The WhatsThis class is a subclass of both <a href="qobject.html">TQObject</a> and -<a href="qwhatsthis.html">TQWhatsThis</a> and serves as a base class for the HeaderWhatsThis +<p> The WhatsThis class is a subclass of both <a href="ntqobject.html">TQObject</a> and +<a href="ntqwhatsthis.html">TQWhatsThis</a> and serves as a base class for the HeaderWhatsThis and TableWhatsThis classes. <a href="#footnote1"><sup>(1)</sup></a><a name="footnote-call1"></a> WhatsThis reimplements clicked() which will be called when the user clicks inside the "What's this?" window. It also declares a signal linkClicked() which will be emitted when a hyperlink is clicked. -<pre> WhatsThis::WhatsThis( <a href="qwidget.html">TQWidget</a> *w, TQWidget *watch ) - : <a href="qwhatsthis.html">TQWhatsThis</a>( watch ? watch : w ), widget( w ) +<pre> WhatsThis::WhatsThis( <a href="ntqwidget.html">TQWidget</a> *w, TQWidget *watch ) + : <a href="ntqwhatsthis.html">TQWhatsThis</a>( watch ? watch : w ), widget( w ) { } </pre> <p> The WhatsThis constructor takes two parameters, the first is the widget we want to provide WhatsThis for, and the second is the one which receives the events. Normally this is the same widget, -but some widgets, like <a href="qtable.html">TQTable</a>, are more complex and have a +but some widgets, like <a href="ntqtable.html">TQTable</a>, are more complex and have a viewport() widget which receives the events. If such a widget is passed to the constructor it will propagate the parameter to -the TQWhatsThis constructor and store the <a href="qwidget.html">TQWidget</a> pointer itself +the TQWhatsThis constructor and store the <a href="ntqwidget.html">TQWidget</a> pointer itself in it's member variable to allow easier use of the TQWidget API later on. -<pre> bool WhatsThis::clicked( const <a href="qstring.html">TQString</a> &link ) +<pre> bool WhatsThis::clicked( const <a href="ntqstring.html">TQString</a> &link ) { - if ( !link.<a href="qstring.html#isEmpty">isEmpty</a>() ) + if ( !link.<a href="ntqstring.html#isEmpty">isEmpty</a>() ) emit linkClicked( link ); return TRUE; @@ -198,17 +198,17 @@ if a hyperlink has been clicked. <pre> class HeaderWhatsThis : public WhatsThis { public: - HeaderWhatsThis( <a href="qheader.html">TQHeader</a> *h ); + HeaderWhatsThis( <a href="ntqheader.html">TQHeader</a> *h ); - <a href="qstring.html">TQString</a> text( const <a href="qpoint.html">TQPoint</a> &p ); + <a href="ntqstring.html">TQString</a> text( const <a href="ntqpoint.html">TQPoint</a> &p ); }; </pre> <p> <pre> class TableWhatsThis : public WhatsThis { public: - TableWhatsThis( <a href="qtable.html">TQTable</a> *t ); + TableWhatsThis( <a href="ntqtable.html">TQTable</a> *t ); - <a href="qstring.html">TQString</a> text( const <a href="qpoint.html">TQPoint</a> &p ); + <a href="ntqstring.html">TQString</a> text( const <a href="ntqpoint.html">TQPoint</a> &p ); }; </pre> <p> @@ -220,63 +220,63 @@ text() to make it possible to return texts depending on the mouse click's position. All the other functionality is already provided by the generic WhatsThis base class. We ensure type safety here in the same manner as in the tooltip classes. -<pre> HeaderWhatsThis::HeaderWhatsThis( <a href="qheader.html">TQHeader</a> *h ) +<pre> HeaderWhatsThis::HeaderWhatsThis( <a href="ntqheader.html">TQHeader</a> *h ) : WhatsThis( h ) { } </pre> <p> The HeaderWhatsThis constructor propagates the parameter to the WhatsThis constructor. -<pre> TQString HeaderWhatsThis::text( const <a href="qpoint.html">TQPoint</a> &p ) +<pre> TQString HeaderWhatsThis::text( const <a href="ntqpoint.html">TQPoint</a> &p ) { - <a href="qheader.html">TQHeader</a> *header = (TQHeader*)parentWidget(); + <a href="ntqheader.html">TQHeader</a> *header = (TQHeader*)parentWidget(); - <a href="qstring.html">TQString</a> orient; + <a href="ntqstring.html">TQString</a> orient; int section; - if ( header-><a href="qheader.html#orientation">orientation</a>() == TQObject::Horizontal ) { + if ( header-><a href="ntqheader.html#orientation">orientation</a>() == TQObject::Horizontal ) { orient = "horizontal"; - section = header-><a href="qheader.html#sectionAt">sectionAt</a>( p.<a href="qpoint.html#x">x</a>() ); + section = header-><a href="ntqheader.html#sectionAt">sectionAt</a>( p.<a href="ntqpoint.html#x">x</a>() ); } else { orient = "vertical"; - section = header-><a href="qheader.html#sectionAt">sectionAt</a>( p.<a href="qpoint.html#y">y</a>() ); + section = header-><a href="ntqheader.html#sectionAt">sectionAt</a>( p.<a href="ntqpoint.html#y">y</a>() ); } if( section == -1 ) return "This is empty space."; - <a href="qstring.html">TQString</a> docsPath = TQDir("../../doc").absPath(); - return TQString("This is section number %1 in the %2 <a href=%2/html/qheader.html>header</a>."). + <a href="ntqstring.html">TQString</a> docsPath = TQDir("../../doc").absPath(); + return TQString("This is section number %1 in the %2 <a href=%2/html/ntqheader.html>header</a>."). arg(section + 1). arg(orient). arg(docsPath); } </pre> -<p> The implementation of text() uses the <a href="qheader.html">TQHeader</a> API to determine +<p> The implementation of text() uses the <a href="ntqheader.html">TQHeader</a> API to determine whether we have a horizontal or a vertical header and returns a string which states the header's orientation and section. <a href="#footnote2"><sup>(2)</sup></a><a name="footnote-call2"></a> -<pre> TableWhatsThis::TableWhatsThis( <a href="qtable.html">TQTable</a> *t ) - : WhatsThis( t, t-><a href="qscrollview.html#viewport">viewport</a>() ) +<pre> TableWhatsThis::TableWhatsThis( <a href="ntqtable.html">TQTable</a> *t ) + : WhatsThis( t, t-><a href="ntqscrollview.html#viewport">viewport</a>() ) { } </pre> -<p> Since <a href="qtable.html">TQTable</a> is a scrollview and has a viewport() which receives +<p> Since <a href="ntqtable.html">TQTable</a> is a scrollview and has a viewport() which receives the events, we propagate the table itself and the table's viewport() to the WhatsThis constructor. -<pre> TQString TableWhatsThis::text( const <a href="qpoint.html">TQPoint</a> &p ) +<pre> TQString TableWhatsThis::text( const <a href="ntqpoint.html">TQPoint</a> &p ) { - <a href="qtable.html">TQTable</a> *table = (TQTable*)parentWidget(); + <a href="ntqtable.html">TQTable</a> *table = (TQTable*)parentWidget(); - <a href="qpoint.html">TQPoint</a> cp = table-><a href="qscrollview.html#viewportToContents">viewportToContents</a>( p ); - int row = table-><a href="qtable.html#rowAt">rowAt</a>( cp.<a href="qpoint.html#y">y</a>() ); - int col = table-><a href="qtable.html#columnAt">columnAt</a>( cp.<a href="qpoint.html#x">x</a>() ); + <a href="ntqpoint.html">TQPoint</a> cp = table-><a href="ntqscrollview.html#viewportToContents">viewportToContents</a>( p ); + int row = table-><a href="ntqtable.html#rowAt">rowAt</a>( cp.<a href="ntqpoint.html#y">y</a>() ); + int col = table-><a href="ntqtable.html#columnAt">columnAt</a>( cp.<a href="ntqpoint.html#x">x</a>() ); if ( row == -1 || col == -1 ) return "This is empty space."; - <a href="qtableitem.html">TQTableItem</a>* i = table-><a href="qtable.html#item">item</a>( row,col ); + <a href="qtableitem.html">TQTableItem</a>* i = table-><a href="ntqtable.html#item">item</a>( row,col ); if ( !i ) return "This is an empty cell."; - <a href="qstring.html">TQString</a> docsPath = TQDir("../../doc").absPath(); + <a href="ntqstring.html">TQString</a> docsPath = TQDir("../../doc").absPath(); if ( TQTableItem::RTTI == i-><a href="qtableitem.html#rtti">rtti</a>() ) { return TQString("This is a <a href=%1/html/qtableitem.html>TQTableItem</a>."). @@ -287,13 +287,13 @@ viewport() to the WhatsThis constructor. arg(docsPath); } else if ( TQCheckTableItem::RTTI == i-><a href="qtableitem.html#rtti">rtti</a>() ) { return TQString("This is a <a href=%1/html/qchecktableitem.html>TQCheckTableItem</a>." - "<br>It provide <a href=%1/html/qcheckbox.html>checkboxes</a> in tables."). + "<br>It provide <a href=%1/html/ntqcheckbox.html>checkboxes</a> in tables."). arg(docsPath).arg(docsPath); } return "This is a user defined table item."; } </pre> -<p> The implementation of text() uses the <a href="qtable.html">TQTable</a> API to get +<p> The implementation of text() uses the <a href="ntqtable.html">TQTable</a> API to get information about the cell at the requested position. The TQTable API expects contents coordinates, so we need to translate the point as shown earlier for the tooltip classes. @@ -301,7 +301,7 @@ We use the rtti() function to figure out the item's type and return a string accordingly. <p> -<pre> class MainWindow : public <a href="qmainwindow.html">TQMainWindow</a> +<pre> class MainWindow : public <a href="ntqmainwindow.html">TQMainWindow</a> { Q_OBJECT public: @@ -315,106 +315,106 @@ and return a string accordingly. HeaderToolTip *horizontalTip; HeaderToolTip *verticalTip; TableToolTip *cellTip; - <a href="qassistantclient.html">TQAssistantClient</a> *assistant; + <a href="ntqassistantclient.html">TQAssistantClient</a> *assistant; }; </pre> -<p> A <a href="qmainwindow.html">TQMainWindow</a> is used to create a user interface that uses the +<p> A <a href="ntqmainwindow.html">TQMainWindow</a> is used to create a user interface that uses the above classes in addition to TQt Assistant to provide context sensitive help in the application. <p> The MainWindow class declares a slot called assistantSlot() which creates an instance of TQt Assistant when it is called. The class keeps references to the tooltip classes as members because they are not TQObjects and need to be deleted explicitly. -The class has a reference to <a href="qassistantclient.html">TQAssistantClient</a> as a +The class has a reference to <a href="ntqassistantclient.html">TQAssistantClient</a> as a member as well, to allow easier access to TQt Assistant later on. <p> <pre> MainWindow::MainWindow() { - <a href="qmainwindow.html#statusBar">statusBar</a>(); - assistant = new <a href="qassistantclient.html">TQAssistantClient</a>( TQDir("../../bin").absPath(), this ); + <a href="ntqmainwindow.html#statusBar">statusBar</a>(); + assistant = new <a href="ntqassistantclient.html">TQAssistantClient</a>( TQDir("../../bin").absPath(), this ); </pre> <p> The MainWindow constructor creates an instance of -TQAssistantClient using <a href="qstring.html#TQString-null">TQString::null</a> as the first argument +TQAssistantClient using <a href="ntqstring.html#TQString-null">TQString::null</a> as the first argument so that the system path is used. -<pre> <a href="qtable.html">TQTable</a>* table = new <a href="qtable.html">TQTable</a>( 2, 3, this ); - <a href="qmainwindow.html#setCentralWidget">setCentralWidget</a>( table ); +<pre> <a href="ntqtable.html">TQTable</a>* table = new <a href="ntqtable.html">TQTable</a>( 2, 3, this ); + <a href="ntqmainwindow.html#setCentralWidget">setCentralWidget</a>( table ); // populate table - <a href="qstringlist.html">TQStringList</a> comboEntries; + <a href="ntqstringlist.html">TQStringList</a> comboEntries; comboEntries << "one" << "two" << "three" << "four"; <a href="qcombotableitem.html">TQComboTableItem</a>* comboItem1 = new <a href="qcombotableitem.html">TQComboTableItem</a>( table, comboEntries ); <a href="qcombotableitem.html">TQComboTableItem</a>* comboItem2 = new <a href="qcombotableitem.html">TQComboTableItem</a>( table, comboEntries ); <a href="qchecktableitem.html">TQCheckTableItem</a>* checkItem1 = new <a href="qchecktableitem.html">TQCheckTableItem</a>( table, "Check me" ); <a href="qchecktableitem.html">TQCheckTableItem</a>* checkItem2 = new <a href="qchecktableitem.html">TQCheckTableItem</a>( table, "Check me" ); - <a name="x2691"></a> table-><a href="qtable.html#setItem">setItem</a>( 0, 0, comboItem1 ); - table-><a href="qtable.html#setItem">setItem</a>( 1, 0, comboItem2 ); + <a name="x2691"></a> table-><a href="ntqtable.html#setItem">setItem</a>( 0, 0, comboItem1 ); + table-><a href="ntqtable.html#setItem">setItem</a>( 1, 0, comboItem2 ); - table-><a href="qtable.html#setItem">setItem</a>( 1, 1, checkItem1 ); - table-><a href="qtable.html#setItem">setItem</a>( 0, 1, checkItem2 ); + table-><a href="ntqtable.html#setItem">setItem</a>( 1, 1, checkItem1 ); + table-><a href="ntqtable.html#setItem">setItem</a>( 0, 1, checkItem2 ); - <a name="x2692"></a> table-><a href="qtable.html#setText">setText</a>( 1, 2, "Text" ); + <a name="x2692"></a> table-><a href="ntqtable.html#setText">setText</a>( 1, 2, "Text" ); - table-><a href="qtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 0, " Combos" ); - table-><a href="qtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 1, "Checkboxes" ); - table-><a href="qtable.html#verticalHeader">verticalHeader</a>()->setLabel( 0, "1" ); - table-><a href="qtable.html#verticalHeader">verticalHeader</a>()->setLabel( 1, "2" ); + table-><a href="ntqtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 0, " Combos" ); + table-><a href="ntqtable.html#horizontalHeader">horizontalHeader</a>()->setLabel( 1, "Checkboxes" ); + table-><a href="ntqtable.html#verticalHeader">verticalHeader</a>()->setLabel( 0, "1" ); + table-><a href="ntqtable.html#verticalHeader">verticalHeader</a>()->setLabel( 1, "2" ); // populate menubar - <a href="qpopupmenu.html">TQPopupMenu</a>* fileMenu = new <a href="qpopupmenu.html">TQPopupMenu</a>( this ); - <a href="qpopupmenu.html">TQPopupMenu</a>* helpMenu = new <a href="qpopupmenu.html">TQPopupMenu</a>( this ); + <a href="ntqpopupmenu.html">TQPopupMenu</a>* fileMenu = new <a href="ntqpopupmenu.html">TQPopupMenu</a>( this ); + <a href="ntqpopupmenu.html">TQPopupMenu</a>* helpMenu = new <a href="ntqpopupmenu.html">TQPopupMenu</a>( this ); - <a href="qmainwindow.html#menuBar">menuBar</a>()->insertItem( "&File", fileMenu ); - <a href="qmainwindow.html#menuBar">menuBar</a>()->insertItem( "&Help", helpMenu ); + <a href="ntqmainwindow.html#menuBar">menuBar</a>()->insertItem( "&File", fileMenu ); + <a href="ntqmainwindow.html#menuBar">menuBar</a>()->insertItem( "&Help", helpMenu ); - int fileId = fileMenu-><a href="qmenudata.html#insertItem">insertItem</a>( "E&xit", this, SLOT(<a href="qwidget.html#close">close</a>()) ); + int fileId = fileMenu-><a href="ntqmenudata.html#insertItem">insertItem</a>( "E&xit", this, SLOT(<a href="ntqwidget.html#close">close</a>()) ); - int helpId = helpMenu-><a href="qmenudata.html#insertItem">insertItem</a>( "Open Assistant", this, SLOT(assistantSlot()) ); + int helpId = helpMenu-><a href="ntqmenudata.html#insertItem">insertItem</a>( "Open Assistant", this, SLOT(assistantSlot()) ); // populate toolbar - <a href="qtoolbar.html">TQToolBar</a>* toolbar = new <a href="qtoolbar.html">TQToolBar</a>( this ); - <a href="qtoolbutton.html">TQToolButton</a>* assistantButton = new <a href="qtoolbutton.html">TQToolButton</a>( toolbar ); - <a name="x2694"></a> assistantButton-><a href="qtoolbutton.html#setIconSet">setIconSet</a>( TQPixmap("appicon.png") ); + <a href="ntqtoolbar.html">TQToolBar</a>* toolbar = new <a href="ntqtoolbar.html">TQToolBar</a>( this ); + <a href="ntqtoolbutton.html">TQToolButton</a>* assistantButton = new <a href="ntqtoolbutton.html">TQToolButton</a>( toolbar ); + <a name="x2694"></a> assistantButton-><a href="ntqtoolbutton.html#setIconSet">setIconSet</a>( TQPixmap("appicon.png") ); </pre> -<p> A <a href="qtable.html">TQTable</a> is used as the central widget and the table, the menus +<p> A <a href="ntqtable.html">TQTable</a> is used as the central widget and the table, the menus and the toolbar are populated. -<pre> <a name="x2699"></a> TQWhatsThis::<a href="qwhatsthis.html#whatsThisButton">whatsThisButton</a>( toolbar ); +<pre> <a name="x2699"></a> TQWhatsThis::<a href="ntqwhatsthis.html#whatsThisButton">whatsThisButton</a>( toolbar ); </pre> -<p> The static function whatsThisButton() creates a <a href="qtoolbutton.html">TQToolButton</a> +<p> The static function whatsThisButton() creates a <a href="ntqtoolbutton.html">TQToolButton</a> which will enter "What's this?" mode when clicked. <pre> //create tooltipgroup <a href="qtooltipgroup.html">TQToolTipGroup</a> * tipGroup = new <a href="qtooltipgroup.html">TQToolTipGroup</a>( this ); - <a name="x2697"></a> <a href="qobject.html#connect">connect</a>( tipGroup, SIGNAL(<a href="qtooltipgroup.html#showTip">showTip</a>(const <a href="qstring.html">TQString</a>&)), statusBar(), - SLOT(message(const <a href="qstring.html">TQString</a>&)) ); - <a name="x2696"></a> <a href="qobject.html#connect">connect</a>( tipGroup, SIGNAL(<a href="qtooltipgroup.html#removeTip">removeTip</a>()), statusBar(), SLOT(clear()) ); + <a name="x2697"></a> <a href="ntqobject.html#connect">connect</a>( tipGroup, SIGNAL(<a href="qtooltipgroup.html#showTip">showTip</a>(const <a href="ntqstring.html">TQString</a>&)), statusBar(), + SLOT(message(const <a href="ntqstring.html">TQString</a>&)) ); + <a name="x2696"></a> <a href="ntqobject.html#connect">connect</a>( tipGroup, SIGNAL(<a href="qtooltipgroup.html#removeTip">removeTip</a>()), statusBar(), SLOT(clear()) ); </pre> <p> A <a href="qtooltipgroup.html">TQToolTipGroup</a> is created and will show and remove tooltips in the statusbar as the tooltips are displayed on the widgets. <pre> // set up tooltips - <a name="x2695"></a> TQToolTip::<a href="qtooltip.html#add">add</a>( assistantButton, tr ("Open Assistant"), tipGroup, "Opens TQt Assistant" ); + <a name="x2695"></a> TQToolTip::<a href="ntqtooltip.html#add">add</a>( assistantButton, tr ("Open Assistant"), tipGroup, "Opens TQt Assistant" ); - <a name="x2690"></a> horizontalTip = new HeaderToolTip( table-><a href="qtable.html#horizontalHeader">horizontalHeader</a>(), tipGroup ); - <a name="x2693"></a> verticalTip = new HeaderToolTip( table-><a href="qtable.html#verticalHeader">verticalHeader</a>(), tipGroup ); + <a name="x2690"></a> horizontalTip = new HeaderToolTip( table-><a href="ntqtable.html#horizontalHeader">horizontalHeader</a>(), tipGroup ); + <a name="x2693"></a> verticalTip = new HeaderToolTip( table-><a href="ntqtable.html#verticalHeader">verticalHeader</a>(), tipGroup ); cellTip = new TableToolTip( table, tipGroup ); </pre> <p> The tooltips are set up. The static function add() sets up a tooltip on the Assistant toolbutton. Tooltip objects are created -using the <a href="qtooltip.html">TQToolTip</a> subclasses, the constructor's first parameter +using the <a href="ntqtooltip.html">TQToolTip</a> subclasses, the constructor's first parameter specifies the widget we want to add dynamic tooltips for and the second argument specifies the <a href="qtooltipgroup.html">TQToolTipGroup</a> they should belong to. <pre> // set up whats this - <a name="x2698"></a> TQWhatsThis::<a href="qwhatsthis.html#add">add</a> ( assistantButton, "This is a toolbutton which opens Assistant" ); + <a name="x2698"></a> TQWhatsThis::<a href="ntqwhatsthis.html#add">add</a> ( assistantButton, "This is a toolbutton which opens Assistant" ); - HeaderWhatsThis *horizontalWhatsThis = new HeaderWhatsThis( table-><a href="qtable.html#horizontalHeader">horizontalHeader</a>() ); - HeaderWhatsThis *verticalWhatsThis = new HeaderWhatsThis( table-><a href="qtable.html#verticalHeader">verticalHeader</a>() ); + HeaderWhatsThis *horizontalWhatsThis = new HeaderWhatsThis( table-><a href="ntqtable.html#horizontalHeader">horizontalHeader</a>() ); + HeaderWhatsThis *verticalWhatsThis = new HeaderWhatsThis( table-><a href="ntqtable.html#verticalHeader">verticalHeader</a>() ); TableWhatsThis *cellWhatsThis = new TableWhatsThis( table ); - <a name="x2689"></a> fileMenu-><a href="qmenudata.html#setWhatsThis">setWhatsThis</a>( fileId, "Click here to exit the application" ); - helpMenu-><a href="qmenudata.html#setWhatsThis">setWhatsThis</a>( helpId, "Click here to open Assistant" ); + <a name="x2689"></a> fileMenu-><a href="ntqmenudata.html#setWhatsThis">setWhatsThis</a>( fileId, "Click here to exit the application" ); + helpMenu-><a href="ntqmenudata.html#setWhatsThis">setWhatsThis</a>( helpId, "Click here to open Assistant" ); </pre> <p> The WhatsThis help is set up. The static function add() adds What's This? help for the toolbutton which opens Assistant. @@ -422,13 +422,13 @@ Instances of the two WhatsThis subclasses are created for the headers and the table. What's This? help is also added for the menu items. <pre> // connections - <a href="qobject.html#connect">connect</a>( assistantButton, SIGNAL(<a href="qbutton.html#clicked">clicked</a>()), this, SLOT(assistantSlot()) ); - <a href="qobject.html#connect">connect</a>( horizontalWhatsThis, SIGNAL(linkClicked(const <a href="qstring.html">TQString</a>&)), assistant, - SLOT(<a href="qassistantclient.html#showPage">showPage</a>(const <a href="qstring.html">TQString</a>&)) ); - <a href="qobject.html#connect">connect</a>( verticalWhatsThis, SIGNAL(linkClicked(const <a href="qstring.html">TQString</a>&)), assistant, - SLOT(<a href="qassistantclient.html#showPage">showPage</a>(const <a href="qstring.html">TQString</a>&)) ); - <a href="qobject.html#connect">connect</a>( cellWhatsThis, SIGNAL(linkClicked(const <a href="qstring.html">TQString</a>&)), assistant, - SLOT(<a href="qassistantclient.html#showPage">showPage</a>(const <a href="qstring.html">TQString</a>&)) ); + <a href="ntqobject.html#connect">connect</a>( assistantButton, SIGNAL(<a href="ntqbutton.html#clicked">clicked</a>()), this, SLOT(assistantSlot()) ); + <a href="ntqobject.html#connect">connect</a>( horizontalWhatsThis, SIGNAL(linkClicked(const <a href="ntqstring.html">TQString</a>&)), assistant, + SLOT(<a href="ntqassistantclient.html#showPage">showPage</a>(const <a href="ntqstring.html">TQString</a>&)) ); + <a href="ntqobject.html#connect">connect</a>( verticalWhatsThis, SIGNAL(linkClicked(const <a href="ntqstring.html">TQString</a>&)), assistant, + SLOT(<a href="ntqassistantclient.html#showPage">showPage</a>(const <a href="ntqstring.html">TQString</a>&)) ); + <a href="ntqobject.html#connect">connect</a>( cellWhatsThis, SIGNAL(linkClicked(const <a href="ntqstring.html">TQString</a>&)), assistant, + SLOT(<a href="ntqassistantclient.html#showPage">showPage</a>(const <a href="ntqstring.html">TQString</a>&)) ); } </pre> <p> Signals and slots are connected, so that the relevant pages will @@ -442,13 +442,13 @@ the assistant button. } </pre> <p> The destructor deletes the tooltips. We need to delete the -tooltips explicitly since <a href="qtooltip.html">TQToolTip</a> is, as mentioned above, not -a subclass of <a href="qobject.html">TQObject</a> and the instances of TQToolTip not will be +tooltips explicitly since <a href="ntqtooltip.html">TQToolTip</a> is, as mentioned above, not +a subclass of <a href="ntqobject.html">TQObject</a> and the instances of TQToolTip not will be deleted when the widget is deleted. <pre> void MainWindow::assistantSlot() { - <a href="qstring.html">TQString</a> docsPath = TQDir("../../doc").absPath(); - <a name="x2686"></a> assistant-><a href="qassistantclient.html#showPage">showPage</a>( TQString("%1/html/qassistantclient.html").arg(docsPath) ); + <a href="ntqstring.html">TQString</a> docsPath = TQDir("../../doc").absPath(); + <a name="x2686"></a> assistant-><a href="ntqassistantclient.html#showPage">showPage</a>( TQString("%1/html/ntqassistantclient.html").arg(docsPath) ); } </pre> <p> The assistantSlot() uses applicationDirPath() to find the @@ -456,16 +456,16 @@ location of the documentation files and shows the specified page in TQt Assistant. -<pre> #include <<a href="qapplication-h.html">qapplication.h</a>> +<pre> #include <<a href="qapplication-h.html">ntqapplication.h</a>> #include "mainwindow.h" int main( int argc, char** argv ) { - <a href="qapplication.html">TQApplication</a> app( argc, argv ); + <a href="ntqapplication.html">TQApplication</a> app( argc, argv ); MainWindow main; - main.<a href="qwidget.html#show">show</a>(); - <a name="x2701"></a> app.<a href="qapplication.html#setMainWidget">setMainWidget</a>( &main ); - <a name="x2700"></a> return app.<a href="qapplication.html#exec">exec</a>(); + main.<a href="ntqwidget.html#show">show</a>(); + <a name="x2701"></a> app.<a href="ntqapplication.html#setMainWidget">setMainWidget</a>( &main ); + <a name="x2700"></a> return app.<a href="ntqapplication.html#exec">exec</a>(); } </pre> <p> The main function is a standard implementation opening @@ -476,11 +476,11 @@ and use the make tool to build the library. <hr> <ol> <li><a name="footnote1"></a> -Note that <a href="moc.html#moc">moc</a> requires that <a href="qobject.html">TQObject</a> +Note that <a href="moc.html#moc">moc</a> requires that <a href="ntqobject.html">TQObject</a> is the first base class. <a href="#footnote-call1">Back...</a> <li><a name="footnote2"></a> Note that we have to explicitly scope the orientation -(TQObject or <a href="qwhatsthis.html">TQWhatsThis</a>) since HeaderWhatsThis uses multiple +(TQObject or <a href="ntqwhatsthis.html">TQWhatsThis</a>) since HeaderWhatsThis uses multiple inheritance. <a href="#footnote-call2">Back...</a></ol> </hr><p>See also <a href="examples.html">Examples</a>. |