From 9ba04742771370f59740e32e11c5f3a1e6a1b70a Mon Sep 17 00:00:00 2001 From: Timothy Pearson Date: Mon, 5 Dec 2011 15:55:57 -0600 Subject: Initial TQt conversion --- kjsembed/jsconsolewidget.cpp | 60 ++++++++++++++++++++++---------------------- 1 file changed, 30 insertions(+), 30 deletions(-) (limited to 'kjsembed/jsconsolewidget.cpp') diff --git a/kjsembed/jsconsolewidget.cpp b/kjsembed/jsconsolewidget.cpp index f69ba6c5..f3c61c6c 100644 --- a/kjsembed/jsconsolewidget.cpp +++ b/kjsembed/jsconsolewidget.cpp @@ -50,11 +50,11 @@ class JSConsoleWidgetPrivate { }; -JSConsoleWidget::JSConsoleWidget( KJSEmbedPart *jspart, TQWidget *parent, const char *name ) - : TQFrame( parent, name ? name : "jsconsole_widget" ), +JSConsoleWidget::JSConsoleWidget( KJSEmbedPart *jspart, TTQWidget *parent, const char *name ) + : TTQFrame( parent, name ? name : "jsconsole_widget" ), js(jspart), proc(0), d(0) { - setFocusPolicy( TQWidget::StrongFocus ); + setFocusPolicy( TTQWidget::StrongFocus ); createView(); } @@ -64,8 +64,8 @@ JSConsoleWidget::~JSConsoleWidget() void JSConsoleWidget::createView() { - TQPixmap px( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeSmall) ); - TQPixmap pxl( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeLarge) ); + TTQPixmap px( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeSmall) ); + TTQPixmap pxl( KGlobal::iconLoader()->loadIcon("konsole", KIcon::NoGroup, KIcon::SizeLarge) ); setIcon( px ); KWin::setIcons( winId(), pxl, px ); @@ -76,33 +76,33 @@ void JSConsoleWidget::createView() log = new KTextEdit( this, "log_widget" ); log->setReadOnly( true ); log->setUndoRedoEnabled( false ); - log->setTextFormat( Qt::RichText ); - log->setWrapPolicy( TQTextEdit::Anywhere ); + log->setTextFormat( TQt::RichText ); + log->setWrapPolicy( TTQTextEdit::Anywhere ); log->setText( "
" );
-    log->setFocusPolicy( TQWidget::NoFocus );
+    log->setFocusPolicy( TTQWidget::NoFocus );
 
     // Command entry section
-    cmdBox = new TQHBox( this, "cmd_box" );
+    cmdBox = new TTQHBox( this, "cmd_box" );
     cmdBox->setSpacing( KDialog::spacingHint() );
 
-    TQLabel *prompt = new TQLabel( i18n("&KJS>"), cmdBox, "prompt" );
+    TTQLabel *prompt = new TTQLabel( i18n("&KJS>"), cmdBox, "prompt" );
     cmd = new KLineEdit( cmdBox, "cmd_edit" );
-    cmd->setFocusPolicy( TQWidget::StrongFocus );
+    cmd->setFocusPolicy( TTQWidget::StrongFocus );
     cmd->setFocus();
     prompt->setBuddy( cmd );
 
-    go = new TQPushButton( i18n("&Run"), cmdBox, "run_button" );
+    go = new TTQPushButton( i18n("&Run"), cmdBox, "run_button" );
     go->setFixedSize( go->sizeHint() );
 
-    connect( cmd, TQT_SIGNAL(returnPressed(const TQString&)), go, TQT_SLOT( animateClick() ) );
+    connect( cmd, TQT_SIGNAL(returnPressed(const TTQString&)), go, TQT_SLOT( animateClick() ) );
     connect( go, TQT_SIGNAL( clicked() ), TQT_SLOT( invoke() ) );
 
     // Setup completion
     KCompletion *comp = cmd->completionObject();
-    connect( cmd, TQT_SIGNAL(returnPressed(const TQString&)), comp, TQT_SLOT(addItem(const TQString&)) );
+    connect( cmd, TQT_SIGNAL(returnPressed(const TTQString&)), comp, TQT_SLOT(addItem(const TTQString&)) );
 
     // Layout
-    TQVBoxLayout *vert = new TQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
+    TTQVBoxLayout *vert = new TTQVBoxLayout( this, KDialog::marginHint(), KDialog::spacingHint() );
     vert->addWidget( ttl );
     vert->addWidget( log );
     vert->addWidget( cmdBox );
@@ -110,17 +110,17 @@ void JSConsoleWidget::createView()
 
 void JSConsoleWidget::invoke()
 {
-    TQString code( cmd->text() );
-    println( TQString( "KJS> %1" ).arg( code ) );
+    TTQString code( cmd->text() );
+    println( TTQString( "KJS> %1" ).arg( code ) );
     execute( code );
 }
 
-bool JSConsoleWidget::execute( const TQString &cmd )
+bool JSConsoleWidget::execute( const TTQString &cmd )
 {
     return execute( cmd, KJS::Null() );
 }
 
-bool JSConsoleWidget::execute( const TQString &cmd, const KJS::Value &self )
+bool JSConsoleWidget::execute( const TTQString &cmd, const KJS::Value &self )
 {
     KJS::Completion jsres;
     bool ok = js->execute( jsres, cmd, self );
@@ -141,8 +141,8 @@ bool JSConsoleWidget::execute( const TQString &cmd, const KJS::Value &self )
 	    return ok;
 	}
 
-	TQString txt = s.qstring();
-	txt = txt.replace( TQChar('\n'), "
" ); + TTQString txt = s.qstring(); + txt = txt.replace( TTQChar('\n'), "
" ); println( txt ); return ok; @@ -166,15 +166,15 @@ bool JSConsoleWidget::execute( const TQString &cmd, const KJS::Value &self ) return ok; } -void JSConsoleWidget::println( const TQString &msg ) +void JSConsoleWidget::println( const TTQString &msg ) { log->append( msg ); log->scrollToBottom(); } -void JSConsoleWidget::warn( const TQString &msg ) +void JSConsoleWidget::warn( const TTQString &msg ) { - TQString err( "%1" ); + TTQString err( "%1" ); println( err.arg(msg) ); } @@ -182,7 +182,7 @@ void JSConsoleWidget::warn( const TQString &msg ) // Process Handling // -bool JSConsoleWidget::run( const TQString &cmd ) +bool JSConsoleWidget::run( const TTQString &cmd ) { kdDebug(80001) << "JSConsoleWidget::run(" << cmd << ")" << endl; @@ -205,7 +205,7 @@ bool JSConsoleWidget::run( const TQString &cmd ) void JSConsoleWidget::childExited() { - TQString s; + TTQString s; if ( proc->normalExit() ) { if ( proc->exitStatus() ) s = i18n( "[Exited with status %1]\n" ).arg( proc->exitStatus() ); @@ -224,14 +224,14 @@ void JSConsoleWidget::childExited() void JSConsoleWidget::receivedStdOutput( KProcess *, char *buffer, int buflen ) { - TQCString buf = TQCString( buffer, buflen+1 ); - println( TQString(buf) ); + TTQCString buf = TTQCString( buffer, buflen+1 ); + println( TTQString(buf) ); } void JSConsoleWidget::receivedStdError( KProcess *, char *buffer, int buflen ) { - TQCString buf = TQCString( buffer, buflen+1 ); - warn( TQString(buf) ); + TTQCString buf = TTQCString( buffer, buflen+1 ); + warn( TTQString(buf) ); } -- cgit v1.2.3