diff options
Diffstat (limited to 'doc/html/helpsystem-example.html')
-rw-r--r-- | doc/html/helpsystem-example.html | 88 |
1 files changed, 44 insertions, 44 deletions
diff --git a/doc/html/helpsystem-example.html b/doc/html/helpsystem-example.html index 823f244f9..991d65b69 100644 --- a/doc/html/helpsystem-example.html +++ b/doc/html/helpsystem-example.html @@ -37,17 +37,17 @@ 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="ntqtooltip.html">TQToolTip</a> and <a href="ntqwhatsthis.html">TQWhatsThis</a> to provide both static and +<p> It uses <a href="tqtooltip.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 +<a href="tqtooltipgroup.html">TQToolTipGroup</a> to display extended information for each tooltip 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="ntqmainwindow.html">TQMainWindow</a> with a menubar, statusbar and a toolbar, and uses +<a href="tqmainwindow.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="ntqtooltip.html">TQToolTip</a> +<pre> class HeaderToolTip : public <a href="tqtooltip.html">TQToolTip</a> { public: HeaderToolTip( <a href="ntqheader.html">TQHeader</a> *header, TQToolTipGroup *group = 0 ); @@ -58,13 +58,13 @@ a <a href="ntqtable.html">TQTable</a> as the central widget. </pre> <p> Two TQToolTip subclasses implement dynamic tooltips for <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 +constructors differ from the <a href="tqtooltip.html">TQToolTip</a> constructor in having a TQHeader and a TQTable respectively as the first parameter for the constructor instead of a <a href="tqwidget.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 +passed as arguments. A <a href="tqtooltipgroup.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="ntqtooltip.html">TQToolTip</a> +<p> <pre> class TableToolTip : public <a href="tqtooltip.html">TQToolTip</a> { public: TableToolTip( <a href="ntqtable.html">TQTable</a>* table, TQToolTipGroup *group = 0 ); @@ -81,15 +81,15 @@ as a member for easier access of the TQTable object later on. <p> <pre> HeaderToolTip::HeaderToolTip( <a href="ntqheader.html">TQHeader</a> *header, TQToolTipGroup *group ) - : <a href="ntqtooltip.html">TQToolTip</a>( header, group ) + : <a href="tqtooltip.html">TQToolTip</a>( header, group ) { } </pre> <p> The HeaderToolTip constructor propagates the parameters -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 ) +to the <a href="tqtooltip.html">TQToolTip</a> constructor. +<pre> void HeaderToolTip::<a href="tqtooltip.html#maybeTip">maybeTip</a> ( const <a href="ntqpoint.html">TQPoint</a>& p ) { - <a href="ntqheader.html">TQHeader</a> *header = (TQHeader*)<a href="ntqtooltip.html#parentWidget">parentWidget</a>(); + <a href="ntqheader.html">TQHeader</a> *header = (TQHeader*)<a href="tqtooltip.html#parentWidget">parentWidget</a>(); int section = 0; @@ -99,25 +99,25 @@ to the <a href="ntqtooltip.html">TQToolTip</a> constructor. 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="tqstring.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" ); + <a name="x2678"></a> <a href="tqtooltip.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="ntqheader.html">TQHeader</a> API to get the section at the requested position and uses -<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 +<a href="tqtooltip.html#tip">TQToolTip::tip</a>() to display the section's label in a +tooltip. The second string is used by <a href="tqtooltipgroup.html">TQToolTipGroup</a> and will show up in the statusbar. <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 ) + <a name="x2683"></a>: <a href="tqtooltip.html">TQToolTip</a>( tipTable-><a href="ntqscrollview.html#viewport">viewport</a>(), group ), table( tipTable ) { } </pre> <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="ntqtooltip.html">TQToolTip</a> constructor, and initializes the table +group to the <a href="tqtooltip.html">TQToolTip</a> constructor, and initializes the table member with the TQTable pointer itself. -<pre> <a name="x2684"></a>void TableToolTip::<a href="ntqtooltip.html#maybeTip">maybeTip</a> ( const <a href="ntqpoint.html">TQPoint</a> &p ) +<pre> <a name="x2684"></a>void TableToolTip::<a href="tqtooltip.html#maybeTip">maybeTip</a> ( const <a href="ntqpoint.html">TQPoint</a> &p ) { <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>() ); @@ -133,7 +133,7 @@ The <a href="ntqtable.html">TQTable</a> API expects contents coordinates, and si 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="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" ); + <a href="tqtooltip.html#tip">tip</a>( cr, tipString, "This is a cell in a table" ); } </pre> @@ -141,8 +141,8 @@ 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="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. +the cell, and use <a href="tqtooltip.html#tip">TQToolTip::tip</a>() to display the cell's label +in a tooltip and to provide text for the <a href="tqtooltipgroup.html">TQToolTipGroup</a> as before. <pre> class WhatsThis : public <a href="tqobject.html">TQObject</a>, public TQWhatsThis { <a href="metaobjects.html#TQ_OBJECT">TQ_OBJECT</a> @@ -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="ntqmainwindow.html">TQMainWindow</a> +<pre> class MainWindow : public <a href="tqmainwindow.html">TQMainWindow</a> { TQ_OBJECT public: @@ -318,7 +318,7 @@ and return a string accordingly. <a href="ntqassistantclient.html">TQAssistantClient</a> *assistant; }; </pre> -<p> A <a href="ntqmainwindow.html">TQMainWindow</a> is used to create a user interface that uses the +<p> A <a href="tqmainwindow.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() @@ -331,14 +331,14 @@ member as well, to allow easier access to TQt Assistant later on. <pre> MainWindow::MainWindow() { - <a href="ntqmainwindow.html#statusBar">statusBar</a>(); + <a href="tqmainwindow.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="tqstring.html#TQString-null">TQString::null</a> as the first argument so that the system path is used. <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 ); + <a href="tqmainwindow.html#setCentralWidget">setCentralWidget</a>( table ); // populate table <a href="tqstringlist.html">TQStringList</a> comboEntries; @@ -362,37 +362,37 @@ so that the system path is used. table-><a href="ntqtable.html#verticalHeader">verticalHeader</a>()->setLabel( 1, "2" ); // populate menubar - <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="tqpopupmenu.html">TQPopupMenu</a>* fileMenu = new <a href="tqpopupmenu.html">TQPopupMenu</a>( this ); + <a href="tqpopupmenu.html">TQPopupMenu</a>* helpMenu = new <a href="tqpopupmenu.html">TQPopupMenu</a>( this ); - <a href="ntqmainwindow.html#menuBar">menuBar</a>()->insertItem( "&File", fileMenu ); - <a href="ntqmainwindow.html#menuBar">menuBar</a>()->insertItem( "&Help", helpMenu ); + <a href="tqmainwindow.html#menuBar">menuBar</a>()->insertItem( "&File", fileMenu ); + <a href="tqmainwindow.html#menuBar">menuBar</a>()->insertItem( "&Help", helpMenu ); - int fileId = fileMenu-><a href="ntqmenudata.html#insertItem">insertItem</a>( "E&xit", this, TQ_SLOT(<a href="tqwidget.html#close">close</a>()) ); + int fileId = fileMenu-><a href="tqmenudata.html#insertItem">insertItem</a>( "E&xit", this, TQ_SLOT(<a href="tqwidget.html#close">close</a>()) ); - int helpId = helpMenu-><a href="ntqmenudata.html#insertItem">insertItem</a>( "Open Assistant", this, TQ_SLOT(assistantSlot()) ); + int helpId = helpMenu-><a href="tqmenudata.html#insertItem">insertItem</a>( "Open Assistant", this, TQ_SLOT(assistantSlot()) ); // populate toolbar - <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") ); + <a href="tqtoolbar.html">TQToolBar</a>* toolbar = new <a href="tqtoolbar.html">TQToolBar</a>( this ); + <a href="tqtoolbutton.html">TQToolButton</a>* assistantButton = new <a href="tqtoolbutton.html">TQToolButton</a>( toolbar ); + <a name="x2694"></a> assistantButton-><a href="tqtoolbutton.html#setIconSet">setIconSet</a>( TQPixmap("appicon.png") ); </pre> <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="ntqwhatsthis.html#whatsThisButton">whatsThisButton</a>( toolbar ); </pre> -<p> The static function whatsThisButton() creates a <a href="ntqtoolbutton.html">TQToolButton</a> +<p> The static function whatsThisButton() creates a <a href="tqtoolbutton.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="tqobject.html#connect">connect</a>( tipGroup, TQ_SIGNAL(<a href="qtooltipgroup.html#showTip">showTip</a>(const <a href="tqstring.html">TQString</a>&)), statusBar(), + <a href="tqtooltipgroup.html">TQToolTipGroup</a> * tipGroup = new <a href="tqtooltipgroup.html">TQToolTipGroup</a>( this ); + <a name="x2697"></a> <a href="tqobject.html#connect">connect</a>( tipGroup, TQ_SIGNAL(<a href="tqtooltipgroup.html#showTip">showTip</a>(const <a href="tqstring.html">TQString</a>&)), statusBar(), TQ_SLOT(message(const <a href="tqstring.html">TQString</a>&)) ); - <a name="x2696"></a> <a href="tqobject.html#connect">connect</a>( tipGroup, TQ_SIGNAL(<a href="qtooltipgroup.html#removeTip">removeTip</a>()), statusBar(), TQ_SLOT(clear()) ); + <a name="x2696"></a> <a href="tqobject.html#connect">connect</a>( tipGroup, TQ_SIGNAL(<a href="tqtooltipgroup.html#removeTip">removeTip</a>()), statusBar(), TQ_SLOT(clear()) ); </pre> -<p> A <a href="qtooltipgroup.html">TQToolTipGroup</a> is created and will show and remove tooltips +<p> A <a href="tqtooltipgroup.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="ntqtooltip.html#add">add</a>( assistantButton, tr ("Open Assistant"), tipGroup, "Opens TQt Assistant" ); + <a name="x2695"></a> TQToolTip::<a href="tqtooltip.html#add">add</a>( assistantButton, tr ("Open Assistant"), tipGroup, "Opens TQt Assistant" ); <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 ); @@ -401,9 +401,9 @@ in the statusbar as the tooltips are displayed on the widgets. </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="ntqtooltip.html">TQToolTip</a> subclasses, the constructor's first parameter +using the <a href="tqtooltip.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 +second argument specifies the <a href="tqtooltipgroup.html">TQToolTipGroup</a> they should belong to. <pre> // set up whats this <a name="x2698"></a> TQWhatsThis::<a href="ntqwhatsthis.html#add">add</a> ( assistantButton, "This is a toolbutton which opens Assistant" ); @@ -413,8 +413,8 @@ to. TableWhatsThis *cellWhatsThis = new TableWhatsThis( table ); - <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" ); + <a name="x2689"></a> fileMenu-><a href="tqmenudata.html#setWhatsThis">setWhatsThis</a>( fileId, "Click here to exit the application" ); + helpMenu-><a href="tqmenudata.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. @@ -442,7 +442,7 @@ the assistant button. } </pre> <p> The destructor deletes the tooltips. We need to delete the -tooltips explicitly since <a href="ntqtooltip.html">TQToolTip</a> is, as mentioned above, not +tooltips explicitly since <a href="tqtooltip.html">TQToolTip</a> is, as mentioned above, not a subclass of <a href="tqobject.html">TQObject</a> and the instances of TQToolTip not will be deleted when the widget is deleted. <pre> void MainWindow::assistantSlot() |