summaryrefslogtreecommitdiffstats
path: root/knotes/knoteedit.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'knotes/knoteedit.cpp')
-rw-r--r--knotes/knoteedit.cpp132
1 files changed, 66 insertions, 66 deletions
diff --git a/knotes/knoteedit.cpp b/knotes/knoteedit.cpp
index 2398df19f..7df68149c 100644
--- a/knotes/knoteedit.cpp
+++ b/knotes/knoteedit.cpp
@@ -18,8 +18,8 @@
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*******************************************************************/
-#include <qdragobject.h>
-#include <qfont.h>
+#include <tqdragobject.h>
+#include <tqfont.h>
#include <kdebug.h>
#include <klocale.h>
@@ -34,7 +34,7 @@ static const short SEP = 5;
static const short ICON_SIZE = 10;
-KNoteEdit::KNoteEdit( KActionCollection *actions, QWidget *parent, const char *name )
+KNoteEdit::KNoteEdit( KActionCollection *actions, TQWidget *parent, const char *name )
: KTextEdit( parent, name )
{
setAcceptDrops( true );
@@ -43,27 +43,27 @@ KNoteEdit::KNoteEdit( KActionCollection *actions, QWidget *parent, const char *n
setLinkUnderline( true );
// create the actions for the RMB menu
- KAction* undo = KStdAction::undo( this, SLOT(undo()), actions );
- KAction* redo = KStdAction::redo( this, SLOT(redo()), actions );
+ KAction* undo = KStdAction::undo( this, TQT_SLOT(undo()), actions );
+ KAction* redo = KStdAction::redo( this, TQT_SLOT(redo()), actions );
undo->setEnabled( isUndoAvailable() );
redo->setEnabled( isRedoAvailable() );
- m_cut = KStdAction::cut( this, SLOT(cut()), actions );
- m_copy = KStdAction::copy( this, SLOT(copy()), actions );
- m_paste = KStdAction::paste( this, SLOT(paste()), actions );
+ m_cut = KStdAction::cut( this, TQT_SLOT(cut()), actions );
+ m_copy = KStdAction::copy( this, TQT_SLOT(copy()), actions );
+ m_paste = KStdAction::paste( this, TQT_SLOT(paste()), actions );
m_cut->setEnabled( false );
m_copy->setEnabled( false );
m_paste->setEnabled( true );
- connect( this, SIGNAL(undoAvailable(bool)), undo, SLOT(setEnabled(bool)) );
- connect( this, SIGNAL(redoAvailable(bool)), redo, SLOT(setEnabled(bool)) );
+ connect( this, TQT_SIGNAL(undoAvailable(bool)), undo, TQT_SLOT(setEnabled(bool)) );
+ connect( this, TQT_SIGNAL(redoAvailable(bool)), redo, TQT_SLOT(setEnabled(bool)) );
- connect( this, SIGNAL(copyAvailable(bool)), m_cut, SLOT(setEnabled(bool)) );
- connect( this, SIGNAL(copyAvailable(bool)), m_copy, SLOT(setEnabled(bool)) );
+ connect( this, TQT_SIGNAL(copyAvailable(bool)), m_cut, TQT_SLOT(setEnabled(bool)) );
+ connect( this, TQT_SIGNAL(copyAvailable(bool)), m_copy, TQT_SLOT(setEnabled(bool)) );
- new KAction( KStdGuiItem::clear(), 0, this, SLOT(clear()), actions, "edit_clear" );
- KStdAction::selectAll( this, SLOT(selectAll()), actions );
+ new KAction( KStdGuiItem::clear(), 0, this, TQT_SLOT(clear()), actions, "edit_clear" );
+ KStdAction::selectAll( this, TQT_SLOT(selectAll()), actions );
// create the actions modifying the text format
m_textBold = new KToggleAction( i18n("Bold"), "text_bold", CTRL + Key_B, 0, 0,
@@ -75,23 +75,23 @@ KNoteEdit::KNoteEdit( KActionCollection *actions, QWidget *parent, const char *n
m_textStrikeOut = new KToggleAction( i18n("Strike Out"), "text_strike", CTRL + Key_S, 0, 0,
actions, "format_strikeout" );
- connect( m_textBold, SIGNAL(toggled(bool)), SLOT(setBold(bool)) );
- connect( m_textItalic, SIGNAL(toggled(bool)), SLOT(setItalic(bool)) );
- connect( m_textUnderline, SIGNAL(toggled(bool)), SLOT(setUnderline(bool)) );
- connect( m_textStrikeOut, SIGNAL(toggled(bool)), SLOT(textStrikeOut(bool)) );
+ connect( m_textBold, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setBold(bool)) );
+ connect( m_textItalic, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setItalic(bool)) );
+ connect( m_textUnderline, TQT_SIGNAL(toggled(bool)), TQT_SLOT(setUnderline(bool)) );
+ connect( m_textStrikeOut, TQT_SIGNAL(toggled(bool)), TQT_SLOT(textStrikeOut(bool)) );
m_textAlignLeft = new KToggleAction( i18n("Align Left"), "text_left", ALT + Key_L,
- this, SLOT(textAlignLeft()),
+ this, TQT_SLOT(textAlignLeft()),
actions, "format_alignleft" );
m_textAlignLeft->setChecked( true ); // just a dummy, will be updated later
m_textAlignCenter = new KToggleAction( i18n("Align Center"), "text_center", ALT + Key_C,
- this, SLOT(textAlignCenter()),
+ this, TQT_SLOT(textAlignCenter()),
actions, "format_aligncenter" );
m_textAlignRight = new KToggleAction( i18n("Align Right"), "text_right", ALT + Key_R,
- this, SLOT(textAlignRight()),
+ this, TQT_SLOT(textAlignRight()),
actions, "format_alignright" );
m_textAlignBlock = new KToggleAction( i18n("Align Block"), "text_block", ALT + Key_B,
- this, SLOT(textAlignBlock()),
+ this, TQT_SLOT(textAlignBlock()),
actions, "format_alignblock" );
m_textAlignLeft->setExclusiveGroup( "align" );
@@ -100,16 +100,16 @@ KNoteEdit::KNoteEdit( KActionCollection *actions, QWidget *parent, const char *n
m_textAlignBlock->setExclusiveGroup( "align" );
m_textList = new KToggleAction( i18n("List"), "enum_list", 0,
- this, SLOT(textList()),
+ this, TQT_SLOT(textList()),
actions, "format_list" );
m_textList->setExclusiveGroup( "style" );
m_textSuper = new KToggleAction( i18n("Superscript"), "text_super", 0,
- this, SLOT(textSuperScript()),
+ this, TQT_SLOT(textSuperScript()),
actions, "format_super" );
m_textSub = new KToggleAction( i18n("Subscript"), "text_sub", 0,
- this, SLOT(textSubScript()),
+ this, TQT_SLOT(textSubScript()),
actions, "format_sub" );
m_textSuper->setExclusiveGroup( "valign" );
@@ -118,53 +118,53 @@ KNoteEdit::KNoteEdit( KActionCollection *actions, QWidget *parent, const char *n
// There is no easy possibility to implement text indenting with QTextEdit
//
// m_textIncreaseIndent = new KAction( i18n("Increase Indent"), "format_increaseindent", 0,
-// this, SLOT(textIncreaseIndent()),
+// this, TQT_SLOT(textIncreaseIndent()),
// actions, "format_increaseindent" );
//
// m_textDecreaseIndent = new KAction( i18n("Decrease Indent"), "format_decreaseindent", 0,
-// this, SLOT(textDecreaseIndent()),
+// this, TQT_SLOT(textDecreaseIndent()),
// actions, "format_decreaseindent" );
- QPixmap pix( ICON_SIZE, ICON_SIZE );
+ TQPixmap pix( ICON_SIZE, ICON_SIZE );
pix.fill( black ); // just a dummy, gets updated before widget is shown
m_textColor = new KAction( i18n("Text Color..."), pix, 0, this,
- SLOT(textColor()), actions, "format_color" );
+ TQT_SLOT(textColor()), actions, "format_color" );
m_textFont = new KFontAction( i18n("Text Font"), "text", KKey(),
actions, "format_font" );
- connect( m_textFont, SIGNAL(activated( const QString & )),
- this, SLOT(setFamily( const QString & )) );
+ connect( m_textFont, TQT_SIGNAL(activated( const TQString & )),
+ this, TQT_SLOT(setFamily( const TQString & )) );
m_textSize = new KFontSizeAction( i18n("Text Size"), KKey(),
actions, "format_size" );
- connect( m_textSize, SIGNAL(fontSizeChanged( int )),
- this, SLOT(setPointSize( int )) );
-
- // QTextEdit connections
- connect( this, SIGNAL(returnPressed()), SLOT(slotReturnPressed()) );
- connect( this, SIGNAL(currentFontChanged( const QFont & )),
- this, SLOT(fontChanged( const QFont & )) );
- connect( this, SIGNAL(currentColorChanged( const QColor & )),
- this, SLOT(colorChanged( const QColor & )) );
- connect( this, SIGNAL(currentAlignmentChanged( int )),
- this, SLOT(alignmentChanged( int )) );
- connect( this, SIGNAL(currentVerticalAlignmentChanged( VerticalAlignment )),
- this, SLOT(verticalAlignmentChanged( VerticalAlignment )) );
+ connect( m_textSize, TQT_SIGNAL(fontSizeChanged( int )),
+ this, TQT_SLOT(setPointSize( int )) );
+
+ // TQTextEdit connections
+ connect( this, TQT_SIGNAL(returnPressed()), TQT_SLOT(slotReturnPressed()) );
+ connect( this, TQT_SIGNAL(currentFontChanged( const TQFont & )),
+ this, TQT_SLOT(fontChanged( const TQFont & )) );
+ connect( this, TQT_SIGNAL(currentColorChanged( const TQColor & )),
+ this, TQT_SLOT(colorChanged( const TQColor & )) );
+ connect( this, TQT_SIGNAL(currentAlignmentChanged( int )),
+ this, TQT_SLOT(alignmentChanged( int )) );
+ connect( this, TQT_SIGNAL(currentVerticalAlignmentChanged( VerticalAlignment )),
+ this, TQT_SLOT(verticalAlignmentChanged( VerticalAlignment )) );
}
KNoteEdit::~KNoteEdit()
{
}
-void KNoteEdit::setText( const QString& text )
+void KNoteEdit::setText( const TQString& text )
{
- // to update the font and font size combo box - QTextEdit stopped
+ // to update the font and font size combo box - TQTextEdit stopped
// emitting the currentFontChanged signal with the new optimizations
KTextEdit::setText( text );
fontChanged( currentFont() );
}
-void KNoteEdit::setTextFont( const QFont& font )
+void KNoteEdit::setTextFont( const TQFont& font )
{
if ( textFormat() == PlainText )
setFont( font );
@@ -172,7 +172,7 @@ void KNoteEdit::setTextFont( const QFont& font )
setCurrentFont( font );
}
-void KNoteEdit::setTextColor( const QColor& color )
+void KNoteEdit::setTextColor( const TQColor& color )
{
setColor( color );
colorChanged( color );
@@ -180,7 +180,7 @@ void KNoteEdit::setTextColor( const QColor& color )
void KNoteEdit::setTabStop( int tabs )
{
- QFontMetrics fm( font() );
+ TQFontMetrics fm( font() );
setTabStopWidth( fm.width( 'x' ) * tabs );
}
@@ -199,12 +199,12 @@ void KNoteEdit::setTextFormat( TextFormat f )
if ( f == RichText )
{
- QString t = text();
+ TQString t = text();
KTextEdit::setTextFormat( f );
// if the note contains html/xml source try to display it, otherwise
// get the modified text again and set it to preserve newlines
- if ( QStyleSheet::mightBeRichText( t ) )
+ if ( TQStyleSheet::mightBeRichText( t ) )
setText( t );
else
setText( text() );
@@ -214,7 +214,7 @@ void KNoteEdit::setTextFormat( TextFormat f )
else
{
KTextEdit::setTextFormat( f );
- QString t = text();
+ TQString t = text();
setText( t );
disableRichTextActions();
@@ -223,9 +223,9 @@ void KNoteEdit::setTextFormat( TextFormat f )
void KNoteEdit::textStrikeOut( bool s )
{
- // QTextEdit does not support stroke out text (no saving,
+ // TQTextEdit does not support stroke out text (no saving,
// no changing of more than one selected character)
- QFont font;
+ TQFont font;
if ( !hasSelectedText() )
{
@@ -269,9 +269,9 @@ void KNoteEdit::textStrikeOut( bool s )
void KNoteEdit::textColor()
{
- QColor c = color();
+ TQColor c = color();
int ret = KColorDialog::getColor( c, this );
- if ( ret == QDialog::Accepted )
+ if ( ret == TQDialog::Accepted )
setTextColor( c );
}
@@ -302,9 +302,9 @@ void KNoteEdit::textAlignBlock()
void KNoteEdit::textList()
{
if ( m_textList->isChecked() )
- setParagType( QStyleSheetItem::DisplayListItem, QStyleSheetItem::ListDisc );
+ setParagType( TQStyleSheetItem::DisplayListItem, TQStyleSheetItem::ListDisc );
else
- setParagType( QStyleSheetItem::DisplayBlock, QStyleSheetItem::ListDisc );
+ setParagType( TQStyleSheetItem::DisplayBlock, TQStyleSheetItem::ListDisc );
}
void KNoteEdit::textSuperScript()
@@ -334,7 +334,7 @@ void KNoteEdit::textSubScript()
/** protected methods **/
-void KNoteEdit::contentsDragEnterEvent( QDragEnterEvent *e )
+void KNoteEdit::contentsDragEnterEvent( TQDragEnterEvent *e )
{
if ( KURLDrag::canDecode( e ) )
e->accept();
@@ -342,7 +342,7 @@ void KNoteEdit::contentsDragEnterEvent( QDragEnterEvent *e )
KTextEdit::contentsDragEnterEvent( e );
}
-void KNoteEdit::contentsDropEvent( QDropEvent *e )
+void KNoteEdit::contentsDropEvent( TQDropEvent *e )
{
KURL::List list;
@@ -366,7 +366,7 @@ void KNoteEdit::slotReturnPressed()
autoIndent();
}
-void KNoteEdit::fontChanged( const QFont &f )
+void KNoteEdit::fontChanged( const TQFont &f )
{
m_textFont->setFont( f.family() );
m_textSize->setFontSize( f.pointSize() );
@@ -377,9 +377,9 @@ void KNoteEdit::fontChanged( const QFont &f )
m_textStrikeOut->setChecked( f.strikeOut() );
}
-void KNoteEdit::colorChanged( const QColor &c )
+void KNoteEdit::colorChanged( const TQColor &c )
{
- QPixmap pix( ICON_SIZE, ICON_SIZE );
+ TQPixmap pix( ICON_SIZE, ICON_SIZE );
pix.fill( c );
m_textColor->setIconSet( pix );
}
@@ -416,7 +416,7 @@ void KNoteEdit::verticalAlignmentChanged( VerticalAlignment a )
void KNoteEdit::autoIndent()
{
int para, index;
- QString string;
+ TQString string;
getCursorPosition( &para, &index );
while ( para > 0 && string.stripWhiteSpace().isEmpty() )
string = text( --para );
@@ -428,7 +428,7 @@ void KNoteEdit::autoIndent()
// character in string.
// It is assumed that string contains at least one non whitespace character
// ie \n \r \t \v \f and space
- QString indentString;
+ TQString indentString;
int len = string.length();
int i = 0;
@@ -439,7 +439,7 @@ void KNoteEdit::autoIndent()
insert( indentString );
}
-void KNoteEdit::emitLinkClicked( const QString &s )
+void KNoteEdit::emitLinkClicked( const TQString &s )
{
kdDebug(5500) << k_funcinfo << s << endl;
}