summaryrefslogtreecommitdiffstats
path: root/doc/html/qwerty-example.html
diff options
context:
space:
mode:
Diffstat (limited to 'doc/html/qwerty-example.html')
-rw-r--r--doc/html/qwerty-example.html322
1 files changed, 161 insertions, 161 deletions
diff --git a/doc/html/qwerty-example.html b/doc/html/qwerty-example.html
index 8bd0b6e8f..1bc1688e3 100644
--- a/doc/html/qwerty-example.html
+++ b/doc/html/qwerty-example.html
@@ -48,19 +48,19 @@ body { background: #ffffff; color: black; }
#ifndef TQWERTY_H
#define TQWERTY_H
-#include &lt;<a href="qwidget-h.html">qwidget.h</a>&gt;
-#include &lt;<a href="qmenubar-h.html">qmenubar.h</a>&gt;
-#include &lt;<a href="qmultilineedit-h.html">qmultilineedit.h</a>&gt;
-#include &lt;<a href="qprinter-h.html">qprinter.h</a>&gt;
+#include &lt;<a href="qwidget-h.html">ntqwidget.h</a>&gt;
+#include &lt;<a href="qmenubar-h.html">ntqmenubar.h</a>&gt;
+#include &lt;<a href="qmultilineedit-h.html">ntqmultilineedit.h</a>&gt;
+#include &lt;<a href="qprinter-h.html">ntqprinter.h</a>&gt;
-class Editor : public <a href="qwidget.html">TQWidget</a>
+class Editor : public <a href="ntqwidget.html">TQWidget</a>
{
<a href="metaobjects.html#Q_OBJECT">Q_OBJECT</a>
public:
- Editor( <a href="qwidget.html">TQWidget</a> *parent=0, const char *name="qwerty" );
+ Editor( <a href="ntqwidget.html">TQWidget</a> *parent=0, const char *name="qwerty" );
~Editor();
- void load( const <a href="qstring.html">TQString</a>&amp; fileName, int code=-1 );
+ void load( const <a href="ntqstring.html">TQString</a>&amp; fileName, int code=-1 );
public slots:
void newDoc();
@@ -81,15 +81,15 @@ private slots:
void textChanged();
private:
- bool saveAs( const <a href="qstring.html">TQString</a>&amp; fileName, int code=-1 );
+ bool saveAs( const <a href="ntqstring.html">TQString</a>&amp; fileName, int code=-1 );
void rebuildCodecList();
- <a href="qmenubar.html">TQMenuBar</a> *m;
- <a href="qmultilineedit.html">TQMultiLineEdit</a> *e;
+ <a href="ntqmenubar.html">TQMenuBar</a> *m;
+ <a href="ntqmultilineedit.html">TQMultiLineEdit</a> *e;
#ifndef QT_NO_PRINTER
- <a href="qprinter.html">TQPrinter</a> printer;
+ <a href="ntqprinter.html">TQPrinter</a> printer;
#endif
- <a href="qpopupmenu.html">TQPopupMenu</a> *save_as;
- <a href="qpopupmenu.html">TQPopupMenu</a> *open_as;
+ <a href="ntqpopupmenu.html">TQPopupMenu</a> *save_as;
+ <a href="ntqpopupmenu.html">TQPopupMenu</a> *open_as;
bool changed;
};
@@ -109,18 +109,18 @@ private:
*****************************************************************************/
#include "qwerty.h"
-#include &lt;<a href="qapplication-h.html">qapplication.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="qpopupmenu-h.html">qpopupmenu.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="qmessagebox-h.html">qmessagebox.h</a>&gt;
-#include &lt;<a href="qpaintdevicemetrics-h.html">qpaintdevicemetrics.h</a>&gt;
-#include &lt;<a href="qptrlist-h.html">qptrlist.h</a>&gt;
-#include &lt;<a href="qfontdialog-h.html">qfontdialog.h</a>&gt;
-
-#include &lt;<a href="qtextcodec-h.html">qtextcodec.h</a>&gt;
+#include &lt;<a href="qapplication-h.html">ntqapplication.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="qpopupmenu-h.html">ntqpopupmenu.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="qmessagebox-h.html">ntqmessagebox.h</a>&gt;
+#include &lt;<a href="qpaintdevicemetrics-h.html">ntqpaintdevicemetrics.h</a>&gt;
+#include &lt;<a href="qptrlist-h.html">ntqptrlist.h</a>&gt;
+#include &lt;<a href="qfontdialog-h.html">ntqfontdialog.h</a>&gt;
+
+#include &lt;<a href="qtextcodec-h.html">ntqtextcodec.h</a>&gt;
const bool no_writing = FALSE;
@@ -129,49 +129,49 @@ static TQPtrList&lt;TQTextCodec&gt; *codecList = 0;
enum { Uni = 0, MBug = 1, Lat1 = 2, Local = 3, Guess = 4, Codec = 5 };
-<a name="f235"></a>Editor::Editor( <a href="qwidget.html">TQWidget</a> * parent , const char * name )
- : <a href="qwidget.html">TQWidget</a>( parent, name, WDestructiveClose )
+<a name="f235"></a>Editor::Editor( <a href="ntqwidget.html">TQWidget</a> * parent , const char * name )
+ : <a href="ntqwidget.html">TQWidget</a>( parent, name, WDestructiveClose )
{
- m = new <a href="qmenubar.html">TQMenuBar</a>( this, "menu" );
-
- <a href="qpopupmenu.html">TQPopupMenu</a> * file = new <a href="qpopupmenu.html">TQPopupMenu</a>();
- <a href="qapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( file );
-<a name="x371"></a> m-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;File", file );
-
- file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;New", this, SLOT(newDoc()), ALT+Key_N );
- file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;Open...", this, SLOT(load()), ALT+Key_O );
- file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;Save...", this, SLOT(save()), ALT+Key_S );
-<a name="x372"></a> file-&gt;<a href="qmenudata.html#insertSeparator">insertSeparator</a>();
- open_as = new <a href="qpopupmenu.html">TQPopupMenu</a>();
- file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "Open &amp;As", open_as );
- save_as = new <a href="qpopupmenu.html">TQPopupMenu</a>();
- file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "Sa&amp;ve As", save_as );
- file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "Add &amp;Encoding", this, SLOT(addEncoding()) );
+ m = new <a href="ntqmenubar.html">TQMenuBar</a>( this, "menu" );
+
+ <a href="ntqpopupmenu.html">TQPopupMenu</a> * file = new <a href="ntqpopupmenu.html">TQPopupMenu</a>();
+ <a href="ntqapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( file );
+<a name="x371"></a> m-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;File", file );
+
+ file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;New", this, SLOT(newDoc()), ALT+Key_N );
+ file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;Open...", this, SLOT(load()), ALT+Key_O );
+ file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;Save...", this, SLOT(save()), ALT+Key_S );
+<a name="x372"></a> file-&gt;<a href="ntqmenudata.html#insertSeparator">insertSeparator</a>();
+ open_as = new <a href="ntqpopupmenu.html">TQPopupMenu</a>();
+ file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "Open &amp;As", open_as );
+ save_as = new <a href="ntqpopupmenu.html">TQPopupMenu</a>();
+ file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "Sa&amp;ve As", save_as );
+ file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "Add &amp;Encoding", this, SLOT(addEncoding()) );
#ifndef QT_NO_PRINTER
- file-&gt;<a href="qmenudata.html#insertSeparator">insertSeparator</a>();
- file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;Print...", this, SLOT(print()), ALT+Key_P );
+ file-&gt;<a href="ntqmenudata.html#insertSeparator">insertSeparator</a>();
+ file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;Print...", this, SLOT(print()), ALT+Key_P );
#endif
- file-&gt;<a href="qmenudata.html#insertSeparator">insertSeparator</a>();
- file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;Close", this, SLOT(<a href="qwidget.html#close">close</a>()),ALT+Key_W );
-<a name="x358"></a> file-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;Quit", qApp, SLOT(<a href="qapplication.html#closeAllWindows">closeAllWindows</a>()), ALT+Key_Q );
+ file-&gt;<a href="ntqmenudata.html#insertSeparator">insertSeparator</a>();
+ file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;Close", this, SLOT(<a href="ntqwidget.html#close">close</a>()),ALT+Key_W );
+<a name="x358"></a> file-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;Quit", qApp, SLOT(<a href="ntqapplication.html#closeAllWindows">closeAllWindows</a>()), ALT+Key_Q );
-<a name="x386"></a> <a href="qobject.html#connect">connect</a>( save_as, SIGNAL(<a href="qpopupmenu.html#activated">activated</a>(int)), this, SLOT(saveAsEncoding(int)) );
- <a href="qobject.html#connect">connect</a>( open_as, SIGNAL(<a href="qpopupmenu.html#activated">activated</a>(int)), this, SLOT(openAsEncoding(int)) );
+<a name="x386"></a> <a href="ntqobject.html#connect">connect</a>( save_as, SIGNAL(<a href="ntqpopupmenu.html#activated">activated</a>(int)), this, SLOT(saveAsEncoding(int)) );
+ <a href="ntqobject.html#connect">connect</a>( open_as, SIGNAL(<a href="ntqpopupmenu.html#activated">activated</a>(int)), this, SLOT(openAsEncoding(int)) );
rebuildCodecList();
- <a href="qpopupmenu.html">TQPopupMenu</a> * edit = new <a href="qpopupmenu.html">TQPopupMenu</a>();
- <a href="qapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( edit );
- m-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;Edit", edit );
+ <a href="ntqpopupmenu.html">TQPopupMenu</a> * edit = new <a href="ntqpopupmenu.html">TQPopupMenu</a>();
+ <a href="ntqapplication.html#Q_CHECK_PTR">Q_CHECK_PTR</a>( edit );
+ m-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;Edit", edit );
- edit-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "To &amp;Uppercase", this, SLOT(toUpper()), ALT+Key_U );
- edit-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "To &amp;Lowercase", this, SLOT(toLower()), ALT+Key_L );
+ edit-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "To &amp;Uppercase", this, SLOT(toUpper()), ALT+Key_U );
+ edit-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "To &amp;Lowercase", this, SLOT(toLower()), ALT+Key_L );
#ifndef QT_NO_FONTDIALOG
- edit-&gt;<a href="qmenudata.html#insertSeparator">insertSeparator</a>();
- edit-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "&amp;Select Font" , this, SLOT(<a href="qwidget.html#font">font</a>()), ALT+Key_T );
+ edit-&gt;<a href="ntqmenudata.html#insertSeparator">insertSeparator</a>();
+ edit-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "&amp;Select Font" , this, SLOT(<a href="ntqwidget.html#font">font</a>()), ALT+Key_T );
#endif
changed = FALSE;
- e = new <a href="qmultilineedit.html">TQMultiLineEdit</a>( this, "editor" );
-<a name="x400"></a> <a href="qobject.html#connect">connect</a>( e, SIGNAL( <a href="qtextedit.html#textChanged">textChanged</a>() ), this, SLOT( textChanged() ) );
+ e = new <a href="ntqmultilineedit.html">TQMultiLineEdit</a>( this, "editor" );
+<a name="x400"></a> <a href="ntqobject.html#connect">connect</a>( e, SIGNAL( <a href="ntqtextedit.html#textChanged">textChanged</a>() ), this, SLOT( textChanged() ) );
// We use Unifont - if you have it installed you'll see all
// Unicode character glyphs.
@@ -179,23 +179,23 @@ enum { Uni = 0, MBug = 1, Lat1 = 2, Local = 3, Guess = 4, Codec = 5 };
// Unifont only comes in one pixel size, so we cannot let
// it change pixel size as the display DPI changes.
//
-<a name="x367"></a> <a href="qfont.html">TQFont</a> unifont("unifont",16,50); unifont.<a href="qfont.html#setPixelSize">setPixelSize</a>(16);
-<a name="x397"></a> e-&gt;<a href="qwidget.html#setFont">setFont</a>( unifont );
+<a name="x367"></a> <a href="ntqfont.html">TQFont</a> unifont("unifont",16,50); unifont.<a href="ntqfont.html#setPixelSize">setPixelSize</a>(16);
+<a name="x397"></a> e-&gt;<a href="ntqwidget.html#setFont">setFont</a>( unifont );
- e-&gt;<a href="qwidget.html#setFocus">setFocus</a>();
+ e-&gt;<a href="ntqwidget.html#setFocus">setFocus</a>();
}
Editor::~Editor()
{
}
-<a name="x405"></a>void Editor::<a href="qwidget.html#font">font</a>()
+<a name="x405"></a>void Editor::<a href="ntqwidget.html#font">font</a>()
{
#ifndef QT_NO_FONTDIALOG
bool ok;
-<a name="x396"></a><a name="x368"></a> <a href="qfont.html">TQFont</a> f = TQFontDialog::<a href="qfontdialog.html#getFont">getFont</a>( &amp;ok, e-&gt;<a href="qtextedit.html#font">font</a>() );
+<a name="x396"></a><a name="x368"></a> <a href="ntqfont.html">TQFont</a> f = TQFontDialog::<a href="ntqfontdialog.html#getFont">getFont</a>( &amp;ok, e-&gt;<a href="ntqtextedit.html#font">font</a>() );
if ( ok ) {
- e-&gt;<a href="qwidget.html#setFont">setFont</a>( f );
+ e-&gt;<a href="ntqwidget.html#setFont">setFont</a>( f );
}
#endif
}
@@ -205,38 +205,38 @@ Editor::~Editor()
void <a name="f236"></a>Editor::rebuildCodecList()
{
delete codecList;
- codecList = new <a href="qptrlist.html">TQPtrList</a>&lt;TQTextCodec&gt;;
- <a href="qtextcodec.html">TQTextCodec</a> *codec;
+ codecList = new <a href="ntqptrlist.html">TQPtrList</a>&lt;TQTextCodec&gt;;
+ <a href="ntqtextcodec.html">TQTextCodec</a> *codec;
int i;
-<a name="x392"></a> for (i = 0; (codec = TQTextCodec::<a href="qtextcodec.html#codecForIndex">codecForIndex</a>(i)); i++)
-<a name="x387"></a> codecList-&gt;<a href="qptrlist.html#append">append</a>( codec );
-<a name="x389"></a> int n = codecList-&gt;<a href="qptrlist.html#count">count</a>();
+<a name="x392"></a> for (i = 0; (codec = TQTextCodec::<a href="ntqtextcodec.html#codecForIndex">codecForIndex</a>(i)); i++)
+<a name="x387"></a> codecList-&gt;<a href="ntqptrlist.html#append">append</a>( codec );
+<a name="x389"></a> int n = codecList-&gt;<a href="ntqptrlist.html#count">count</a>();
for (int pm=0; pm&lt;2; pm++) {
- <a href="qpopupmenu.html">TQPopupMenu</a>* menu = pm ? open_as : save_as;
-<a name="x370"></a> menu-&gt;<a href="qmenudata.html#clear">clear</a>();
- <a href="qstring.html">TQString</a> local = "Local (";
-<a name="x393"></a> local += TQTextCodec::<a href="qtextcodec.html#codecForLocale">codecForLocale</a>()-&gt;name();
+ <a href="ntqpopupmenu.html">TQPopupMenu</a>* menu = pm ? open_as : save_as;
+<a name="x370"></a> menu-&gt;<a href="ntqmenudata.html#clear">clear</a>();
+ <a href="ntqstring.html">TQString</a> local = "Local (";
+<a name="x393"></a> local += TQTextCodec::<a href="ntqtextcodec.html#codecForLocale">codecForLocale</a>()-&gt;name();
local += ")";
- menu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( local, Local );
- menu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "Unicode", Uni );
- menu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "Latin1", Lat1 );
- menu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "Microsoft Unicode", MBug );
+ menu-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( local, Local );
+ menu-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "Unicode", Uni );
+ menu-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "Latin1", Lat1 );
+ menu-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "Microsoft Unicode", MBug );
if ( pm )
- menu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( "[guess]", Guess );
+ menu-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( "[guess]", Guess );
for ( i = 0; i &lt; n; i++ )
-<a name="x388"></a> menu-&gt;<a href="qmenudata.html#insertItem">insertItem</a>( codecList-&gt;<a href="qptrlist.html#at">at</a>(i)-&gt;name(), Codec + i );
+<a name="x388"></a> menu-&gt;<a href="ntqmenudata.html#insertItem">insertItem</a>( codecList-&gt;<a href="ntqptrlist.html#at">at</a>(i)-&gt;name(), Codec + i );
}
}
void <a name="f237"></a>Editor::newDoc()
{
Editor *ed = new Editor;
- if ( qApp-&gt;<a href="qapplication.html#desktop">desktop</a>()-&gt;size().width() &lt; 450
- || qApp-&gt;<a href="qapplication.html#desktop">desktop</a>()-&gt;size().height() &lt; 450 ) {
-<a name="x413"></a> ed-&gt;<a href="qwidget.html#showMaximized">showMaximized</a>();
+ if ( qApp-&gt;<a href="ntqapplication.html#desktop">desktop</a>()-&gt;size().width() &lt; 450
+ || qApp-&gt;<a href="ntqapplication.html#desktop">desktop</a>()-&gt;size().height() &lt; 450 ) {
+<a name="x413"></a> ed-&gt;<a href="ntqwidget.html#showMaximized">showMaximized</a>();
} else {
- ed-&gt;<a href="qwidget.html#resize">resize</a>( 400, 400 );
- ed-&gt;<a href="qwidget.html#show">show</a>();
+ ed-&gt;<a href="ntqwidget.html#resize">resize</a>( 400, 400 );
+ ed-&gt;<a href="ntqwidget.html#show">show</a>();
}
}
@@ -244,47 +244,47 @@ void <a name="f237"></a>Editor::newDoc()
void <a name="f238"></a>Editor::load()
{
#ifndef QT_NO_FILEDIALOG
-<a name="x365"></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, this );
-<a name="x390"></a> if ( !fn.<a href="qstring.html#isEmpty">isEmpty</a>() )
+<a name="x365"></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 );
+<a name="x390"></a> if ( !fn.<a href="ntqstring.html#isEmpty">isEmpty</a>() )
load( fn, -1 );
#endif
}
-void Editor::load( const <a href="qstring.html">TQString</a>&amp; fileName, int code )
+void Editor::load( const <a href="ntqstring.html">TQString</a>&amp; fileName, int code )
{
- <a href="qfile.html">TQFile</a> f( fileName );
-<a name="x363"></a> 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 );
+<a name="x363"></a> if ( !f.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_ReadOnly</a> ) )
return;
-<a name="x376"></a> e-&gt;<a href="qmultilineedit.html#setAutoUpdate">setAutoUpdate</a>( FALSE );
+<a name="x376"></a> e-&gt;<a href="ntqmultilineedit.html#setAutoUpdate">setAutoUpdate</a>( FALSE );
- <a href="qtextstream.html">TQTextStream</a> t(&amp;f);
+ <a href="ntqtextstream.html">TQTextStream</a> t(&amp;f);
if ( code &gt;= Codec )
-<a name="x402"></a> t.<a href="qtextstream.html#setCodec">setCodec</a>( codecList-&gt;<a href="qptrlist.html#at">at</a>(code-Codec) );
+<a name="x402"></a> t.<a href="ntqtextstream.html#setCodec">setCodec</a>( codecList-&gt;<a href="ntqptrlist.html#at">at</a>(code-Codec) );
else if ( code == Uni )
-<a name="x403"></a> t.<a href="qtextstream.html#setEncoding">setEncoding</a>( TQTextStream::Unicode );
+<a name="x403"></a> t.<a href="ntqtextstream.html#setEncoding">setEncoding</a>( TQTextStream::Unicode );
else if ( code == MBug )
- t.<a href="qtextstream.html#setEncoding">setEncoding</a>( TQTextStream::UnicodeReverse );
+ t.<a href="ntqtextstream.html#setEncoding">setEncoding</a>( TQTextStream::UnicodeReverse );
else if ( code == Lat1 )
- t.<a href="qtextstream.html#setEncoding">setEncoding</a>( TQTextStream::Latin1 );
+ t.<a href="ntqtextstream.html#setEncoding">setEncoding</a>( TQTextStream::Latin1 );
else if ( code == Guess ) {
- <a href="qfile.html">TQFile</a> f(fileName);
- f.<a href="qfile.html#open">open</a>(IO_ReadOnly);
+ <a href="ntqfile.html">TQFile</a> f(fileName);
+ f.<a href="ntqfile.html#open">open</a>(IO_ReadOnly);
char buffer[256];
int l = 256;
-<a name="x364"></a> l=f.<a href="qiodevice.html#readBlock">readBlock</a>(buffer,l);
-<a name="x391"></a> <a href="qtextcodec.html">TQTextCodec</a>* codec = TQTextCodec::<a href="qtextcodec.html#codecForContent">codecForContent</a>(buffer, l);
+<a name="x364"></a> l=f.<a href="ntqiodevice.html#readBlock">readBlock</a>(buffer,l);
+<a name="x391"></a> <a href="ntqtextcodec.html">TQTextCodec</a>* codec = TQTextCodec::<a href="ntqtextcodec.html#codecForContent">codecForContent</a>(buffer, l);
if ( codec ) {
-<a name="x395"></a><a name="x373"></a> TQMessageBox::<a href="qmessagebox.html#information">information</a>(this,"Encoding",TQString("Codec: ")+codec-&gt;<a href="qtextcodec.html#name">name</a>());
- t.<a href="qtextstream.html#setCodec">setCodec</a>( codec );
+<a name="x395"></a><a name="x373"></a> TQMessageBox::<a href="ntqmessagebox.html#information">information</a>(this,"Encoding",TQString("Codec: ")+codec-&gt;<a href="ntqtextcodec.html#name">name</a>());
+ t.<a href="ntqtextstream.html#setCodec">setCodec</a>( codec );
}
}
-<a name="x401"></a><a name="x398"></a> e-&gt;<a href="qtextedit.html#setText">setText</a>( t.<a href="qtextstream.html#read">read</a>() );
-<a name="x362"></a> f.<a href="qfile.html#close">close</a>();
+<a name="x401"></a><a name="x398"></a> e-&gt;<a href="ntqtextedit.html#setText">setText</a>( t.<a href="ntqtextstream.html#read">read</a>() );
+<a name="x362"></a> f.<a href="ntqfile.html#close">close</a>();
- e-&gt;<a href="qmultilineedit.html#setAutoUpdate">setAutoUpdate</a>( TRUE );
-<a name="x407"></a> e-&gt;<a href="qwidget.html#repaint">repaint</a>();
- <a href="qwidget.html#setCaption">setCaption</a>( fileName );
+ e-&gt;<a href="ntqmultilineedit.html#setAutoUpdate">setAutoUpdate</a>( TRUE );
+<a name="x407"></a> e-&gt;<a href="ntqwidget.html#repaint">repaint</a>();
+ <a href="ntqwidget.html#setCaption">setCaption</a>( fileName );
changed = FALSE;
}
@@ -293,8 +293,8 @@ void <a name="f239"></a>Editor::openAsEncoding( int code )
{
#ifndef QT_NO_FILEDIALOG
//storing filename (proper save) is left as an exercise...
- <a href="qstring.html">TQString</a> fn = TQFileDialog::<a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>( TQString::null, TQString::null, this );
- if ( !fn.<a href="qstring.html#isEmpty">isEmpty</a>() )
+ <a href="ntqstring.html">TQString</a> fn = TQFileDialog::<a href="ntqfiledialog.html#getOpenFileName">getOpenFileName</a>( TQString::null, TQString::null, this );
+ if ( !fn.<a href="ntqstring.html#isEmpty">isEmpty</a>() )
(void) load( fn, code );
#endif
}
@@ -303,8 +303,8 @@ bool <a name="f240"></a>Editor::save()
{
#ifndef QT_NO_FILEDIALOG
//storing filename (proper save) is left as an exercise...
-<a name="x366"></a> <a href="qstring.html">TQString</a> fn = TQFileDialog::<a href="qfiledialog.html#getSaveFileName">getSaveFileName</a>( TQString::null, TQString::null, this );
- if ( !fn.<a href="qstring.html#isEmpty">isEmpty</a>() )
+<a name="x366"></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="ntqstring.html#isEmpty">isEmpty</a>() )
return saveAs( fn );
return FALSE;
#endif
@@ -314,8 +314,8 @@ void <a name="f241"></a>Editor::saveAsEncoding( int code )
{
#ifndef QT_NO_FILEDIALOG
//storing filename (proper save) is left as an exercise...
- <a href="qstring.html">TQString</a> fn = TQFileDialog::<a href="qfiledialog.html#getSaveFileName">getSaveFileName</a>( TQString::null, TQString::null, this );
- if ( !fn.<a href="qstring.html#isEmpty">isEmpty</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="ntqstring.html#isEmpty">isEmpty</a>() )
(void) saveAs( fn, code );
#endif
}
@@ -323,14 +323,14 @@ void <a name="f241"></a>Editor::saveAsEncoding( int code )
void <a name="f242"></a>Editor::addEncoding()
{
#ifndef QT_NO_FILEDIALOG
- <a href="qstring.html">TQString</a> fn = TQFileDialog::<a href="qfiledialog.html#getOpenFileName">getOpenFileName</a>( TQString::null, "*.map", this );
- if ( !fn.<a href="qstring.html#isEmpty">isEmpty</a>() ) {
- <a href="qfile.html">TQFile</a> f(fn);
- if (f.<a href="qfile.html#open">open</a>(IO_ReadOnly)) {
-<a name="x394"></a> if (TQTextCodec::<a href="qtextcodec.html#loadCharmap">loadCharmap</a>(&amp;f)) {
+ <a href="ntqstring.html">TQString</a> fn = TQFileDialog::<a href="ntqfiledialog.html#getOpenFileName">getOpenFileName</a>( TQString::null, "*.map", this );
+ if ( !fn.<a href="ntqstring.html#isEmpty">isEmpty</a>() ) {
+ <a href="ntqfile.html">TQFile</a> f(fn);
+ if (f.<a href="ntqfile.html#open">open</a>(IO_ReadOnly)) {
+<a name="x394"></a> if (TQTextCodec::<a href="ntqtextcodec.html#loadCharmap">loadCharmap</a>(&amp;f)) {
rebuildCodecList();
} else {
-<a name="x374"></a> TQMessageBox::<a href="qmessagebox.html#warning">warning</a>(0,"Charmap error",
+<a name="x374"></a> TQMessageBox::<a href="ntqmessagebox.html#warning">warning</a>(0,"Charmap error",
"The file did not contain a valid charmap.\n\n"
"A charmap file should look like this:\n"
" &lt;code_set_name&gt; thename\n"
@@ -349,27 +349,27 @@ void <a name="f242"></a>Editor::addEncoding()
}
-bool <a name="f243"></a>Editor::saveAs( const <a href="qstring.html">TQString</a>&amp; fileName, int code )
+bool <a name="f243"></a>Editor::saveAs( const <a href="ntqstring.html">TQString</a>&amp; fileName, int code )
{
- <a href="qfile.html">TQFile</a> f( fileName );
- if ( no_writing || !f.<a href="qfile.html#open">open</a>( <a href="qfile.html#open">IO_WriteOnly</a> ) ) {
- TQMessageBox::<a href="qmessagebox.html#warning">warning</a>(this,"I/O Error",
+ <a href="ntqfile.html">TQFile</a> f( fileName );
+ if ( no_writing || !f.<a href="ntqfile.html#open">open</a>( <a href="ntqfile.html#open">IO_WriteOnly</a> ) ) {
+ TQMessageBox::<a href="ntqmessagebox.html#warning">warning</a>(this,"I/O Error",
TQString("The file could not be opened.\n\n")
+fileName);
return FALSE;
}
- <a href="qtextstream.html">TQTextStream</a> t(&amp;f);
+ <a href="ntqtextstream.html">TQTextStream</a> t(&amp;f);
if ( code &gt;= Codec )
- t.<a href="qtextstream.html#setCodec">setCodec</a>( codecList-&gt;<a href="qptrlist.html#at">at</a>(code-Codec) );
+ t.<a href="ntqtextstream.html#setCodec">setCodec</a>( codecList-&gt;<a href="ntqptrlist.html#at">at</a>(code-Codec) );
else if ( code == Uni )
- t.<a href="qtextstream.html#setEncoding">setEncoding</a>( TQTextStream::Unicode );
+ t.<a href="ntqtextstream.html#setEncoding">setEncoding</a>( TQTextStream::Unicode );
else if ( code == MBug )
- t.<a href="qtextstream.html#setEncoding">setEncoding</a>( TQTextStream::UnicodeReverse );
+ t.<a href="ntqtextstream.html#setEncoding">setEncoding</a>( TQTextStream::UnicodeReverse );
else if ( code == Lat1 )
- t.<a href="qtextstream.html#setEncoding">setEncoding</a>( TQTextStream::Latin1 );
-<a name="x399"></a> t &lt;&lt; e-&gt;<a href="qtextedit.html#text">text</a>();
- f.<a href="qfile.html#close">close</a>();
- <a href="qwidget.html#setCaption">setCaption</a>( fileName );
+ t.<a href="ntqtextstream.html#setEncoding">setEncoding</a>( TQTextStream::Latin1 );
+<a name="x399"></a> t &lt;&lt; e-&gt;<a href="ntqtextedit.html#text">text</a>();
+ f.<a href="ntqfile.html#close">close</a>();
+ <a href="ntqwidget.html#setCaption">setCaption</a>( fileName );
changed = FALSE;
return TRUE;
}
@@ -379,49 +379,49 @@ void <a name="f244"></a>Editor::print()
#ifndef QT_NO_PRINTER
if ( printer.setup(this) ) { // opens printer dialog
printer.setFullPage(TRUE); // we'll set our own margins
- <a href="qpainter.html">TQPainter</a> p;
- p.<a href="qpainter.html#begin">begin</a>( &amp;printer ); // paint on printer
-<a name="x385"></a> p.<a href="qpainter.html#setFont">setFont</a>( e-&gt;<a href="qtextedit.html#font">font</a>() );
-<a name="x384"></a> <a href="qfontmetrics.html">TQFontMetrics</a> fm = p.<a href="qpainter.html#fontMetrics">fontMetrics</a>();
- <a href="qpaintdevicemetrics.html">TQPaintDeviceMetrics</a> metrics( &amp;printer ); // need width/height
+ <a href="ntqpainter.html">TQPainter</a> p;
+ p.<a href="ntqpainter.html#begin">begin</a>( &amp;printer ); // paint on printer
+<a name="x385"></a> p.<a href="ntqpainter.html#setFont">setFont</a>( e-&gt;<a href="ntqtextedit.html#font">font</a>() );
+<a name="x384"></a> <a href="ntqfontmetrics.html">TQFontMetrics</a> fm = p.<a href="ntqpainter.html#fontMetrics">fontMetrics</a>();
+ <a href="ntqpaintdevicemetrics.html">TQPaintDeviceMetrics</a> metrics( &amp;printer ); // need width/height
// of printer surface
-<a name="x379"></a> const int MARGIN = metrics.<a href="qpaintdevicemetrics.html#logicalDpiX">logicalDpiX</a>() / 2; // half-inch margin
+<a name="x379"></a> const int MARGIN = metrics.<a href="ntqpaintdevicemetrics.html#logicalDpiX">logicalDpiX</a>() / 2; // half-inch margin
int yPos = MARGIN; // y position for each line
-<a name="x375"></a> for( int i = 0 ; i &lt; e-&gt;<a href="qmultilineedit.html#numLines">numLines</a>() ; i++ ) {
+<a name="x375"></a> for( int i = 0 ; i &lt; e-&gt;<a href="ntqmultilineedit.html#numLines">numLines</a>() ; i++ ) {
if ( printer.aborted() )
break;
-<a name="x378"></a><a name="x369"></a> if ( yPos + fm.<a href="qfontmetrics.html#lineSpacing">lineSpacing</a>() &gt; metrics.<a href="qpaintdevicemetrics.html#height">height</a>() - MARGIN ) {
+<a name="x378"></a><a name="x369"></a> if ( yPos + fm.<a href="ntqfontmetrics.html#lineSpacing">lineSpacing</a>() &gt; metrics.<a href="ntqpaintdevicemetrics.html#height">height</a>() - MARGIN ) {
// no more room on this page
if ( !printer.newPage() ) // start new page
break; // some error
yPos = MARGIN; // back to top of page
}
-<a name="x380"></a> p.<a href="qpainter.html#drawText">drawText</a>( MARGIN, yPos, metrics.<a href="qpaintdevicemetrics.html#width">width</a>() - 2*MARGIN,
-<a name="x377"></a> fm.<a href="qfontmetrics.html#lineSpacing">lineSpacing</a>(), ExpandTabs, e-&gt;<a href="qmultilineedit.html#textLine">textLine</a>( i ) );
- yPos += fm.<a href="qfontmetrics.html#lineSpacing">lineSpacing</a>();
+<a name="x380"></a> p.<a href="ntqpainter.html#drawText">drawText</a>( MARGIN, yPos, metrics.<a href="ntqpaintdevicemetrics.html#width">width</a>() - 2*MARGIN,
+<a name="x377"></a> fm.<a href="ntqfontmetrics.html#lineSpacing">lineSpacing</a>(), ExpandTabs, e-&gt;<a href="ntqmultilineedit.html#textLine">textLine</a>( i ) );
+ yPos += fm.<a href="ntqfontmetrics.html#lineSpacing">lineSpacing</a>();
}
- p.<a href="qpainter.html#end">end</a>(); // send job to printer
+ p.<a href="ntqpainter.html#end">end</a>(); // send job to printer
}
#endif
}
-void Editor::<a href="qwidget.html#resizeEvent">resizeEvent</a>( <a href="qresizeevent.html">TQResizeEvent</a> * )
+void Editor::<a href="ntqwidget.html#resizeEvent">resizeEvent</a>( <a href="qresizeevent.html">TQResizeEvent</a> * )
{
if ( e &amp;&amp; m )
- e-&gt;<a href="qwidget.html#setGeometry">setGeometry</a>( 0, m-&gt;<a href="qwidget.html#height">height</a>(), width(), height() - m-&gt;<a href="qwidget.html#height">height</a>() );
+ e-&gt;<a href="ntqwidget.html#setGeometry">setGeometry</a>( 0, m-&gt;<a href="ntqwidget.html#height">height</a>(), width(), height() - m-&gt;<a href="ntqwidget.html#height">height</a>() );
}
-<a name="x404"></a>void Editor::<a href="qwidget.html#closeEvent">closeEvent</a>( <a href="qcloseevent.html">TQCloseEvent</a> *event )
+<a name="x404"></a>void Editor::<a href="ntqwidget.html#closeEvent">closeEvent</a>( <a href="qcloseevent.html">TQCloseEvent</a> *event )
{
<a name="x360"></a> event-&gt;<a href="qcloseevent.html#accept">accept</a>();
if ( changed ) { // the text has been changed
- switch ( TQMessageBox::<a href="qmessagebox.html#warning">warning</a>( this, "Qwerty",
+ switch ( TQMessageBox::<a href="ntqmessagebox.html#warning">warning</a>( this, "Qwerty",
"Save changes to Document?",
- <a href="qobject.html#tr">tr</a>("&amp;Yes"),
- <a href="qobject.html#tr">tr</a>("&amp;No"),
- <a href="qobject.html#tr">tr</a>("Cancel"),
+ <a href="ntqobject.html#tr">tr</a>("&amp;Yes"),
+ <a href="ntqobject.html#tr">tr</a>("&amp;No"),
+ <a href="ntqobject.html#tr">tr</a>("Cancel"),
0, 2) ) {
case 0: // yes
if ( save() )
@@ -441,12 +441,12 @@ void Editor::<a href="qwidget.html#resizeEvent">resizeEvent</a>( <a href="qresiz
void <a name="f245"></a>Editor::toUpper()
{
- e-&gt;<a href="qtextedit.html#setText">setText</a>(e-&gt;<a href="qtextedit.html#text">text</a>().upper());
+ e-&gt;<a href="ntqtextedit.html#setText">setText</a>(e-&gt;<a href="ntqtextedit.html#text">text</a>().upper());
}
void <a name="f246"></a>Editor::toLower()
{
- e-&gt;<a href="qtextedit.html#setText">setText</a>(e-&gt;<a href="qtextedit.html#text">text</a>().lower());
+ e-&gt;<a href="ntqtextedit.html#setText">setText</a>(e-&gt;<a href="ntqtextedit.html#text">text</a>().lower());
}
void <a name="f247"></a>Editor::textChanged()
@@ -467,33 +467,33 @@ void <a name="f247"></a>Editor::textChanged()
**
*****************************************************************************/
-#include &lt;<a href="qapplication-h.html">qapplication.h</a>&gt;
+#include &lt;<a href="qapplication-h.html">ntqapplication.h</a>&gt;
#include "qwerty.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 );
-<a name="x414"></a> bool isSmall = qApp-&gt;<a href="qapplication.html#desktop">desktop</a>()-&gt;size().width() &lt; 450
- || qApp-&gt;<a href="qapplication.html#desktop">desktop</a>()-&gt;size().height() &lt; 450;
+<a name="x414"></a> bool isSmall = qApp-&gt;<a href="ntqapplication.html#desktop">desktop</a>()-&gt;size().width() &lt; 450
+ || qApp-&gt;<a href="ntqapplication.html#desktop">desktop</a>()-&gt;size().height() &lt; 450;
int i;
for ( i= argc &lt;= 1 ? 0 : 1; i&lt;argc; i++ ) {
Editor *e = new Editor;
- e-&gt;<a href="qwidget.html#setCaption">setCaption</a>("TQt Example - TQWERTY");
+ e-&gt;<a href="ntqwidget.html#setCaption">setCaption</a>("TQt Example - TQWERTY");
if ( i &gt; 0 )
e-&gt;load( argv[i] );
if ( isSmall ) {
-<a name="x422"></a> e-&gt;<a href="qwidget.html#showMaximized">showMaximized</a>();
+<a name="x422"></a> e-&gt;<a href="ntqwidget.html#showMaximized">showMaximized</a>();
} else {
- e-&gt;<a href="qwidget.html#resize">resize</a>( 400, 400 );
- e-&gt;<a href="qwidget.html#show">show</a>();
+ e-&gt;<a href="ntqwidget.html#resize">resize</a>( 400, 400 );
+ e-&gt;<a href="ntqwidget.html#show">show</a>();
}
}
-<a name="x416"></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>();
+<a name="x416"></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>