diff options
Diffstat (limited to 'kdevdesigner/designer/multilineeditorimpl.cpp')
-rw-r--r-- | kdevdesigner/designer/multilineeditorimpl.cpp | 98 |
1 files changed, 49 insertions, 49 deletions
diff --git a/kdevdesigner/designer/multilineeditorimpl.cpp b/kdevdesigner/designer/multilineeditorimpl.cpp index ef06f77b..702e1ca8 100644 --- a/kdevdesigner/designer/multilineeditorimpl.cpp +++ b/kdevdesigner/designer/multilineeditorimpl.cpp @@ -36,7 +36,7 @@ #include "kdevdesigner_part.h" #include <tqtextedit.h> -#include <tqrichtext_p.h> +#include <private/tqrichtext_p.h> #include <tqpushbutton.h> #include <tqlayout.h> #include <tqtoolbutton.h> @@ -56,7 +56,7 @@ ToolBarItem::ToolBarItem( TQWidget *parent, TQWidget *toolBar, setAccel( key ); addTo( toolBar ); tag = tagstr; - connect( this, TQT_SIGNAL( activated() ), this, TQT_SLOT( wasActivated() ) ); + connect( this, TQ_SIGNAL( activated() ), this, TQ_SLOT( wasActivated() ) ); } ToolBarItem::~ToolBarItem() @@ -84,7 +84,7 @@ TQTextParagraph* TextEdit::paragraph() MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget *parent, TQWidget *editWidget, FormWindow *fw, const TQString &text ) - : MultiLineEditorBase( parent, 0, WType_Dialog | WShowModal ), formwindow( fw ), doWrap( FALSE ) + : MultiLineEditorBase( parent, 0, WType_Dialog | WShowModal ), formwindow( fw ), doWrap( false ) { callStatic = call_static; @@ -103,26 +103,26 @@ MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget ToolBarItem *it = new ToolBarItem( this, basicToolBar, i18n( "Italic" ), "i", BarIcon( "designer_textitalic.png", KDevDesignerPartFactory::instance() ), CTRL+Key_I ); it->addTo( stylesMenu ); - connect( it, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( it, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); ToolBarItem *b = new ToolBarItem( this, basicToolBar, i18n( "Bold" ), "b", BarIcon( "designer_textbold.png", KDevDesignerPartFactory::instance() ), CTRL+Key_B ); b->addTo( stylesMenu ); - connect( b, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( b, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); ToolBarItem *ul = new ToolBarItem( this, basicToolBar, i18n( "Underline" ), "u", BarIcon( "designer_textunderline.png" , KDevDesignerPartFactory::instance()), CTRL+Key_U ); ul->addTo( stylesMenu ); - connect( ul, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( ul, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); ToolBarItem *tt = new ToolBarItem( this, basicToolBar, i18n( "Typewriter" ), "tt", BarIcon( "designer_textteletext.png", KDevDesignerPartFactory::instance() ) ); tt->addTo( stylesMenu ); - connect( tt, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( tt, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); basicToolBar->addSeparator(); @@ -134,39 +134,39 @@ MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget brAction->setText( i18n("Break" ) ); brAction->addTo( basicToolBar ); brAction->addTo( layoutMenu ); - connect( brAction, TQT_SIGNAL( activated() ) , this, TQT_SLOT( insertBR() ) ); + connect( brAction, TQ_SIGNAL( activated() ) , this, TQ_SLOT( insertBR() ) ); ToolBarItem *p = new ToolBarItem( this, basicToolBar, i18n( "Paragraph" ), "p", BarIcon( "designer_textparagraph.png", KDevDesignerPartFactory::instance() ) ); p->addTo( layoutMenu ); - connect( p, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( p, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); layoutMenu->insertSeparator(); basicToolBar->addSeparator(); ToolBarItem *al = new ToolBarItem( this, basicToolBar, i18n( "Align left" ), "p align=\"left\"", BarIcon( "designer_textleft.png", KDevDesignerPartFactory::instance() ) ); al->addTo( layoutMenu ); - connect( al, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( al, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_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 ); - connect( ac, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( ac, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_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 ); - connect( ar, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( ar, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); ToolBarItem *block = new ToolBarItem( this, basicToolBar, i18n( "Blockquote" ), "blockquote", BarIcon( "designer_textjustify.png", KDevDesignerPartFactory::instance() ) ); block->addTo( layoutMenu ); - connect( block, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( block, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); TQPopupMenu *fontMenu = new TQPopupMenu( this ); @@ -179,67 +179,67 @@ MultiLineEditor::MultiLineEditor( bool call_static, bool richtextMode, TQWidget fontAction->setText( i18n("Font" ) ); fontAction->addTo( fontToolBar ); fontAction->addTo( fontMenu ); - connect( fontAction, TQT_SIGNAL( activated() ) , this, TQT_SLOT( showFontDialog() ) ); + connect( fontAction, TQ_SIGNAL( activated() ) , this, TQ_SLOT( showFontDialog() ) ); ToolBarItem *fp1 = new ToolBarItem( this, fontToolBar, i18n( "Fontsize +1" ), "font size=\"+1\"", BarIcon( "designer_textlarger.png", KDevDesignerPartFactory::instance() ) ); - connect( fp1, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( fp1, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); ToolBarItem *fm1 = new ToolBarItem( this, fontToolBar, i18n( "Fontsize -1" ), "font size=\"-1\"", BarIcon( "designer_textsmaller.png", KDevDesignerPartFactory::instance() ) ); - connect( fm1, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( fm1, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); ToolBarItem *h1 = new ToolBarItem( this, fontToolBar, i18n( "Headline 1" ), "h1", BarIcon( "designer_texth1.png", KDevDesignerPartFactory::instance() ) ); - connect( h1, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( h1, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); ToolBarItem *h2 = new ToolBarItem( this, fontToolBar, i18n( "Headline 2" ), "h2", BarIcon( "designer_texth2.png", KDevDesignerPartFactory::instance() ) ); - connect( h2, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( h2, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); ToolBarItem *h3 = new ToolBarItem( this, fontToolBar, i18n( "Headline 3" ), "h3", BarIcon( "designer_texth3.png", KDevDesignerPartFactory::instance() ) ); - connect( h3, TQT_SIGNAL( clicked( const TQString& ) ), - this, TQT_SLOT( insertTags( const TQString& ))); + connect( h3, TQ_SIGNAL( clicked( const TQString& ) ), + this, TQ_SLOT( insertTags( const TQString& ))); TQPopupMenu *optionsMenu = new TQPopupMenu( this ); menuBar->insertItem( i18n( "O&ptions" ), optionsMenu ); optionsToolBar = new TQToolBar( "Options", this, DockTop ); wrapAction = new TQAction( this ); - wrapAction->setToggleAction( TRUE ); + wrapAction->setToggleAction( true ); wrapAction->setIconSet( BarIcon( "designer_wordwrap.png", KDevDesignerPartFactory::instance() ) ); wrapAction->setText( i18n( "Word Wrapping" ) ); wrapAction->addTo( optionsToolBar ); wrapAction->addTo( optionsMenu ); - connect( wrapAction, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( changeWrapMode( bool ) ) ); + connect( wrapAction, TQ_SIGNAL( toggled( bool ) ), this, TQ_SLOT( changeWrapMode( bool ) ) ); oldDoWrap = doWrap; wrapAction->setOn( doWrap ); - connect( helpButton, TQT_SIGNAL( clicked() ), MainWindow::self, TQT_SLOT( showDialogHelp() ) ); + connect( helpButton, TQ_SIGNAL( clicked() ), MainWindow::self, TQ_SLOT( showDialogHelp() ) ); textEdit->document()->setFormatter( new TQTextFormatterBreakInWords ); - textEdit->document()->setUseFormatCollection( FALSE ); + textEdit->document()->setUseFormatCollection( false ); textEdit->document()->setPreProcessor( new SyntaxHighlighter_HTML ); - if ( !callStatic && ::tqqt_cast<TQTextEdit*>(editWidget) ) { + if ( !callStatic && ::tqt_cast<TQTextEdit*>(editWidget) ) { mlined = (TQTextEdit*)editWidget; - mlined->setReadOnly( TRUE ); + mlined->setReadOnly( true ); const TQMetaProperty *wordWrap = mlined->metaObject()->property( - mlined->metaObject()->findProperty( "wordWrap", TRUE ), TRUE ); + mlined->metaObject()->findProperty( "wordWrap", true ), true ); oldWrapMode = 0; oldWrapString = "NoWrap"; if ( wordWrap ) { oldWrapMode = mlined->property( "wordWrap" ); oldWrapString = TQString( wordWrap->valueToKey( oldWrapMode.toInt() ) ); if ( oldWrapString != "NoWrap" ) - doWrap = TRUE; + doWrap = true; } textEdit->setAlignment( mlined->alignment() ); textEdit->setWordWrap( mlined->wordWrap() ); @@ -286,17 +286,17 @@ void MultiLineEditor::applyClicked() SetPropertyCommand *propcmd; if ( doWrap ) propcmd = new SetPropertyCommand( pn, formwindow, - TQT_TQOBJECT(mlined), MainWindow::self->propertyeditor(), - "wordWrap", WidgetFactory::property( TQT_TQOBJECT(mlined), "wordWrap" ), + mlined, MainWindow::self->propertyeditor(), + "wordWrap", WidgetFactory::property( mlined, "wordWrap" ), TQVariant( 1 ), "WidgetWidth", oldWrapString ); else propcmd = new SetPropertyCommand( pn, formwindow, - TQT_TQOBJECT(mlined), MainWindow::self->propertyeditor(), - "wordWrap", WidgetFactory::property( TQT_TQOBJECT(mlined), "wordWrap" ), + mlined, MainWindow::self->propertyeditor(), + "wordWrap", WidgetFactory::property( mlined, "wordWrap" ), TQVariant( 0 ), "NoWrap", oldWrapString ); propcmd->execute(); - formwindow->commandHistory()->addCommand( propcmd, TRUE ); + formwindow->commandHistory()->addCommand( propcmd, true ); } textEdit->setFocus(); } @@ -346,11 +346,11 @@ void MultiLineEditor::insertBR() void MultiLineEditor::showFontDialog() { - bool selText = FALSE; + bool selText = false; int pfrom, pto, ifrom, ito; if ( textEdit->hasSelectedText() ) { textEdit->getSelection( &pfrom, &ifrom, &pto, &ito ); - selText = TRUE; + selText = true; } RichTextFontDialog *fd = new RichTextFontDialog( this ); if ( fd->exec() == TQDialog::Accepted ) { @@ -380,7 +380,7 @@ TQString MultiLineEditor::getStaticText() TQString MultiLineEditor::getText( TQWidget *parent, const TQString &text, bool richtextMode, bool *useWrap ) { - MultiLineEditor medit( TRUE, richtextMode, parent, 0, 0, text ); + MultiLineEditor medit( true, richtextMode, parent, 0, 0, text ); if ( richtextMode ) medit.setUseWrapping( *useWrap ); if ( medit.exec() == TQDialog::Accepted ) { |