From ea318d1431c89e647598c510c4245c6571aa5f46 Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Thu, 26 Jan 2012 23:32:43 -0600 Subject: Update to latest tqt3 automated conversion --- doc/html/simple-font-demo-example.html | 158 ++++++++++++++++----------------- 1 file changed, 79 insertions(+), 79 deletions(-) (limited to 'doc/html/simple-font-demo-example.html') diff --git a/doc/html/simple-font-demo-example.html b/doc/html/simple-font-demo-example.html index eacba8f37..748a65343 100644 --- a/doc/html/simple-font-demo-example.html +++ b/doc/html/simple-font-demo-example.html @@ -34,7 +34,7 @@ body { background: #ffffff; color: black; }

This example demonstrates the use of various -TQFont member functions. +TQFont member functions.


The main window API (viewer.h):

/* $Id: qt/viewer.h   3.3.8   edited May 27 2003 $ */
@@ -43,13 +43,13 @@ body { background: #ffffff; color: black; }
 #define VIEWER_H
 
 
-#include <qwidget.h>
-#include <qfont.h>
+#include <ntqwidget.h>
+#include <ntqfont.h>
 
 class TQTextView;
 class TQPushButton;
 
-class Viewer : public TQWidget
+class Viewer : public TQWidget
 {
 Q_OBJECT
 
@@ -64,14 +64,14 @@ private slots:
 private:
     void setFontSubstitutions();
     void layout();
-    void showFontInfo( TQFont & );
+    void showFontInfo( TQFont & );
 
-    TQTextView * greetings;
-    TQTextView * fontInfo;
+    TQTextView * greetings;
+    TQTextView * fontInfo;
 
-    TQPushButton * defaultButton;
-    TQPushButton * sansSerifButton;
-    TQPushButton * italicsButton;
+    TQPushButton * defaultButton;
+    TQPushButton * sansSerifButton;
+    TQPushButton * italicsButton;
 };
 
 #endif
@@ -82,128 +82,128 @@ private:
 

/* $Id: qt/viewer.cpp   3.3.8   edited May 27 2003 $ */
 
 #include "viewer.h"
-#include <qstring.h>
-#include <qstringlist.h>
-#include <qtextview.h>
-#include <qpushbutton.h>
-#include <qlayout.h>
+#include <ntqstring.h>
+#include <ntqstringlist.h>
+#include <ntqtextview.h>
+#include <ntqpushbutton.h>
+#include <ntqlayout.h>
 
 Viewer::Viewer()
-       :TQWidget()
+       :TQWidget()
 {
     setFontSubstitutions();
 
-    TQString greeting_heb = TQString::fromUtf8( "\327\251\327\234\327\225\327\235" );
-    TQString greeting_ru = TQString::fromUtf8( "\320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265" );
-    TQString greeting_en( "Hello" );
+    TQString greeting_heb = TQString::fromUtf8( "\327\251\327\234\327\225\327\235" );
+    TQString greeting_ru = TQString::fromUtf8( "\320\227\320\264\321\200\320\260\320\262\321\201\321\202\320\262\321\203\320\271\321\202\320\265" );
+    TQString greeting_en( "Hello" );
 
-    greetings = new TQTextView( this, "textview" );
+    greetings = new TQTextView( this, "textview" );
 
-    greetings->setText( greeting_en + "\n" +
+    greetings->setText( greeting_en + "\n" +
                        greeting_ru + "\n" +
                        greeting_heb );
 
-    fontInfo = new TQTextView( this, "fontinfo" );
+    fontInfo = new TQTextView( this, "fontinfo" );
 
     setDefault();
 
-    defaultButton = new TQPushButton( "Default", this,
+    defaultButton = new TQPushButton( "Default", this,
                                                    "pushbutton1" );
-    defaultButton->setFont( TQFont( "times" ) );
-    connect( defaultButton, SIGNAL( clicked() ),
+    defaultButton->setFont( TQFont( "times" ) );
+    connect( defaultButton, SIGNAL( clicked() ),
              this, SLOT( setDefault() ) );
 
-    sansSerifButton = new TQPushButton( "Sans Serif", this,
+    sansSerifButton = new TQPushButton( "Sans Serif", this,
                                                      "pushbutton2" );
-    sansSerifButton->setFont( TQFont( "Helvetica", 12 ) );
-    connect( sansSerifButton, SIGNAL( clicked() ),
+    sansSerifButton->setFont( TQFont( "Helvetica", 12 ) );
+    connect( sansSerifButton, SIGNAL( clicked() ),
              this, SLOT( setSansSerif() ) );
 
-    italicsButton = new TQPushButton( "Italics", this,
+    italicsButton = new TQPushButton( "Italics", this,
                                                    "pushbutton3" );
-    italicsButton->setFont( TQFont( "lucida", 12, TQFont::Bold, TRUE ) );
-    connect( italicsButton, SIGNAL( clicked() ),
+    italicsButton->setFont( TQFont( "lucida", 12, TQFont::Bold, TRUE ) );
+    connect( italicsButton, SIGNAL( clicked() ),
              this, SLOT( setItalics() ) );
 
-    layout();
+    layout();
 }
 
 void Viewer::setDefault()
 {
-    TQFont font( "Bavaria" );
-    font.setPointSize( 24 );
+    TQFont font( "Bavaria" );
+    font.setPointSize( 24 );
 
-    font.setWeight( TQFont::Bold );
-    font.setUnderline( TRUE );
+    font.setWeight( TQFont::Bold );
+    font.setUnderline( TRUE );
 
-    greetings->setFont( font );
+    greetings->setFont( font );
 
     showFontInfo( font );
 }
 
 void Viewer::setSansSerif()
 {
-    TQFont font( "Newyork", 18 );
-    font.setStyleHint( TQFont::SansSerif );
-    greetings->setFont( font );
+    TQFont font( "Newyork", 18 );
+    font.setStyleHint( TQFont::SansSerif );
+    greetings->setFont( font );
 
     showFontInfo( font );
 }
 
 void Viewer::setItalics()
 {
-    TQFont font( "Tokyo" );
-    font.setPointSize( 32 );
-    font.setWeight( TQFont::Bold );
-    font.setItalic( TRUE );
+    TQFont font( "Tokyo" );
+    font.setPointSize( 32 );
+    font.setWeight( TQFont::Bold );
+    font.setItalic( TRUE );
 
-    greetings->setFont( font );
+    greetings->setFont( font );
 
     showFontInfo( font );
 }
 
-void Viewer::showFontInfo( TQFont & font )
+void Viewer::showFontInfo( TQFont & font )
 {
-    TQFontInfo info( font );
+    TQFontInfo info( font );
 
-    TQString messageText;
+    TQString messageText;
     messageText = "Font requested: \"" +
-                  font.family() + "\" " +
-                  TQString::number( font.pointSize() ) + "pt<BR>" +
+                  font.family() + "\" " +
+                  TQString::number( font.pointSize() ) + "pt<BR>" +
                   "Font used: \"" +
-                  info.family() + "\" " +
-                  TQString::number( info.pointSize() ) + "pt<P>";
+                  info.family() + "\" " +
+                  TQString::number( info.pointSize() ) + "pt<P>";
 
-    TQStringList substitutions = TQFont::substitutes( font.family() );
+    TQStringList substitutions = TQFont::substitutes( font.family() );
 
-    if ( ! substitutions.isEmpty() ){
+    if ( ! substitutions.isEmpty() ){
         messageText += "The following substitutions exist for " + \
-                       font.family() + ":<UL>";
+                       font.family() + ":<UL>";
 
-        TQStringList::Iterator i = substitutions.begin();
-        while ( i != substitutions.end() ){
+        TQStringList::Iterator i = substitutions.begin();
+        while ( i != substitutions.end() ){
             messageText += "<LI>\"" + (* i) + "\"";
             i++;
         }
          messageText += "</UL>";
     } else {
         messageText += "No substitutions exist for " + \
-                       font.family() + ".";
+                       font.family() + ".";
     }
 
-    fontInfo->setText( messageText );
+    fontInfo->setText( messageText );
 }
 
 void Viewer::setFontSubstitutions()
 {
-    TQStringList substitutes;
-    substitutes.append( "Times" );
+    TQStringList substitutes;
+    substitutes.append( "Times" );
     substitutes +=  "Mincho",
     substitutes << "Arabic Newspaper" << "crox";
 
-    TQFont::insertSubstitutions( "Bavaria", substitutes );
+    TQFont::insertSubstitutions( "Bavaria", substitutes );
 
-    TQFont::insertSubstitution( "Tokyo", "Lucida" );
+    TQFont::insertSubstitution( "Tokyo", "Lucida" );
 }
 
 
@@ -211,7 +211,7 @@ void Viewer::setFontSubstitutions()
 // the following function might not be of particular interest:
 // all it does is creating the widget layout.
 
-void Viewer::layout()
+void Viewer::layout()
 {
     TQHBoxLayout * textViewContainer = new TQHBoxLayout();
     textViewContainer->addWidget( greetings );
@@ -223,22 +223,22 @@ void Viewer::setFontSubstitutions()
     buttonContainer->addWidget( sansSerifButton );
     buttonContainer->addWidget( italicsButton );
 
-    int maxButtonHeight = defaultButton->height();
+    int maxButtonHeight = defaultButton->height();
 
-    if ( sansSerifButton->height() > maxButtonHeight )
-        maxButtonHeight = sansSerifButton->height();
-    if ( italicsButton->height() > maxButtonHeight )
-        maxButtonHeight = italicsButton->height();
+    if ( sansSerifButton->height() > maxButtonHeight )
+        maxButtonHeight = sansSerifButton->height();
+    if ( italicsButton->height() > maxButtonHeight )
+        maxButtonHeight = italicsButton->height();
 
-    defaultButton->setFixedHeight( maxButtonHeight );
-    sansSerifButton->setFixedHeight( maxButtonHeight );
-    italicsButton->setFixedHeight( maxButtonHeight );
+    defaultButton->setFixedHeight( maxButtonHeight );
+    sansSerifButton->setFixedHeight( maxButtonHeight );
+    italicsButton->setFixedHeight( maxButtonHeight );
 
     TQVBoxLayout * container = new TQVBoxLayout( this );
     container->addLayout( textViewContainer );
     container->addLayout( buttonContainer );
 
-    resize( 700, 250 );
+    resize( 700, 250 );
 }
 
@@ -248,16 +248,16 @@ void Viewer::setFontSubstitutions() #include "viewer.h" -#include <qapplication.h> +#include <ntqapplication.h> int main( int argc, char **argv ) { - TQApplication app( argc, argv ); + TQApplication app( argc, argv ); Viewer * textViewer = new Viewer(); - textViewer->setCaption( "TQt Example - Simple TQFont Demo" ); - app.setMainWidget( textViewer ); - textViewer->show(); - return app.exec(); + textViewer->setCaption( "TQt Example - Simple TQFont Demo" ); + app.setMainWidget( textViewer ); + textViewer->show(); + return app.exec(); }
-- cgit v1.2.1