summaryrefslogtreecommitdiffstats
path: root/kdevdesigner/designer/multilineeditorimpl.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'kdevdesigner/designer/multilineeditorimpl.cpp')
-rw-r--r--kdevdesigner/designer/multilineeditorimpl.cpp86
1 files changed, 43 insertions, 43 deletions
diff --git a/kdevdesigner/designer/multilineeditorimpl.cpp b/kdevdesigner/designer/multilineeditorimpl.cpp
index 1d859211..5d230e05 100644
--- a/kdevdesigner/designer/multilineeditorimpl.cpp
+++ b/kdevdesigner/designer/multilineeditorimpl.cpp
@@ -1,15 +1,15 @@
/**********************************************************************
** Copyright (C) 2000 Trolltech AS. All rights reserved.
**
-** This file is part of Qt Designer.
+** This file is part of TQt Designer.
**
** This file may be distributed and/or modified under the terms of the
** GNU General Public License version 2 as published by the Free Software
** Foundation and appearing in the file LICENSE.GPL included in the
** packaging of this file.
**
-** Licensees holding valid Qt Enterprise Edition or Qt Professional Edition
-** licenses may use this file in accordance with the Qt Commercial License
+** Licensees holding valid TQt Enterprise Edition or TQt Professional Edition
+** licenses may use this file in accordance with the TQt Commercial License
** Agreement provided with the Software.
**
** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
@@ -17,7 +17,7 @@
**
** See http://www.trolltech.com/gpl/ for GPL licensing information.
** See http://www.trolltech.com/pricing.html or email [email protected] for
-** information about Qt Commercial License Agreements.
+** information about TQt Commercial License Agreements.
**
** Contact [email protected] if any conditions of this licensing are
** not clear to you.
@@ -36,7 +36,7 @@
#include "kdevdesigner_part.h"
#include <tqtextedit.h>
-#include <./private/qrichtext_p.h>
+#include <./private/tqrichtext_p.h>
#include <tqpushbutton.h>
#include <tqlayout.h>
#include <tqtoolbutton.h>
@@ -46,10 +46,10 @@
#include <klocale.h>
-ToolBarItem::ToolBarItem( TQWidget *parent, TQWidget *toolBar,
+ToolBarItem::ToolBarItem( TQWidget *tqparent, TQWidget *toolBar,
const TQString &label, const TQString &tagstr,
const TQIconSet &icon, const TQKeySequence &key )
- : TQAction( parent )
+ : TQAction( tqparent )
{
setIconSet( icon );
setText( label );
@@ -69,22 +69,22 @@ void ToolBarItem::wasActivated()
emit clicked( tag );
}
-TextEdit::TextEdit( TQWidget *parent, const char *name )
- : TQTextEdit( parent, name )
+TextEdit::TextEdit( TQWidget *tqparent, const char *name )
+ : TQTextEdit( tqparent, name )
{
- setTextFormat( Qt::PlainText );
+ setTextFormat( TQt::PlainText );
}
-QTextParagraph* TextEdit::paragraph()
+TQTextParagraph* TextEdit::paragraph()
{
- QTextCursor *tc = new QTextCursor( TQTextEdit::document() );
+ TQTextCursor *tc = new TQTextCursor( TQTextEdit::document() );
return tc->paragraph();
}
-MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget *parent, TQWidget *editWidget,
+MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget *tqparent, TQWidget *editWidget,
FormWindow *fw, const TQString &text )
- : MultiLineEditorBase( parent, 0, WType_Dialog | WShowModal ), formwindow( fw ), doWrap( FALSE )
+ : MultiLineEditorBase( tqparent, 0, WType_Dialog | WShowModal ), formwindow( fw ), doWrap( FALSE )
{
callStatic = call_static;
@@ -126,45 +126,45 @@ MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget
basicToolBar->addSeparator();
- TQPopupMenu *layoutMenu = new TQPopupMenu( this );
- menuBar->insertItem( i18n( "&Layout" ), layoutMenu );
+ TQPopupMenu *tqlayoutMenu = new TQPopupMenu( this );
+ menuBar->insertItem( i18n( "&Layout" ), tqlayoutMenu );
TQAction *brAction = new TQAction( this );
brAction->setIconSet( BarIcon( "designer_textlinebreak.png", KDevDesignerPartFactory::instance() ) );
brAction->setText( i18n("Break" ) );
brAction->addTo( basicToolBar );
- brAction->addTo( layoutMenu );
+ brAction->addTo( tqlayoutMenu );
connect( brAction, TQT_SIGNAL( activated() ) , this, TQT_SLOT( insertBR() ) );
ToolBarItem *p = new ToolBarItem( this, basicToolBar, i18n( "Paragraph" ),
"p", BarIcon( "designer_textparagraph.png", KDevDesignerPartFactory::instance() ) );
- p->addTo( layoutMenu );
+ p->addTo( tqlayoutMenu );
connect( p, TQT_SIGNAL( clicked( const TQString& ) ),
this, TQT_SLOT( insertTags( const TQString& )));
- layoutMenu->insertSeparator();
+ tqlayoutMenu->insertSeparator();
basicToolBar->addSeparator();
ToolBarItem *al = new ToolBarItem( this, basicToolBar, i18n( "Align left" ),
"p align=\"left\"", BarIcon( "designer_textleft.png", KDevDesignerPartFactory::instance() ) );
- al->addTo( layoutMenu );
+ al->addTo( tqlayoutMenu );
connect( al, TQT_SIGNAL( clicked( const TQString& ) ),
this, TQT_SLOT( insertTags( const TQString& )));
ToolBarItem *ac = new ToolBarItem( this, basicToolBar, i18n( "Align center" ),
"p align=\"center\"", BarIcon( "designer_textcenter.png", KDevDesignerPartFactory::instance() ) );
- ac->addTo( layoutMenu );
+ ac->addTo( tqlayoutMenu );
connect( ac, TQT_SIGNAL( clicked( const TQString& ) ),
this, TQT_SLOT( insertTags( const TQString& )));
ToolBarItem *ar = new ToolBarItem( this, basicToolBar, i18n( "Align right" ),
"p align=\"right\"", BarIcon( "designer_textright.png", KDevDesignerPartFactory::instance() ) );
- ar->addTo( layoutMenu );
+ ar->addTo( tqlayoutMenu );
connect( ar, TQT_SIGNAL( clicked( const TQString& ) ),
this, TQT_SLOT( insertTags( const TQString& )));
ToolBarItem *block = new ToolBarItem( this, basicToolBar, i18n( "Blockquote" ),
"blockquote", BarIcon( "designer_textjustify.png", KDevDesignerPartFactory::instance() ) );
- block->addTo( layoutMenu );
+ block->addTo( tqlayoutMenu );
connect( block, TQT_SIGNAL( clicked( const TQString& ) ),
this, TQT_SLOT( insertTags( const TQString& )));
@@ -223,16 +223,16 @@ MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget
wrapAction->setOn( doWrap );
connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) );
- textEdit->document()->setFormatter( new QTextFormatterBreakInWords );
+ textEdit->document()->setFormatter( new TQTextFormatterBreakInWords );
textEdit->document()->setUseFormatCollection( FALSE );
textEdit->document()->setPreProcessor( new SyntaxHighlighter_HTML );
- if ( !callStatic && ::qt_cast<TQTextEdit*>(editWidget) ) {
+ if ( !callStatic && ::tqqt_cast<TQTextEdit*>(editWidget) ) {
mlined = (TQTextEdit*)editWidget;
mlined->setReadOnly( TRUE );
- const TQMetaProperty *wordWrap = mlined->metaObject()->property(
- mlined->metaObject()->findProperty( "wordWrap", TRUE ), TRUE );
+ const TQMetaProperty *wordWrap = mlined->tqmetaObject()->property(
+ mlined->tqmetaObject()->tqfindProperty( "wordWrap", TRUE ), TRUE );
oldWrapMode = 0;
oldWrapString = "NoWrap";
if ( wordWrap ) {
@@ -241,7 +241,7 @@ MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget
if ( oldWrapString != "NoWrap" )
doWrap = TRUE;
}
- textEdit->setAlignment( mlined->alignment() );
+ textEdit->tqsetAlignment( mlined->tqalignment() );
textEdit->setWordWrap( mlined->wordWrap() );
textEdit->setWrapColumnOrWidth( mlined->wrapColumnOrWidth() );
textEdit->setWrapPolicy( mlined->wrapPolicy() );
@@ -263,7 +263,7 @@ int MultiLineEditor::exec()
{
res = 1;
show();
- qApp->enter_loop();
+ tqApp->enter_loop();
return res;
}
@@ -276,23 +276,23 @@ void MultiLineEditor::okClicked()
void MultiLineEditor::applyClicked()
{
if ( !callStatic ) {
- PopulateMultiLineEditCommand *cmd = new PopulateMultiLineEditCommand( i18n( "Set the Text of '%1'" ).arg( mlined->name() ),
+ PopulateMultiLineEditCommand *cmd = new PopulateMultiLineEditCommand( i18n( "Set the Text of '%1'" ).tqarg( mlined->name() ),
formwindow, mlined, textEdit->text() );
cmd->execute();
formwindow->commandHistory()->addCommand( cmd );
if ( oldDoWrap != doWrap ) {
- TQString pn( i18n( "Set 'wordWrap' of '%2'" ).arg( mlined->name() ) );
+ TQString pn( i18n( "Set 'wordWrap' of '%2'" ).tqarg( mlined->name() ) );
SetPropertyCommand *propcmd;
if ( doWrap )
propcmd = new SetPropertyCommand( pn, formwindow,
- mlined, MainWindow::self->propertyeditor(),
- "wordWrap", WidgetFactory::property( mlined, "wordWrap" ),
+ TQT_TQOBJECT(mlined), MainWindow::self->propertyeditor(),
+ "wordWrap", WidgetFactory::property( TQT_TQOBJECT(mlined), "wordWrap" ),
TQVariant( 1 ), "WidgetWidth", oldWrapString );
else
propcmd = new SetPropertyCommand( pn, formwindow,
- mlined, MainWindow::self->propertyeditor(),
- "wordWrap", WidgetFactory::property( mlined, "wordWrap" ),
+ TQT_TQOBJECT(mlined), MainWindow::self->propertyeditor(),
+ "wordWrap", WidgetFactory::property( TQT_TQOBJECT(mlined), "wordWrap" ),
TQVariant( 0 ), "NoWrap", oldWrapString );
propcmd->execute();
@@ -313,7 +313,7 @@ void MultiLineEditor::cancelClicked()
void MultiLineEditor::closeEvent( TQCloseEvent *e )
{
- qApp->exit_loop();
+ tqApp->exit_loop();
MultiLineEditorBase::closeEvent( e );
}
@@ -321,11 +321,11 @@ void MultiLineEditor::insertTags( const TQString &tag )
{
int pfrom, pto, ifrom, ito;
TQString tagend( tag.simplifyWhiteSpace() );
- tagend.remove( tagend.find( ' ', 0 ), tagend.length() );
+ tagend.remove( tagend.tqfind( ' ', 0 ), tagend.length() );
if ( textEdit->hasSelectedText() ) {
textEdit->getSelection( &pfrom, &ifrom, &pto, &ito );
TQString buf = textEdit->selectedText();
- buf = TQString( "<%1>%3</%2>" ).arg( tag ).arg( tagend ).arg( buf );
+ buf = TQString( "<%1>%3</%2>" ).tqarg( tag ).tqarg( tagend ).tqarg( buf );
textEdit->removeSelectedText();
textEdit->insertAt( buf, pfrom, ifrom );
textEdit->setCursorPosition( pto, ito + 2 + tag.length() );
@@ -333,7 +333,7 @@ void MultiLineEditor::insertTags( const TQString &tag )
else {
int para, index;
textEdit->getCursorPosition( &para, &index );
- textEdit->insert( TQString( "<%1></%2>" ).arg( tag ).arg( tagend ) );
+ textEdit->insert( TQString( "<%1></%2>" ).tqarg( tag ).tqarg( tagend ) );
index += 2 + tag.length();
textEdit->setCursorPosition( para, index );
}
@@ -363,7 +363,7 @@ void MultiLineEditor::showFontDialog()
if ( fd->getFont() != "default" )
font = "face=\"" + fd->getFont() + "\"";
TQString tag( TQString( "font %1 %2 %3" )
- .arg( color ).arg( size ).arg( font ) );
+ .tqarg( color ).tqarg( size ).tqarg( font ) );
if ( selText )
textEdit->setSelection( pfrom, ifrom, pto, ito );
@@ -378,16 +378,16 @@ TQString MultiLineEditor::getStaticText()
return staticText.stripWhiteSpace();
}
-TQString MultiLineEditor::getText( TQWidget *parent, const TQString &text, bool richtextMode, bool *useWrap )
+TQString MultiLineEditor::getText( TQWidget *tqparent, const TQString &text, bool richtextMode, bool *useWrap )
{
- MultiLineEditor medit( TRUE, richtextMode, parent, 0, 0, text );
+ MultiLineEditor medit( TRUE, richtextMode, tqparent, 0, 0, text );
if ( richtextMode )
medit.setUseWrapping( *useWrap );
if ( medit.exec() == TQDialog::Accepted ) {
*useWrap = medit.useWrapping();
return medit.getStaticText();
}
- return TQString::null;
+ return TQString();
}
void MultiLineEditor::changeWrapMode( bool b )