summaryrefslogtreecommitdiffstats
path: root/doc/html/qaction-application-example.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/qaction-application-example.html')
-rw-r--r--doc/html/qaction-application-example.html282
1 files changed, 141 insertions, 141 deletions
diff --git a/doc/html/qaction-application-example.html b/doc/html/qaction-application-example.html
index 2709e863..d028aa83 100644
--- a/doc/html/qaction-application-example.html
+++ b/doc/html/qaction-application-example.html
@@ -33,7 +33,7 @@ body { background: #ffffff; color: black; }
<p>
-<p> The <a href="qaction.html">TQAction</a> class provides a way of associating user input from different
+<p> The <a href="ntqaction.html">TQAction</a> class provides a way of associating user input from different
user interface elements with abstract high level actions. This approach makes
it easy to customize applications for different types of users.
<p> This example program is just like the
@@ -54,11 +54,11 @@ but uses TQAction to build the menu and the toolbar.
#ifndef APPLICATION_H
#define APPLICATION_H
-#include &lt;<a href="qmainwindow-h.html">qmainwindow.h</a>&gt;
+#include &lt;<a href="qmainwindow-h.html">ntqmainwindow.h</a>&gt;
class TQTextEdit;
-class ApplicationWindow: public <a href="qmainwindow.html">TQMainWindow</a>
+class ApplicationWindow: public <a href="ntqmainwindow.html">TQMainWindow</a>
{
<a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a>
@@ -72,7 +72,7 @@ protected:
private slots:
void newDoc();
void choose();
- void load( const <a href="qstring.html">TQString</a> &amp;fileName );
+ void load( const <a href="ntqstring.html">TQString</a> &amp;fileName );
void save();
void saveAs();
void print();
@@ -81,9 +81,9 @@ private slots:
void aboutTQt();
private:
- <a href="qprinter.html">TQPrinter</a> *printer;
- <a href="qtextedit.html">TQTextEdit</a> *e;
- <a href="qstring.html">TQString</a> filename;
+ <a href="ntqprinter.html">TQPrinter</a> *printer;
+ <a href="ntqtextedit.html">TQTextEdit</a> *e;
+ <a href="ntqstring.html">TQString</a> filename;
};
@@ -104,26 +104,26 @@ private:
#include "application.h"
-#include &lt;<a href="qimage-h.html">qimage.h</a>&gt;
-#include &lt;<a href="qpixmap-h.html">qpixmap.h</a>&gt;
-#include &lt;<a href="qtoolbar-h.html">qtoolbar.h</a>&gt;
-#include &lt;<a href="qtoolbutton-h.html">qtoolbutton.h</a>&gt;
-#include &lt;<a href="qpopupmenu-h.html">qpopupmenu.h</a>&gt;
-#include &lt;<a href="qmenubar-h.html">qmenubar.h</a>&gt;
-#include &lt;<a href="qtextedit-h.html">qtextedit.h</a>&gt;
-#include &lt;<a href="qfile-h.html">qfile.h</a>&gt;
-#include &lt;<a href="qfiledialog-h.html">qfiledialog.h</a>&gt;
-#include &lt;<a href="qstatusbar-h.html">qstatusbar.h</a>&gt;
-#include &lt;<a href="qmessagebox-h.html">qmessagebox.h</a>&gt;
-#include &lt;<a href="qprinter-h.html">qprinter.h</a>&gt;
-#include &lt;<a href="qapplication-h.html">qapplication.h</a>&gt;
-#include &lt;<a href="qaccel-h.html">qaccel.h</a>&gt;
-#include &lt;<a href="qtextstream-h.html">qtextstream.h</a>&gt;
-#include &lt;<a href="qpainter-h.html">qpainter.h</a>&gt;
-#include &lt;<a href="qpaintdevicemetrics-h.html">qpaintdevicemetrics.h</a>&gt;
-#include &lt;<a href="qwhatsthis-h.html">qwhatsthis.h</a>&gt;
-#include &lt;<a href="qaction-h.html">qaction.h</a>&gt;
-#include &lt;<a href="qsimplerichtext-h.html">qsimplerichtext.h</a>&gt;
+#include &lt;<a href="qimage-h.html">ntqimage.h</a>&gt;
+#include &lt;<a href="qpixmap-h.html">ntqpixmap.h</a>&gt;
+#include &lt;<a href="qtoolbar-h.html">ntqtoolbar.h</a>&gt;
+#include &lt;<a href="qtoolbutton-h.html">ntqtoolbutton.h</a>&gt;
+#include &lt;<a href="qpopupmenu-h.html">ntqpopupmenu.h</a>&gt;
+#include &lt;<a href="qmenubar-h.html">ntqmenubar.h</a>&gt;
+#include &lt;<a href="qtextedit-h.html">ntqtextedit.h</a>&gt;
+#include &lt;<a href="qfile-h.html">ntqfile.h</a>&gt;
+#include &lt;<a href="qfiledialog-h.html">ntqfiledialog.h</a>&gt;
+#include &lt;<a href="qstatusbar-h.html">ntqstatusbar.h</a>&gt;
+#include &lt;<a href="qmessagebox-h.html">ntqmessagebox.h</a>&gt;
+#include &lt;<a href="qprinter-h.html">ntqprinter.h</a>&gt;
+#include &lt;<a href="qapplication-h.html">ntqapplication.h</a>&gt;
+#include &lt;<a href="qaccel-h.html">ntqaccel.h</a>&gt;
+#include &lt;<a href="qtextstream-h.html">ntqtextstream.h</a>&gt;
+#include &lt;<a href="qpainter-h.html">ntqpainter.h</a>&gt;
+#include &lt;<a href="qpaintdevicemetrics-h.html">ntqpaintdevicemetrics.h</a>&gt;
+#include &lt;<a href="qwhatsthis-h.html">ntqwhatsthis.h</a>&gt;
+#include &lt;<a href="qaction-h.html">ntqaction.h</a>&gt;
+#include &lt;<a href="qsimplerichtext-h.html">ntqsimplerichtext.h</a>&gt;
#include "filesave.xpm"
#include "fileopen.xpm"
@@ -131,113 +131,113 @@ private:
<a name="f375"></a>ApplicationWindow::ApplicationWindow()
- : <a href="qmainwindow.html">TQMainWindow</a>( 0, "example application main window", WDestructiveClose )
+ : <a href="ntqmainwindow.html">TQMainWindow</a>( 0, "example application main window", WDestructiveClose )
{
- printer = new <a href="qprinter.html">TQPrinter</a>( TQPrinter::HighResolution );
+ printer = new <a href="ntqprinter.html">TQPrinter</a>( TQPrinter::HighResolution );
- <a href="qaction.html">TQAction</a> * fileNewAction;
- <a href="qaction.html">TQAction</a> * fileOpenAction;
- <a href="qaction.html">TQAction</a> * fileSaveAction, * fileSaveAsAction, * filePrintAction;
- <a href="qaction.html">TQAction</a> * fileCloseAction, * fileQuitAction;
+ <a href="ntqaction.html">TQAction</a> * fileNewAction;
+ <a href="ntqaction.html">TQAction</a> * fileOpenAction;
+ <a href="ntqaction.html">TQAction</a> * fileSaveAction, * fileSaveAsAction, * filePrintAction;
+ <a href="ntqaction.html">TQAction</a> * fileCloseAction, * fileQuitAction;
- fileNewAction = new <a href="qaction.html">TQAction</a>( "&amp;New", CTRL+Key_N, this, "new" );
-<a name="x1123"></a> <a href="qobject.html#connect">connect</a>( fileNewAction, SIGNAL( <a href="qaction.html#activated">activated</a>() ) , this,
+ fileNewAction = new <a href="ntqaction.html">TQAction</a>( "&amp;New", CTRL+Key_N, this, "new" );
+<a name="x1123"></a> <a href="ntqobject.html#connect">connect</a>( fileNewAction, SIGNAL( <a href="ntqaction.html#activated">activated</a>() ) , this,
SLOT( newDoc() ) );
- fileOpenAction = new <a href="qaction.html">TQAction</a>( TQPixmap( fileopen ), "&amp;Open...",
+ fileOpenAction = new <a href="ntqaction.html">TQAction</a>( TQPixmap( fileopen ), "&amp;Open...",
CTRL+Key_O, this, "open" );
- <a href="qobject.html#connect">connect</a>( fileOpenAction, SIGNAL( <a href="qaction.html#activated">activated</a>() ) , this, SLOT( choose() ) );
+ <a href="ntqobject.html#connect">connect</a>( fileOpenAction, SIGNAL( <a href="ntqaction.html#activated">activated</a>() ) , this, SLOT( choose() ) );
const char * fileOpenText = "&lt;p&gt;&lt;img source=\"fileopen\"&gt; "
"Click this button to open a &lt;em&gt;new file&lt;/em&gt;. &lt;br&gt;"
"You can also select the &lt;b&gt;Open&lt;/b&gt; command "
"from the &lt;b&gt;File&lt;/b&gt; menu.&lt;/p&gt;";
<a name="x1140"></a> TQMimeSourceFactory::<a href="qmimesourcefactory.html#defaultFactory">defaultFactory</a>()-&gt;setPixmap( "fileopen",
-<a name="x1125"></a> fileOpenAction-&gt;<a href="qaction.html#iconSet">iconSet</a>().pixmap() );
-<a name="x1126"></a> fileOpenAction-&gt;<a href="qaction.html#setWhatsThis">setWhatsThis</a>( fileOpenText );
+<a name="x1125"></a> fileOpenAction-&gt;<a href="ntqaction.html#iconSet">iconSet</a>().pixmap() );
+<a name="x1126"></a> fileOpenAction-&gt;<a href="ntqaction.html#setWhatsThis">setWhatsThis</a>( fileOpenText );
- fileSaveAction = new <a href="qaction.html">TQAction</a>( TQPixmap( filesave ),
+ fileSaveAction = new <a href="ntqaction.html">TQAction</a>( TQPixmap( filesave ),
"&amp;Save", CTRL+Key_S, this, "save" );
- <a href="qobject.html#connect">connect</a>( fileSaveAction, SIGNAL( <a href="qaction.html#activated">activated</a>() ) , this, SLOT( save() ) );
+ <a href="ntqobject.html#connect">connect</a>( fileSaveAction, SIGNAL( <a href="ntqaction.html#activated">activated</a>() ) , this, SLOT( save() ) );
const char * fileSaveText = "&lt;p&gt;Click this button to save the file you "
"are editing. You will be prompted for a file name.\n"
"You can also select the &lt;b&gt;Save&lt;/b&gt; command "
"from the &lt;b&gt;File&lt;/b&gt; menu.&lt;/p&gt;";
- fileSaveAction-&gt;<a href="qaction.html#setWhatsThis">setWhatsThis</a>( fileSaveText );
+ fileSaveAction-&gt;<a href="ntqaction.html#setWhatsThis">setWhatsThis</a>( fileSaveText );
- fileSaveAsAction = new <a href="qaction.html">TQAction</a>( "Save File As", "Save &amp;As...", 0, this,
+ fileSaveAsAction = new <a href="ntqaction.html">TQAction</a>( "Save File As", "Save &amp;As...", 0, this,
"save as" );
- <a href="qobject.html#connect">connect</a>( fileSaveAsAction, SIGNAL( <a href="qaction.html#activated">activated</a>() ) , this,
+ <a href="ntqobject.html#connect">connect</a>( fileSaveAsAction, SIGNAL( <a href="ntqaction.html#activated">activated</a>() ) , this,
SLOT( saveAs() ) );
- fileSaveAsAction-&gt;<a href="qaction.html#setWhatsThis">setWhatsThis</a>( fileSaveText );
+ fileSaveAsAction-&gt;<a href="ntqaction.html#setWhatsThis">setWhatsThis</a>( fileSaveText );
- filePrintAction = new <a href="qaction.html">TQAction</a>( "Print File", TQPixmap( fileprint ),
+ filePrintAction = new <a href="ntqaction.html">TQAction</a>( "Print File", TQPixmap( fileprint ),
"&amp;Print...", CTRL+Key_P, this, "print" );
- <a href="qobject.html#connect">connect</a>( filePrintAction, SIGNAL( <a href="qaction.html#activated">activated</a>() ) , this,
+ <a href="ntqobject.html#connect">connect</a>( filePrintAction, SIGNAL( <a href="ntqaction.html#activated">activated</a>() ) , this,
SLOT( print() ) );
const char * filePrintText = "Click this button to print the file you "
"are editing.\n You can also select the Print "
"command from the File menu.";
- filePrintAction-&gt;<a href="qaction.html#setWhatsThis">setWhatsThis</a>( filePrintText );
+ filePrintAction-&gt;<a href="ntqaction.html#setWhatsThis">setWhatsThis</a>( filePrintText );
- fileCloseAction = new <a href="qaction.html">TQAction</a>( "Close", "&amp;Close", CTRL+Key_W, this,
+ fileCloseAction = new <a href="ntqaction.html">TQAction</a>( "Close", "&amp;Close", CTRL+Key_W, this,
"close" );
- <a href="qobject.html#connect">connect</a>( fileCloseAction, SIGNAL( <a href="qaction.html#activated">activated</a>() ) , this,
- SLOT( <a href="qwidget.html#close">close</a>() ) );
+ <a href="ntqobject.html#connect">connect</a>( fileCloseAction, SIGNAL( <a href="ntqaction.html#activated">activated</a>() ) , this,
+ SLOT( <a href="ntqwidget.html#close">close</a>() ) );
- fileQuitAction = new <a href="qaction.html">TQAction</a>( "Quit", "&amp;Quit", CTRL+Key_Q, this,
+ fileQuitAction = new <a href="ntqaction.html">TQAction</a>( "Quit", "&amp;Quit", CTRL+Key_Q, this,
"quit" );
-<a name="x1127"></a> <a href="qobject.html#connect">connect</a>( fileQuitAction, SIGNAL( <a href="qaction.html#activated">activated</a>() ) , qApp,
- SLOT( <a href="qapplication.html#closeAllWindows">closeAllWindows</a>() ) );
+<a name="x1127"></a> <a href="ntqobject.html#connect">connect</a>( fileQuitAction, SIGNAL( <a href="ntqaction.html#activated">activated</a>() ) , qApp,
+ SLOT( <a href="ntqapplication.html#closeAllWindows">closeAllWindows</a>() ) );
// populate a tool bar with some actions
- <a href="qtoolbar.html">TQToolBar</a> * fileTools = new <a href="qtoolbar.html">TQToolBar</a>( this, "file operations" );
-<a name="x1172"></a> fileTools-&gt;<a href="qtoolbar.html#setLabel">setLabel</a>( "File Operations" );
-<a name="x1124"></a> fileOpenAction-&gt;<a href="qaction.html#addTo">addTo</a>( fileTools );
- fileSaveAction-&gt;<a href="qaction.html#addTo">addTo</a>( fileTools );
- filePrintAction-&gt;<a href="qaction.html#addTo">addTo</a>( fileTools );
+ <a href="ntqtoolbar.html">TQToolBar</a> * fileTools = new <a href="ntqtoolbar.html">TQToolBar</a>( this, "file operations" );
+<a name="x1172"></a> fileTools-&gt;<a href="ntqtoolbar.html#setLabel">setLabel</a>( "File Operations" );
+<a name="x1124"></a> fileOpenAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( fileTools );
+ fileSaveAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( fileTools );
+ filePrintAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( fileTools );
(void)TQWhatsThis::whatsThisButton( fileTools );
// populate a menu with all actions
- <a href="qpopupmenu.html">TQPopupMenu</a> * file = new <a href="qpopupmenu.html">TQPopupMenu</a>( this );
- <a href="qmainwindow.html#menuBar">menuBar</a>()-&gt;insertItem( "&amp;File", file );
- fileNewAction-&gt;<a href="qaction.html#addTo">addTo</a>( file );
- fileOpenAction-&gt;<a href="qaction.html#addTo">addTo</a>( file );
- fileSaveAction-&gt;<a href="qaction.html#addTo">addTo</a>( file );
- fileSaveAsAction-&gt;<a href="qaction.html#addTo">addTo</a>( file );
- file-&gt;<a href="qmenudata.html#insertSeparator">insertSeparator</a>();
- filePrintAction-&gt;<a href="qaction.html#addTo">addTo</a>( file );
- file-&gt;<a href="qmenudata.html#insertSeparator">insertSeparator</a>();
- fileCloseAction-&gt;<a href="qaction.html#addTo">addTo</a>( file );
- fileQuitAction-&gt;<a href="qaction.html#addTo">addTo</a>( file );
+ <a href="ntqpopupmenu.html">TQPopupMenu</a> * file = new <a href="ntqpopupmenu.html">TQPopupMenu</a>( this );
+ <a href="ntqmainwindow.html#menuBar">menuBar</a>()-&gt;insertItem( "&amp;File", file );
+ fileNewAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( file );
+ fileOpenAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( file );
+ fileSaveAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( file );
+ fileSaveAsAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( file );
+ file-&gt;<a href="ntqmenudata.html#insertSeparator">insertSeparator</a>();
+ filePrintAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( file );
+ file-&gt;<a href="ntqmenudata.html#insertSeparator">insertSeparator</a>();
+ fileCloseAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( file );
+ fileQuitAction-&gt;<a href="ntqaction.html#addTo">addTo</a>( file );
- <a href="qmainwindow.html#menuBar">menuBar</a>()-&gt;insertSeparator();
+ <a href="ntqmainwindow.html#menuBar">menuBar</a>()-&gt;insertSeparator();
// add a help menu
- <a href="qpopupmenu.html">TQPopupMenu</a> * help = new <a href="qpopupmenu.html">TQPopupMenu</a>( this );
- <a href="qmainwindow.html#menuBar">menuBar</a>()-&gt;insertItem( "&amp;Help", help );
- help-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;About", this, SLOT(about()), Key_F1 );
- help-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "About &amp;TQt", this, SLOT(aboutTQt()) );
- help-&gt;<a href="qmenudata.html#insertSeparator">insertSeparator</a>();
- help-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "What's &amp;This", this, SLOT(<a href="qmainwindow.html#whatsThis">whatsThis</a>()),
+ <a href="ntqpopupmenu.html">TQPopupMenu</a> * help = new <a href="ntqpopupmenu.html">TQPopupMenu</a>( this );
+ <a href="ntqmainwindow.html#menuBar">menuBar</a>()-&gt;insertItem( "&amp;Help", help );
+ help-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;About", this, SLOT(about()), Key_F1 );
+ help-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "About &amp;TQt", this, SLOT(aboutTQt()) );
+ help-&gt;<a href="ntqmenudata.html#insertSeparator">insertSeparator</a>();
+ help-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "What's &amp;This", this, SLOT(<a href="ntqmainwindow.html#whatsThis">whatsThis</a>()),
SHIFT+Key_F1 );
// create and define the central widget
- e = new <a href="qtextedit.html">TQTextEdit</a>( this, "editor" );
- e-&gt;<a href="qwidget.html#setFocus">setFocus</a>();
- <a href="qmainwindow.html#setCentralWidget">setCentralWidget</a>( e );
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Ready", 2000 );
+ e = new <a href="ntqtextedit.html">TQTextEdit</a>( this, "editor" );
+ e-&gt;<a href="ntqwidget.html#setFocus">setFocus</a>();
+ <a href="ntqmainwindow.html#setCentralWidget">setCentralWidget</a>( e );
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Ready", 2000 );
- <a href="qwidget.html#resize">resize</a>( 450, 600 );
+ <a href="ntqwidget.html#resize">resize</a>( 450, 600 );
}
@@ -251,31 +251,31 @@ ApplicationWindow::~ApplicationWindow()
void <a name="f376"></a>ApplicationWindow::newDoc()
{
ApplicationWindow *ed = new ApplicationWindow;
- ed-&gt;<a href="qwidget.html#show">show</a>();
+ ed-&gt;<a href="ntqwidget.html#show">show</a>();
}
void <a name="f377"></a>ApplicationWindow::choose()
{
-<a name="x1132"></a> <a href="qstring.html">TQString</a> fn = TQFileDialog::<a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>( <a href="qstring.html#TQString-null">TQString::null</a>, TQString::null,
+<a name="x1132"></a> <a href="ntqstring.html">TQString</a> fn = TQFileDialog::<a href="ntqfiledialog.html#getOpenFileName">getOpenFileName</a>( <a href="ntqstring.html#TQString-null">TQString::null</a>, TQString::null,
this);
- if ( !fn.<a href="qstring.html#isEmpty">isEmpty</a>() )
+ if ( !fn.<a href="ntqstring.html#isEmpty">isEmpty</a>() )
load( fn );
else
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Loading aborted", 2000 );
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Loading aborted", 2000 );
}
-void <a name="f378"></a>ApplicationWindow::load( const <a href="qstring.html">TQString</a> &amp;fileName )
+void <a name="f378"></a>ApplicationWindow::load( const <a href="ntqstring.html">TQString</a> &amp;fileName )
{
- <a href="qfile.html">TQFile</a> f( fileName );
- if ( !f.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_ReadOnly</a> ) )
+ <a href="ntqfile.html">TQFile</a> f( fileName );
+ if ( !f.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_ReadOnly</a> ) )
return;
- <a href="qtextstream.html">TQTextStream</a> ts( &amp;f );
-<a name="x1171"></a><a name="x1168"></a> e-&gt;<a href="qtextedit.html#setText">setText</a>( ts.<a href="qtextstream.html#read">read</a>() );
-<a name="x1167"></a> e-&gt;<a href="qtextedit.html#setModified">setModified</a>( FALSE );
- <a href="qwidget.html#setCaption">setCaption</a>( fileName );
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Loaded document " + fileName, 2000 );
+ <a href="ntqtextstream.html">TQTextStream</a> ts( &amp;f );
+<a name="x1171"></a><a name="x1168"></a> e-&gt;<a href="ntqtextedit.html#setText">setText</a>( ts.<a href="ntqtextstream.html#read">read</a>() );
+<a name="x1167"></a> e-&gt;<a href="ntqtextedit.html#setModified">setModified</a>( FALSE );
+ <a href="ntqwidget.html#setCaption">setCaption</a>( fileName );
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Loaded document " + fileName, 2000 );
}
@@ -286,88 +286,88 @@ void <a name="f379"></a>ApplicationWindow::save()
return;
}
-<a name="x1170"></a> <a href="qstring.html">TQString</a> text = e-&gt;<a href="qtextedit.html#text">text</a>();
- <a href="qfile.html">TQFile</a> f( filename );
- if ( !f.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_WriteOnly</a> ) ) {
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( TQString("Could not write to %1").arg(filename),
+<a name="x1170"></a> <a href="ntqstring.html">TQString</a> text = e-&gt;<a href="ntqtextedit.html#text">text</a>();
+ <a href="ntqfile.html">TQFile</a> f( filename );
+ if ( !f.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_WriteOnly</a> ) ) {
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( TQString("Could not write to %1").arg(filename),
2000 );
return;
}
- <a href="qtextstream.html">TQTextStream</a> t( &amp;f );
+ <a href="ntqtextstream.html">TQTextStream</a> t( &amp;f );
t &lt;&lt; text;
- f.<a href="qfile.html#close">close</a>();
+ f.<a href="ntqfile.html#close">close</a>();
- e-&gt;<a href="qtextedit.html#setModified">setModified</a>( FALSE );
+ e-&gt;<a href="ntqtextedit.html#setModified">setModified</a>( FALSE );
- <a href="qwidget.html#setCaption">setCaption</a>( filename );
+ <a href="ntqwidget.html#setCaption">setCaption</a>( filename );
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( TQString( "File %1 saved" ).arg( filename ), 2000 );
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( TQString( "File %1 saved" ).arg( filename ), 2000 );
}
void <a name="f380"></a>ApplicationWindow::saveAs()
{
-<a name="x1133"></a> <a href="qstring.html">TQString</a> fn = TQFileDialog::<a href="qfiledialog.html#getSaveFileName">getSaveFileName</a>( TQString::null, TQString::null,
+<a name="x1133"></a> <a href="ntqstring.html">TQString</a> fn = TQFileDialog::<a href="ntqfiledialog.html#getSaveFileName">getSaveFileName</a>( TQString::null, TQString::null,
this );
- if ( !fn.<a href="qstring.html#isEmpty">isEmpty</a>() ) {
+ if ( !fn.<a href="ntqstring.html#isEmpty">isEmpty</a>() ) {
filename = fn;
save();
} else {
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Saving aborted", 2000 );
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Saving aborted", 2000 );
}
}
void <a name="f381"></a>ApplicationWindow::print()
{
-<a name="x1150"></a> printer-&gt;<a href="qprinter.html#setFullPage">setFullPage</a>( TRUE );
-<a name="x1151"></a> if ( printer-&gt;<a href="qprinter.html#setup">setup</a>(this) ) { // printer dialog
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Printing..." );
- <a href="qpainter.html">TQPainter</a> p;
- if( !p.<a href="qpainter.html#begin">begin</a>( printer ) ) { // paint on printer
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Printing aborted", 2000 );
+<a name="x1150"></a> printer-&gt;<a href="ntqprinter.html#setFullPage">setFullPage</a>( TRUE );
+<a name="x1151"></a> if ( printer-&gt;<a href="ntqprinter.html#setup">setup</a>(this) ) { // printer dialog
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Printing..." );
+ <a href="ntqpainter.html">TQPainter</a> p;
+ if( !p.<a href="ntqpainter.html#begin">begin</a>( printer ) ) { // paint on printer
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Printing aborted", 2000 );
return;
}
-<a name="x1145"></a> <a href="qpaintdevicemetrics.html">TQPaintDeviceMetrics</a> metrics( p.<a href="qpainter.html#device">device</a>() );
-<a name="x1142"></a> int dpiy = metrics.<a href="qpaintdevicemetrics.html#logicalDpiY">logicalDpiY</a>();
+<a name="x1145"></a> <a href="ntqpaintdevicemetrics.html">TQPaintDeviceMetrics</a> metrics( p.<a href="ntqpainter.html#device">device</a>() );
+<a name="x1142"></a> int dpiy = metrics.<a href="ntqpaintdevicemetrics.html#logicalDpiY">logicalDpiY</a>();
int margin = (int) ( (2/2.54)*dpiy ); // 2 cm margins
-<a name="x1143"></a><a name="x1141"></a> <a href="qrect.html">TQRect</a> view( margin, margin, metrics.<a href="qpaintdevicemetrics.html#width">width</a>() - 2*margin, metrics.<a href="qpaintdevicemetrics.html#height">height</a>() - 2*margin );
-<a name="x1163"></a> <a href="qsimplerichtext.html">TQSimpleRichText</a> richText( TQStyleSheet::<a href="qstylesheet.html#convertFromPlainText">convertFromPlainText</a>(e-&gt;<a href="qtextedit.html#text">text</a>()),
+<a name="x1143"></a><a name="x1141"></a> <a href="ntqrect.html">TQRect</a> view( margin, margin, metrics.<a href="ntqpaintdevicemetrics.html#width">width</a>() - 2*margin, metrics.<a href="ntqpaintdevicemetrics.html#height">height</a>() - 2*margin );
+<a name="x1163"></a> <a href="ntqsimplerichtext.html">TQSimpleRichText</a> richText( TQStyleSheet::<a href="ntqstylesheet.html#convertFromPlainText">convertFromPlainText</a>(e-&gt;<a href="ntqtextedit.html#text">text</a>()),
TQFont(),
-<a name="x1164"></a> e-&gt;<a href="qtextedit.html#context">context</a>(),
-<a name="x1169"></a> e-&gt;<a href="qtextedit.html#styleSheet">styleSheet</a>(),
-<a name="x1166"></a> e-&gt;<a href="qtextedit.html#mimeSourceFactory">mimeSourceFactory</a>(),
- view.<a href="qrect.html#height">height</a>() );
-<a name="x1160"></a> richText.<a href="qsimplerichtext.html#setWidth">setWidth</a>( &amp;p, view.<a href="qrect.html#width">width</a>() );
+<a name="x1164"></a> e-&gt;<a href="ntqtextedit.html#context">context</a>(),
+<a name="x1169"></a> e-&gt;<a href="ntqtextedit.html#styleSheet">styleSheet</a>(),
+<a name="x1166"></a> e-&gt;<a href="ntqtextedit.html#mimeSourceFactory">mimeSourceFactory</a>(),
+ view.<a href="ntqrect.html#height">height</a>() );
+<a name="x1160"></a> richText.<a href="ntqsimplerichtext.html#setWidth">setWidth</a>( &amp;p, view.<a href="ntqrect.html#width">width</a>() );
int page = 1;
do {
-<a name="x1158"></a> richText.<a href="qsimplerichtext.html#draw">draw</a>( &amp;p, margin, margin, view, colorGroup() );
-<a name="x1154"></a> view.<a href="qrect.html#moveBy">moveBy</a>( 0, view.<a href="qrect.html#height">height</a>() );
-<a name="x1148"></a> p.<a href="qpainter.html#translate">translate</a>( 0 , -view.<a href="qrect.html#height">height</a>() );
-<a name="x1155"></a><a name="x1147"></a> p.<a href="qpainter.html#drawText">drawText</a>( view.<a href="qrect.html#right">right</a>() - p.<a href="qpainter.html#fontMetrics">fontMetrics</a>().width( TQString::<a href="qstring.html#number">number</a>( page ) ),
-<a name="x1152"></a> view.<a href="qrect.html#bottom">bottom</a>() + p.<a href="qpainter.html#fontMetrics">fontMetrics</a>().ascent() + 5, TQString::number( page ) );
-<a name="x1159"></a> if ( view.<a href="qrect.html#top">top</a>() - margin &gt;= richText.<a href="qsimplerichtext.html#height">height</a>() )
+<a name="x1158"></a> richText.<a href="ntqsimplerichtext.html#draw">draw</a>( &amp;p, margin, margin, view, colorGroup() );
+<a name="x1154"></a> view.<a href="ntqrect.html#moveBy">moveBy</a>( 0, view.<a href="ntqrect.html#height">height</a>() );
+<a name="x1148"></a> p.<a href="ntqpainter.html#translate">translate</a>( 0 , -view.<a href="ntqrect.html#height">height</a>() );
+<a name="x1155"></a><a name="x1147"></a> p.<a href="ntqpainter.html#drawText">drawText</a>( view.<a href="ntqrect.html#right">right</a>() - p.<a href="ntqpainter.html#fontMetrics">fontMetrics</a>().width( TQString::<a href="ntqstring.html#number">number</a>( page ) ),
+<a name="x1152"></a> view.<a href="ntqrect.html#bottom">bottom</a>() + p.<a href="ntqpainter.html#fontMetrics">fontMetrics</a>().ascent() + 5, TQString::number( page ) );
+<a name="x1159"></a> if ( view.<a href="ntqrect.html#top">top</a>() - margin &gt;= richText.<a href="ntqsimplerichtext.html#height">height</a>() )
break;
-<a name="x1149"></a> printer-&gt;<a href="qprinter.html#newPage">newPage</a>();
+<a name="x1149"></a> printer-&gt;<a href="ntqprinter.html#newPage">newPage</a>();
page++;
} while (TRUE);
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Printing completed", 2000 );
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Printing completed", 2000 );
} else {
- <a href="qmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Printing aborted", 2000 );
+ <a href="ntqmainwindow.html#statusBar">statusBar</a>()-&gt;message( "Printing aborted", 2000 );
}
}
-<a name="x1173"></a>void ApplicationWindow::<a href="qwidget.html#closeEvent">closeEvent</a>( <a href="qcloseevent.html">TQCloseEvent</a>* ce )
+<a name="x1173"></a>void ApplicationWindow::<a href="ntqwidget.html#closeEvent">closeEvent</a>( <a href="qcloseevent.html">TQCloseEvent</a>* ce )
{
-<a name="x1165"></a> if ( !e-&gt;<a href="qtextedit.html#isModified">isModified</a>() ) {
+<a name="x1165"></a> if ( !e-&gt;<a href="ntqtextedit.html#isModified">isModified</a>() ) {
<a name="x1128"></a> ce-&gt;<a href="qcloseevent.html#accept">accept</a>();
return;
}
-<a name="x1139"></a> switch( TQMessageBox::<a href="qmessagebox.html#information">information</a>( this, "TQt Application Example",
+<a name="x1139"></a> switch( TQMessageBox::<a href="ntqmessagebox.html#information">information</a>( this, "TQt Application Example",
"The document has been changed since "
"the last save.",
"Save Now", "Cancel", "Leave Anyway",
@@ -389,7 +389,7 @@ void <a name="f381"></a>ApplicationWindow::print()
void <a name="f382"></a>ApplicationWindow::about()
{
-<a name="x1137"></a> TQMessageBox::<a href="qmessagebox.html#about">about</a>( this, "TQt Application Example",
+<a name="x1137"></a> TQMessageBox::<a href="ntqmessagebox.html#about">about</a>( this, "TQt Application Example",
"This example demonstrates simple use of "
"TQMainWindow,\nTQMenuBar and TQToolBar.");
}
@@ -397,7 +397,7 @@ void <a name="f382"></a>ApplicationWindow::about()
void <a name="f383"></a>ApplicationWindow::aboutTQt()
{
-<a name="x1138"></a> TQMessageBox::<a href="qmessagebox.html#aboutTQt">aboutTQt</a>( this, "TQt Application Example" );
+<a name="x1138"></a> TQMessageBox::<a href="ntqmessagebox.html#aboutTQt">aboutTQt</a>( this, "TQt Application Example" );
}
</pre>
@@ -413,16 +413,16 @@ void <a name="f383"></a>ApplicationWindow::aboutTQt()
**
*****************************************************************************/
-#include &lt;<a href="qapplication-h.html">qapplication.h</a>&gt;
+#include &lt;<a href="qapplication-h.html">ntqapplication.h</a>&gt;
#include "application.h"
int main( int argc, char ** argv ) {
- <a href="qapplication.html">TQApplication</a> a( argc, argv );
+ <a href="ntqapplication.html">TQApplication</a> a( argc, argv );
ApplicationWindow * mw = new ApplicationWindow();
- mw-&gt;<a href="qwidget.html#setCaption">setCaption</a>( "Document 1" );
-<a name="x1178"></a> mw-&gt;<a href="qwidget.html#show">show</a>();
-<a name="x1179"></a> a.<a href="qobject.html#connect">connect</a>( &amp;a, SIGNAL(<a href="qapplication.html#lastWindowClosed">lastWindowClosed</a>()), &amp;a, SLOT(<a href="qapplication.html#quit">quit</a>()) );
- return a.<a href="qapplication.html#exec">exec</a>();
+ mw-&gt;<a href="ntqwidget.html#setCaption">setCaption</a>( "Document 1" );
+<a name="x1178"></a> mw-&gt;<a href="ntqwidget.html#show">show</a>();
+<a name="x1179"></a> a.<a href="ntqobject.html#connect">connect</a>( &amp;a, SIGNAL(<a href="ntqapplication.html#lastWindowClosed">lastWindowClosed</a>()), &amp;a, SLOT(<a href="ntqapplication.html#quit">quit</a>()) );
+ return a.<a href="ntqapplication.html#exec">exec</a>();
}
</pre>