diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-25 05:28:35 +0000 |
commit | f008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch) | |
tree | 8e9244c4d4957c36be81e15b566b4aa5ea26c982 /lib/kotext/KoParagDia.cpp | |
parent | 1210f27b660efb7b37ff43ec68763e85a403471f (diff) | |
download | koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip |
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'lib/kotext/KoParagDia.cpp')
-rw-r--r-- | lib/kotext/KoParagDia.cpp | 756 |
1 files changed, 380 insertions, 376 deletions
diff --git a/lib/kotext/KoParagDia.cpp b/lib/kotext/KoParagDia.cpp index 589cfb80..02949bb0 100644 --- a/lib/kotext/KoParagDia.cpp +++ b/lib/kotext/KoParagDia.cpp @@ -36,72 +36,72 @@ #include <klocale.h> #include <knumvalidator.h> #include <KoGlobal.h> -#include <qgroupbox.h> +#include <tqgroupbox.h> #include <knuminput.h> #include <kdeversion.h> #include <kpushbutton.h> #include <kcombobox.h> -#include <qcheckbox.h> -#include <qcombobox.h> -#include <qhbuttongroup.h> -#include <qlabel.h> -#include <qradiobutton.h> -#include <qvbox.h> -#include <qhbox.h> -#include <qtooltip.h> -#include <qlayout.h> -#include <qapplication.h> -#include <qwidgetstack.h> - -KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTypeLetter, bool disableAll, QWidget * parent, const char* name ) - :QWidget( parent, name ), +#include <tqcheckbox.h> +#include <tqcombobox.h> +#include <tqhbuttongroup.h> +#include <tqlabel.h> +#include <tqradiobutton.h> +#include <tqvbox.h> +#include <tqhbox.h> +#include <tqtooltip.h> +#include <tqlayout.h> +#include <tqapplication.h> +#include <tqwidgetstack.h> + +KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTypeLetter, bool disableAll, TQWidget * tqparent, const char* name ) + :TQWidget( tqparent, name ), stylesList() { noSignals = true; styleBuffer = 999; - QVBoxLayout *vbox = new QVBoxLayout( this,0, 0/*KDialog::marginHint(), KDialog::spacingHint()*/ ); - gStyle = new QGroupBox( i18n( "St&yle" ), this, "styleLayout" ); + TQVBoxLayout *vbox = new TQVBoxLayout( this,0, 0/*KDialog::marginHint(), KDialog::spacingHint()*/ ); + gStyle = new TQGroupBox( i18n( "St&yle" ), this, "styleLayout" ); vbox->addWidget( gStyle); - QGridLayout * grid = new QGridLayout(gStyle, 12, 5, KDialog::marginHint(), KDialog::spacingHint()); + TQGridLayout * grid = new TQGridLayout(gStyle, 12, 5, KDialog::marginHint(), KDialog::spacingHint()); grid->addRowSpacing(0, fontMetrics().height()/2); makeCounterRepresenterList( stylesList, onlyStyleTypeLetter ); - lstStyle = new QListBox( gStyle, "styleListBox" ); + lstStyle = new TQListBox( gStyle, "styleListBox" ); grid->addMultiCellWidget( lstStyle, 1, 11, 0, 0); fillStyleCombo(); - connect( lstStyle, SIGNAL( selectionChanged() ), this, SLOT( numStyleChanged() ) ); + connect( lstStyle, TQT_SIGNAL( selectionChanged() ), this, TQT_SLOT( numStyleChanged() ) ); - QLabel *lPrefix = new QLabel( gStyle, "lPrefix" ); + TQLabel *lPrefix = new TQLabel( gStyle, "lPrefix" ); lPrefix->setText( i18n( "Pre&fix text:" ) ); grid->addWidget( lPrefix, 1, 1); - sPrefix = new QLineEdit( gStyle, "sPrefix" ); + sPrefix = new TQLineEdit( gStyle, "sPrefix" ); lPrefix->setBuddy( sPrefix ); grid->addWidget( sPrefix, 1, 2); - QLabel *lSuffix = new QLabel( gStyle, "lSuffix" ); + TQLabel *lSuffix = new TQLabel( gStyle, "lSuffix" ); lSuffix->setText( i18n( "Suffi&x text:" ) ); grid->addWidget( lSuffix, 1, 3); - sSuffix = new QLineEdit( gStyle, "sSuffix" ); + sSuffix = new TQLineEdit( gStyle, "sSuffix" ); lSuffix->setBuddy( sSuffix ); grid->addWidget( sSuffix, 1, 4 ); - lStart = new QLabel( gStyle, "lStart" ); + lStart = new TQLabel( gStyle, "lStart" ); lStart->setText( i18n( "&Start at:" ) ); grid->addWidget( lStart, 2, 1 ); - spnDepth = new QSpinBox( 0, 15, 1, gStyle ); + spnDepth = new TQSpinBox( 0, 15, 1, gStyle ); if ( displayDepth ) grid->addWidget( spnDepth, 3, 2 ); else spnDepth->hide(); - spnDisplayLevels = new QSpinBox( 0, 15, 1, gStyle ); + spnDisplayLevels = new TQSpinBox( 0, 15, 1, gStyle ); spnDisplayLevels->setMinValue( 1 ); if ( displayDepth ) grid->addWidget( spnDisplayLevels, 3, 4 ); @@ -109,27 +109,27 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp spnDisplayLevels->hide(); - QHBoxLayout *customCharBox = new QHBoxLayout(0, 0, 6); - lCustom = new QLabel( i18n( "Custo&m character:" ), gStyle, "custom char label" ); + TQHBoxLayout *customCharBox = new TQHBoxLayout(0, 0, 6); + lCustom = new TQLabel( i18n( "Custo&m character:" ), gStyle, "custom char label" ); customCharBox->addWidget( lCustom ); - bCustom = new QPushButton( "", gStyle, "bCustom" ); + bCustom = new TQPushButton( "", gStyle, "bCustom" ); lCustom->setBuddy( bCustom ); customCharBox->addWidget( bCustom ); - connect( bCustom, SIGNAL( clicked() ), this, SLOT( selectCustomBullet() ) ); + connect( bCustom, TQT_SIGNAL( clicked() ), this, TQT_SLOT( selectCustomBullet() ) ); - QSpacerItem* spacer_2 = new QSpacerItem( 0, 0, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer_2 = new TQSpacerItem( 0, 0, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); customCharBox->addItem( spacer_2 ); - grid->addMultiCellLayout(customCharBox, 4, 4, 1, 4, Qt::AlignLeft); + grid->addMultiCellLayout(customCharBox, 4, 4, 1, 4, TQt::AlignLeft); spnStart = new KoSpinBox( gStyle ); spnStart->setMinValue ( 1); lStart->setBuddy( spnStart ); grid->addWidget( spnStart, 2, 2); - lAlignment = new QLabel( gStyle, "lAlignment" ); - lAlignment->setText( i18n( "Counter alignment:" ) ); + lAlignment = new TQLabel( gStyle, "lAlignment" ); + lAlignment->setText( i18n( "Counter tqalignment:" ) ); grid->addWidget( lAlignment, 2, 3 ); cbAlignment = new KComboBox( gStyle, "cbAlignment" ); @@ -139,7 +139,7 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp cbAlignment->setCurrentItem(0); grid->addWidget( cbAlignment, 2, 4 ); - QLabel *lDepth = new QLabel( gStyle, "lDepth" ); + TQLabel *lDepth = new TQLabel( gStyle, "lDepth" ); lDepth->setText( i18n( "&Depth:" ) ); lDepth->setBuddy( spnDepth ); if ( displayDepth ) @@ -147,7 +147,7 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp else lDepth->hide(); - QLabel *lDisplayLevels = new QLabel( gStyle ); + TQLabel *lDisplayLevels = new TQLabel( gStyle ); lDisplayLevels->setText( i18n( "Display le&vels:" ) ); lDisplayLevels->setBuddy( spnDisplayLevels ); if ( displayDepth ) @@ -155,7 +155,7 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp else lDisplayLevels->hide(); - cbRestart = new QCheckBox( i18n( "&Restart numbering at this paragraph" ), gStyle ); + cbRestart = new TQCheckBox( i18n( "&Restart numbering at this paragraph" ), gStyle ); grid->addMultiCellWidget( cbRestart, 5, 5, 1, 3 ); if ( onlyStyleTypeLetter ) @@ -166,14 +166,14 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp } - connect( cbRestart, SIGNAL( toggled(bool) ), this, SLOT( restartChanged(bool) ) ); + connect( cbRestart, TQT_SIGNAL( toggled(bool) ), this, TQT_SLOT( restartChanged(bool) ) ); - connect( sSuffix, SIGNAL( textChanged (const QString &) ), this, SLOT( suffixChanged(const QString &) ) ); - connect( sPrefix, SIGNAL( textChanged (const QString &) ), this, SLOT( prefixChanged(const QString &) ) ); - connect( spnStart, SIGNAL( valueChanged (int) ), this, SLOT( startChanged(int) ) ); - connect( spnDepth, SIGNAL( valueChanged (int) ), this, SLOT( depthChanged(int) ) ); - connect( spnDisplayLevels, SIGNAL( valueChanged (int) ), this, SLOT( displayLevelsChanged(int) ) ); - connect( cbAlignment, SIGNAL( activated (const QString&) ), this, SLOT( alignmentChanged(const QString&) ) ); + connect( sSuffix, TQT_SIGNAL( textChanged (const TQString &) ), this, TQT_SLOT( suffixChanged(const TQString &) ) ); + connect( sPrefix, TQT_SIGNAL( textChanged (const TQString &) ), this, TQT_SLOT( prefixChanged(const TQString &) ) ); + connect( spnStart, TQT_SIGNAL( valueChanged (int) ), this, TQT_SLOT( startChanged(int) ) ); + connect( spnDepth, TQT_SIGNAL( valueChanged (int) ), this, TQT_SLOT( depthChanged(int) ) ); + connect( spnDisplayLevels, TQT_SIGNAL( valueChanged (int) ), this, TQT_SLOT( displayLevelsChanged(int) ) ); + connect( cbAlignment, TQT_SIGNAL( activated (const TQString&) ), this, TQT_SLOT( tqalignmentChanged(const TQString&) ) ); noSignals = false; if ( disableAll ) { @@ -192,21 +192,21 @@ KoCounterStyleWidget::KoCounterStyleWidget( bool displayDepth, bool onlyStyleTyp } } -void KoCounterStyleWidget::alignmentChanged(const QString& s) +void KoCounterStyleWidget::tqalignmentChanged(const TQString& s) { int a; if(s==i18n("Align Left")) - a=Qt::AlignLeft; + a=TQt::AlignLeft; else if(s==i18n("Align Right")) - a=Qt::AlignRight; + a=TQt::AlignRight; else if(s==i18n("Align Auto")) - a=Qt::AlignAuto; + a=TQt::AlignAuto; else { kdError()<<"Not Implemented"<<endl; return; } - m_counter.setAlignment(a); - emit sig_alignmentChanged(a); + m_counter.tqsetAlignment(a); + emit sig_tqalignmentChanged(a); } void KoCounterStyleWidget::setCounter( const KoParagCounter& counter ) @@ -253,7 +253,7 @@ void KoCounterStyleWidget::fillStyleCombo(KoParagCounter::Numbering type) { noSignals=true; unsigned int cur = lstStyle->currentItem(); lstStyle->clear(); - QPtrListIterator<StyleRepresenter> style( stylesList ); + TQPtrListIterator<StyleRepresenter> style( stylesList ); while ( style.current() ) { if(style.current()->style() == KoParagCounter::STYLE_NONE) { if(type == KoParagCounter::NUM_NONE) @@ -286,7 +286,7 @@ void KoCounterStyleWidget::displayStyle( KoParagCounter::Style style ) bCustom->setText( m_counter.customBulletCharacter() ); if ( !m_counter.customBulletFont().isEmpty() ) - bCustom->setFont( QFont( m_counter.customBulletFont() ) ); + bCustom->setFont( TQFont( m_counter.customBulletFont() ) ); sPrefix->setText( m_counter.prefix() ); sSuffix->setText( m_counter.suffix() ); @@ -296,11 +296,11 @@ void KoCounterStyleWidget::displayStyle( KoParagCounter::Style style ) spnStart->setValue( m_counter.startNumber() ); cbRestart->setChecked( m_counter.restartCounter() ); - if(m_counter.alignment()==Qt::AlignLeft) + if(m_counter.tqalignment()==TQt::AlignLeft) cbAlignment->setCurrentText(i18n("Align Left")); - else if(m_counter.alignment()==Qt::AlignRight) + else if(m_counter.tqalignment()==TQt::AlignRight) cbAlignment->setCurrentText(i18n("Align Right")); - else if(m_counter.alignment()==Qt::AlignAuto) + else if(m_counter.tqalignment()==TQt::AlignAuto) cbAlignment->setCurrentText(i18n("Align Auto")); else kdError()<<"Not Implemented"<<endl; @@ -336,7 +336,7 @@ void KoCounterStyleWidget::numTypeChanged( int nType ) { } -void KoCounterStyleWidget::makeCounterRepresenterList( QPtrList<StyleRepresenter>& stylesList, bool onlyStyleTypeLetter ) +void KoCounterStyleWidget::makeCounterRepresenterList( TQPtrList<StyleRepresenter>& stylesList, bool onlyStyleTypeLetter ) { stylesList.setAutoDelete( true ); stylesList.append( new StyleRepresenter(i18n( "Arabic Numbers" ) @@ -372,17 +372,17 @@ void KoCounterStyleWidget::selectCustomBullet() { ++i; lstStyle->setCurrentItem(i); - QString f = m_counter.customBulletFont(); + TQString f = m_counter.customBulletFont(); if ( f.isEmpty() ) f = "symbol"; - QChar c = m_counter.customBulletCharacter(); + TQChar c = m_counter.customBulletCharacter(); if ( KoCharSelectDia::selectChar( f, c ) ) { emit changeCustomBullet( f, c ); m_counter.setCustomBulletFont( f ); m_counter.setCustomBulletCharacter( c ); if ( !f.isEmpty() ) - bCustom->setFont( QFont( f ) ); + bCustom->setFont( TQFont( f ) ); bCustom->setText( c ); } } @@ -405,8 +405,8 @@ void KoCounterStyleWidget::numStyleChanged() { -KoSpinBox::KoSpinBox( QWidget * parent, const char * name ) - : QSpinBox(parent,name) +KoSpinBox::KoSpinBox( TQWidget * tqparent, const char * name ) + : TQSpinBox(tqparent,name) { m_Etype=NONE; //max value supported by roman number @@ -417,9 +417,9 @@ KoSpinBox::~KoSpinBox( ) } KoSpinBox::KoSpinBox( int minValue, int maxValue, int step , - QWidget * parent , const char * name ) - : QSpinBox(minValue, maxValue,step , - parent , name) + TQWidget * tqparent , const char * name ) + : TQSpinBox(minValue, maxValue,step , + tqparent , name) { m_Etype=NONE; } @@ -431,16 +431,16 @@ void KoSpinBox::setCounterType(counterType _type) } -QString KoSpinBox::mapValueToText( int value ) +TQString KoSpinBox::mapValueToText( int value ) { if(value==0 && m_Etype==NUM) - return QString("0"); + return TQString("0"); else if(value==0 && m_Etype!=NUM) - return QString::null; + return TQString(); switch(m_Etype) { case NUM: - return QString::number(value); + return TQString::number(value); case ALPHAB_L: return KoParagCounter::makeAlphaLowerNumber( value ); case ALPHAB_U: @@ -451,16 +451,16 @@ QString KoSpinBox::mapValueToText( int value ) return KoParagCounter::makeRomanNumber( value ).upper(); case NONE: default: - return QString::null; + return TQString(); } //never here - return QString::null; + return TQString(); } int KoSpinBox::mapTextToValue( bool * ok ) { int ret; - QString txt = text(); + TQString txt = text(); *ok = TRUE; switch(m_Etype) @@ -497,8 +497,8 @@ int KoSpinBox::mapTextToValue( bool * ok ) /* class KPagePreview */ /******************************************************************/ -KPagePreview::KPagePreview( QWidget* parent, const char* name ) - : QGroupBox( i18n( "Preview" ), parent, name ) +KPagePreview::KPagePreview( TQWidget* tqparent, const char* name ) + : TQGroupBox( i18n( "Preview" ), tqparent, name ) { left = 0; right = 0; @@ -508,7 +508,7 @@ KPagePreview::KPagePreview( QWidget* parent, const char* name ) after = 0; } -void KPagePreview::drawContents( QPainter* p ) +void KPagePreview::drawContents( TQPainter* p ) { int wid = 148; int hei = 210; @@ -524,32 +524,32 @@ void KPagePreview::drawContents( QPainter* p ) int spc = convert(spacing); // draw page - p->setPen( QPen( black ) ); - p->setBrush( QBrush( black ) ); + p->setPen( TQPen( black ) ); + p->setBrush( TQBrush( black ) ); p->drawRect( _x + 1, _y + 1, wid, hei ); - p->setBrush( QBrush( white ) ); + p->setBrush( TQBrush( white ) ); p->drawRect( _x, _y, wid, hei ); // draw parags p->setPen( NoPen ); - p->setBrush( QBrush( lightGray ) ); + p->setBrush( TQBrush( lightGray ) ); for ( int i = 1; i <= 4; i++ ) p->drawRect( _x + 6, _y + 6 + ( i - 1 ) * 12 + 2, wid - 12 - ( ( i / 4 ) * 4 == i ? 50 : 0 ), 6 ); - p->setBrush( QBrush( darkGray ) ); + p->setBrush( TQBrush( darkGray ) ); for ( int i = 5; i <= 8; i++ ) { - QRect rect( ( i == 5 ? df : dl ) + _x + 6, _y + 6 + ( i - 1 ) * 12 + 2 + ( i - 5 ) * spc + static_cast<int>( before / 2 ), + TQRect rect( ( i == 5 ? df : dl ) + _x + 6, _y + 6 + ( i - 1 ) * 12 + 2 + ( i - 5 ) * spc + static_cast<int>( before / 2 ), wid - 12 - ( ( i / 4 ) * 4 == i ? 50 : 0 ) - ( ( i == 12 ? 0 : dr ) + ( i == 5 ? df : dl ) ), 6); if(rect.width ()>=0) p->drawRect( rect ); } - p->setBrush( QBrush( lightGray ) ); + p->setBrush( TQBrush( lightGray ) ); for ( int i = 9; i <= 12; i++ ) p->drawRect( _x + 6, _y + 6 + ( i - 1 ) * 12 + 2 + 3 * spc + @@ -571,13 +571,13 @@ int KPagePreview::convert(double input) { /* class KPagePreview2 */ /******************************************************************/ -KPagePreview2::KPagePreview2( QWidget* parent, const char* name ) - : QGroupBox( i18n( "Preview" ), parent, name ) +KPagePreview2::KPagePreview2( TQWidget* tqparent, const char* name ) + : TQGroupBox( i18n( "Preview" ), tqparent, name ) { - align = Qt::AlignLeft; + align = TQt::AlignLeft; } -void KPagePreview2::drawContents( QPainter* p ) +void KPagePreview2::drawContents( TQPainter* p ) { int wid = 148; int hei = 210; @@ -585,22 +585,22 @@ void KPagePreview2::drawContents( QPainter* p ) int _y = ( height() - hei ) / 2; // draw page - p->setPen( QPen( black ) ); - p->setBrush( QBrush( black ) ); + p->setPen( TQPen( black ) ); + p->setBrush( TQBrush( black ) ); p->drawRect( _x + 1, _y + 1, wid, hei ); - p->setBrush( QBrush( white ) ); + p->setBrush( TQBrush( white ) ); p->drawRect( _x, _y, wid, hei ); // draw parags p->setPen( NoPen ); - p->setBrush( QBrush( lightGray ) ); + p->setBrush( TQBrush( lightGray ) ); for ( int i = 1; i <= 4; i++ ) p->drawRect( _x + 6, _y + 6 + ( i - 1 ) * 12 + 2, wid - 12 - ( ( i / 4 ) * 4 == i ? 50 : 0 ), 6 ); - p->setBrush( QBrush( darkGray ) ); + p->setBrush( TQBrush( darkGray ) ); int __x = 0, __w = 0; for ( int i = 5; i <= 8; i++ ) { @@ -616,17 +616,19 @@ void KPagePreview2::drawContents( QPainter* p ) } switch ( align ) { - case Qt::AlignAuto: - case Qt::AlignLeft: +#ifndef USE_QT4 + case TQt::AlignAuto: +#endif // USE_QT4 + case TQt::AlignLeft: __x = _x + 6; break; - case Qt::AlignHCenter: + case TQt::AlignHCenter: __x = _x + ( wid - __w ) / 2; break; - case Qt::AlignRight: + case TQt::AlignRight: __x = _x + ( wid - __w ) - 6; break; - case Qt::AlignJustify: + case TQt::AlignJustify: { if ( i < 8 ) __w = wid - 12; __x = _x + 6; @@ -636,7 +638,7 @@ void KPagePreview2::drawContents( QPainter* p ) p->drawRect( __x, _y + 6 + ( i - 1 ) * 12 + 2 + ( i - 5 ), __w, 6 ); } - p->setBrush( QBrush( lightGray ) ); + p->setBrush( TQBrush( lightGray ) ); for ( int i = 9; i <= 12; i++ ) p->drawRect( _x + 6, _y + 6 + ( i - 1 ) * 12 + 2 + 3, wid - 12 - ( ( i / 4 ) * 4 == i ? 50 : 0 ), 6 ); @@ -648,12 +650,12 @@ void KPagePreview2::drawContents( QPainter* p ) /******************************************************************/ -KoBorderPreview::KoBorderPreview( QWidget* parent, const char* name ) - :QFrame(parent,name) +KoBorderPreview::KoBorderPreview( TQWidget* tqparent, const char* name ) + :TQFrame(tqparent,name) { } -void KoBorderPreview::mousePressEvent( QMouseEvent *_ev ) +void KoBorderPreview::mousePressEvent( TQMouseEvent *_ev ) { emit choosearea(_ev); } @@ -678,10 +680,10 @@ void KoBorderPreview::setBorder( KoBorder::BorderType which, const KoBorder& bor } } -void KoBorderPreview::drawContents( QPainter* painter ) +void KoBorderPreview::drawContents( TQPainter* painter ) { - QRect r = contentsRect(); - QFontMetrics fm( font() ); + TQRect r = contentsRect(); + TQFontMetrics fm( font() ); painter->fillRect( r.x() + fm.width( 'W' ), r.y() + fm.height(), r.width() - 2 * fm.width( 'W' ), r.height() - 2 * fm.height(), white ); @@ -738,35 +740,35 @@ void KoBorderPreview::drawContents( QPainter* painter ) } } -QPen KoBorderPreview::setBorderPen( KoBorder _brd ) +TQPen KoBorderPreview::setBorderPen( KoBorder _brd ) { - QPen pen( black, 1, SolidLine ); + TQPen pen( black, 1, SolidLine ); pen.setWidth( static_cast<int>( _brd.penWidth() ) ); pen.setColor( _brd.color ); switch ( _brd.getStyle() ) { case KoBorder::SOLID: - pen.setStyle( SolidLine ); + pen.setStyle( Qt::SolidLine ); break; case KoBorder::DASH: - pen.setStyle( DashLine ); + pen.setStyle( Qt::DashLine ); break; case KoBorder::DOT: - pen.setStyle( DotLine ); + pen.setStyle( Qt::DotLine ); break; case KoBorder::DASH_DOT: - pen.setStyle( DashDotLine ); + pen.setStyle( Qt::DashDotLine ); break; case KoBorder::DASH_DOT_DOT: - pen.setStyle( DashDotDotLine ); + pen.setStyle( Qt::DashDotDotLine ); break; case KoBorder::DOUBLE_LINE: - pen.setStyle( SolidLine ); + pen.setStyle( Qt::SolidLine ); break; } - return QPen( pen ); + return TQPen( pen ); } /******************************************************************/ @@ -774,25 +776,25 @@ QPen KoBorderPreview::setBorderPen( KoBorder _brd ) /******************************************************************/ class MyFlow : public KoTextFlow { public: - MyFlow(QWidget *parent, KoTextZoomHandler *zoom) { - m_parent = parent; + MyFlow(TQWidget *tqparent, KoTextZoomHandler *zoom) { + m_parent = tqparent; m_zoomHandler = zoom; } int availableHeight() const { return m_zoomHandler->pixelToLayoutUnitY(m_parent->height()); } private: - QWidget *m_parent; + TQWidget *m_parent; KoTextZoomHandler *m_zoomHandler; }; -KoStylePreview::KoStylePreview( const QString& title, const QString& text, QWidget* parent, const char* name ) - : QGroupBox( title, parent, name ) +KoStylePreview::KoStylePreview( const TQString& title, const TQString& text, TQWidget* tqparent, const char* name ) + : TQGroupBox( title, tqparent, name ) { setMinimumHeight(80); m_zoomHandler = new KoTextZoomHandler; - QFont font = KoGlobal::defaultFont(); - m_textdoc = new KoTextDocument( m_zoomHandler, new KoTextFormatCollection( font, QColor(), KGlobal::locale()->language(), false ) ); + TQFont font = KoGlobal::defaultFont(); + m_textdoc = new KoTextDocument( m_zoomHandler, new KoTextFormatCollection( font, TQColor(), KGlobal::locale()->language(), false ) ); m_textdoc->setFlow( new MyFlow(this, m_zoomHandler) ); //m_textdoc->setWidth( KoTextZoomHandler::ptToLayoutUnitPt( 1000 ) ); @@ -810,26 +812,26 @@ void KoStylePreview::setCounter( const KoParagCounter & counter ) { KoTextParag * parag = m_textdoc->firstParag(); parag->setCounter( counter ); - repaint( true ); + tqrepaint( true ); } void KoStylePreview::setStyle( KoParagStyle * style ) { KoTextParag * parag = m_textdoc->firstParag(); parag->applyStyle( style ); - repaint(true); + tqrepaint(true); } -void KoStylePreview::drawContents( QPainter *painter ) +void KoStylePreview::drawContents( TQPainter *painter ) { painter->save(); - QRect r = contentsRect(); + TQRect r = contentsRect(); //kdDebug(32500) << "KoStylePreview::drawContents contentsRect=" << DEBUGRECT(r) << endl; - QRect whiteRect( r.x() + 10, r.y() + 10, + TQRect whiteRect( r.x() + 10, r.y() + 10, r.width() - 20, r.height() - 20 ); - QColorGroup cg = QApplication::palette().active(); - painter->fillRect( whiteRect, cg.brush( QColorGroup::Base ) ); + TQColorGroup cg = TQApplication::tqpalette().active(); + painter->fillRect( whiteRect, cg.brush( TQColorGroup::Base ) ); KoTextParag * parag = m_textdoc->firstParag(); int widthLU = m_zoomHandler->pixelToLayoutUnitX( whiteRect.width() - 2 ); // keep one pixel border horizontally @@ -837,14 +839,14 @@ void KoStylePreview::drawContents( QPainter *painter ) { // For centering to work, and to even get word wrapping when the thing is too big :) m_textdoc->setWidth( widthLU ); - parag->invalidate(0); + parag->tqinvalidate(0); } parag->format(); - QRect textRect = parag->pixelRect( m_zoomHandler ); + TQRect textRect = parag->pixelRect( m_zoomHandler ); - // Center vertically, but not horizontally, to keep the parag alignment working, - textRect.moveTopLeft( QPoint( whiteRect.x(), + // Center vertically, but not horizontally, to keep the parag tqalignment working, + textRect.moveTopLeft( TQPoint( whiteRect.x(), whiteRect.y() + ( whiteRect.height() - textRect.height() ) / 2 ) ); // Move it from the left border a little textRect.rLeft() += 4; @@ -858,13 +860,13 @@ void KoStylePreview::drawContents( QPainter *painter ) painter->restore(); } -KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameWidth,QWidget * parent, const char * name ) - : KoParagLayoutWidget( KoParagDia::PD_SPACING, parent, name ), m_unit( unit ) +KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameWidth,TQWidget * tqparent, const char * name ) + : KoParagLayoutWidget( KoParagDia::PD_SPACING, tqparent, name ), m_unit( unit ) { - QString unitName = KoUnit::unitName( m_unit ); - QGridLayout *mainGrid = new QGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); + TQString unitName = KoUnit::unitName( m_unit ); + TQGridLayout *mainGrid = new TQGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); - // mainGrid gives equal space to each groupbox, apparently + // mainGrid gives equal space to each groupbox, aptqparently // I tried setRowStretch but the result is awful (much space between them and not equal!) // Any other way (in order to make the 2nd, the one with a single checkbox, a bit // smaller than the other 3) ? (DF) @@ -872,51 +874,51 @@ KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameW // --------------- indent --------------- double frameWidth=_frameWidth; - QString length; + TQString length; if(frameWidth==-1) { frameWidth=9999; } else { length=i18n("Frame width: %1 %2") - .arg(KoUnit::toUserStringValue(frameWidth,m_unit)) - .arg(KoUnit::unitName(m_unit)); + .tqarg(KoUnit::toUserStringValue(frameWidth,m_unit)) + .tqarg(KoUnit::unitName(m_unit)); frameWidth=KoUnit::toUserValue(frameWidth,m_unit); } - QGroupBox * indentFrame = new QGroupBox( i18n( "Indent" ), this ); - QGridLayout * indentGrid = new QGridLayout( indentFrame, 5, 2, KDialog::marginHint(), KDialog::spacingHint() ); + TQGroupBox * indentFrame = new TQGroupBox( i18n( "Indent" ), this ); + TQGridLayout * indentGrid = new TQGridLayout( indentFrame, 5, 2, KDialog::marginHint(), KDialog::spacingHint() ); - QLabel * lLimit = new QLabel(length , indentFrame ); + TQLabel * lLimit = new TQLabel(length , indentFrame ); if(frameWidth!=-1) { - lLimit->setAlignment( AlignRight ); + lLimit->tqsetAlignment( AlignRight ); indentGrid->addWidget( lLimit, 1,0 ); } - QLabel * lLeft = new QLabel( i18n("&Left:"), indentFrame ); - lLeft->setAlignment( Qt::AlignVCenter | Qt::AlignRight ); + TQLabel * lLeft = new TQLabel( i18n("&Left:"), indentFrame ); + lLeft->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight ); indentGrid->addWidget( lLeft, 1, 0 ); eLeft = new KoUnitDoubleSpinBox( indentFrame, 0, 9999, 1, 0.0, m_unit ); lLeft->setBuddy( eLeft ); indentGrid->addWidget( eLeft, 1, 1 ); - connect( eLeft, SIGNAL( valueChangedPt(double ) ), this, SLOT( leftChanged( double ) ) ); + connect( eLeft, TQT_SIGNAL( valueChangedPt(double ) ), this, TQT_SLOT( leftChanged( double ) ) ); - QLabel * lRight = new QLabel( i18n("&Right:"), indentFrame ); - lRight->setAlignment( Qt::AlignVCenter | Qt::AlignRight ); + TQLabel * lRight = new TQLabel( i18n("&Right:"), indentFrame ); + lRight->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight ); indentGrid->addWidget( lRight, 2, 0 ); eRight = new KoUnitDoubleSpinBox( indentFrame, 0, 9999, 1, 0.0, m_unit ); lRight->setBuddy( eRight ); indentGrid->addWidget( eRight, 2, 1 ); - connect( eRight, SIGNAL( valueChangedPt( double ) ), this, SLOT( rightChanged( double ) ) ); + connect( eRight, TQT_SIGNAL( valueChangedPt( double ) ), this, TQT_SLOT( rightChanged( double ) ) ); - QLabel * lFirstLine = new QLabel( i18n("&First line:"), indentFrame ); - lFirstLine->setAlignment( Qt::AlignVCenter | Qt::AlignRight ); + TQLabel * lFirstLine = new TQLabel( i18n("&First line:"), indentFrame ); + lFirstLine->tqsetAlignment( TQt::AlignVCenter | TQt::AlignRight ); indentGrid->addWidget( lFirstLine, 3, 0 ); eFirstLine = new KoUnitDoubleSpinBox( indentFrame, -9999, 9999, 1, 0.0, m_unit ); lFirstLine->setBuddy( eFirstLine ); - connect( eFirstLine, SIGNAL( valueChangedPt( double ) ), this, SLOT( firstChanged( double ) ) ); + connect( eFirstLine, TQT_SIGNAL( valueChangedPt( double ) ), this, TQT_SLOT( firstChanged( double ) ) ); indentGrid->addWidget( eFirstLine, 3, 1 ); // grid row spacing @@ -926,33 +928,33 @@ KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameW mainGrid->addWidget( indentFrame, 0, 0 ); // --------------- line spacing --------------- - QGroupBox * spacingFrame = new QGroupBox( i18n( "Line &Spacing" ), this, "spacingFrame" ); - QGridLayout * spacingGrid = new QGridLayout( spacingFrame, 2, 1, + TQGroupBox * spacingFrame = new TQGroupBox( i18n( "Line &Spacing" ), this, "spacingFrame" ); + TQGridLayout * spacingGrid = new TQGridLayout( spacingFrame, 2, 1, KDialog::marginHint(), KDialog::spacingHint() ); - cSpacing = new QComboBox( false, spacingFrame, "" ); + cSpacing = new TQComboBox( false, spacingFrame, "" ); // Keep order in sync with lineSpacingType() and display() cSpacing->insertItem( i18n( "Line spacing value", "Single" ) ); cSpacing->insertItem( i18n( "Line spacing value", "1.5 Lines" ) ); cSpacing->insertItem( i18n( "Line spacing value", "Double" ) ); cSpacing->insertItem( i18n( "Proportional") ); // LS_MULTIPLE, called Proportional like in OO - cSpacing->insertItem( i18n( "Line Distance (%1)" ).arg(unitName) ); // LS_CUSTOM - cSpacing->insertItem( i18n( "At Least (%1)" ).arg(unitName) ); - cSpacing->insertItem( i18n( "Fixed (%1)").arg(unitName) ); // LS_FIXED + cSpacing->insertItem( i18n( "Line Distance (%1)" ).tqarg(unitName) ); // LS_CUSTOM + cSpacing->insertItem( i18n( "At Least (%1)" ).tqarg(unitName) ); + cSpacing->insertItem( i18n( "Fixed (%1)").tqarg(unitName) ); // LS_FIXED - connect( cSpacing, SIGNAL( activated( int ) ), this, SLOT( spacingActivated( int ) ) ); + connect( cSpacing, TQT_SIGNAL( activated( int ) ), this, TQT_SLOT( spacingActivated( int ) ) ); spacingGrid->addWidget( cSpacing, 1, 0 ); - sSpacingStack = new QWidgetStack( spacingFrame ); + sSpacingStack = new TQWidgetStack( spacingFrame ); eSpacing = new KoUnitDoubleSpinBox( spacingFrame, 0, 9999, CM_TO_POINT(1), 0.0, m_unit ); eSpacing->setRange( 0, 9999, 1, false); - connect( eSpacing, SIGNAL( valueChanged( double ) ), this, SLOT( spacingChanged( double ) ) ); + connect( eSpacing, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SLOT( spacingChanged( double ) ) ); eSpacingPercent = new KIntNumInput( 100, spacingFrame ); eSpacingPercent->setRange( 0, 1000, 10, false ); eSpacingPercent->setSuffix( " %" ); - connect( eSpacingPercent, SIGNAL( valueChanged( int ) ), this, SLOT( spacingChanged( int ) ) ); + connect( eSpacingPercent, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( spacingChanged( int ) ) ); sSpacingStack->addWidget( eSpacing ); sSpacingStack->addWidget( eSpacingPercent ); @@ -967,26 +969,26 @@ KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameW eSpacing->setEnabled( true ); // --------------- paragraph spacing --------------- - QGroupBox * pSpaceFrame = new QGroupBox( i18n( "Para&graph Space" ), this, "pSpaceFrame" ); - QGridLayout * pSpaceGrid = new QGridLayout( pSpaceFrame, 3, 2, + TQGroupBox * pSpaceFrame = new TQGroupBox( i18n( "Para&graph Space" ), this, "pSpaceFrame" ); + TQGridLayout * pSpaceGrid = new TQGridLayout( pSpaceFrame, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); - QLabel * lBefore = new QLabel( i18n("Before:"), pSpaceFrame ); - lBefore->setAlignment( AlignRight ); + TQLabel * lBefore = new TQLabel( i18n("Before:"), pSpaceFrame ); + lBefore->tqsetAlignment( AlignRight ); pSpaceGrid->addWidget( lBefore, 1, 0 ); eBefore = new KoUnitDoubleSpinBox( pSpaceFrame, 0, 9999, CM_TO_POINT(1), 0.0, m_unit ); eBefore->setRange( 0 , 9999, 1, false); - connect( eBefore, SIGNAL( valueChanged( double ) ), this, SLOT( beforeChanged( double ) ) ); + connect( eBefore, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SLOT( beforeChanged( double ) ) ); pSpaceGrid->addWidget( eBefore, 1, 1 ); - QLabel * lAfter = new QLabel( i18n("After:"), pSpaceFrame ); - lAfter->setAlignment( AlignRight ); + TQLabel * lAfter = new TQLabel( i18n("After:"), pSpaceFrame ); + lAfter->tqsetAlignment( AlignRight ); pSpaceGrid->addWidget( lAfter, 2, 0 ); eAfter = new KoUnitDoubleSpinBox( pSpaceFrame, 0, 9999, 1, 0.0, m_unit ); eAfter->setRange( 0, 9999, 1, false); - connect( eAfter, SIGNAL( valueChanged( double ) ), this, SLOT( afterChanged( double ) ) ); + connect( eAfter, TQT_SIGNAL( valueChanged( double ) ), this, TQT_SLOT( afterChanged( double ) ) ); pSpaceGrid->addWidget( eAfter, 2, 1 ); // grid row spacing @@ -1005,12 +1007,12 @@ KoIndentSpacingWidget::KoIndentSpacingWidget( KoUnit::Unit unit, double _frameW double KoIndentSpacingWidget::leftIndent() const { - return QMAX(0, eLeft->value() ); + return TQMAX(0, eLeft->value() ); } double KoIndentSpacingWidget::rightIndent() const { - return QMAX(0,eRight->value() ); + return TQMAX(0,eRight->value() ); } double KoIndentSpacingWidget::firstLineIndent() const @@ -1020,12 +1022,12 @@ double KoIndentSpacingWidget::firstLineIndent() const double KoIndentSpacingWidget::spaceBeforeParag() const { - return QMAX(0, eBefore->value() ); + return TQMAX(0, eBefore->value() ); } double KoIndentSpacingWidget::spaceAfterParag() const { - return QMAX(0, eAfter->value() ); + return TQMAX(0, eAfter->value() ); } KoParagLayout::SpacingType KoIndentSpacingWidget::lineSpacingType() const @@ -1055,31 +1057,31 @@ KoParagLayout::SpacingType KoIndentSpacingWidget::lineSpacingType() const double KoIndentSpacingWidget::lineSpacing() const { return (lineSpacingType() == KoParagLayout::LS_MULTIPLE) - ? QMAX( 1, eSpacingPercent->value() ) / 100.0 - : QMAX( 0, eSpacing->value() ); + ? TQMAX( 1, eSpacingPercent->value() ) / 100.0 + : TQMAX( 0, eSpacing->value() ); } void KoIndentSpacingWidget::display( const KoParagLayout & lay ) { - double _left = lay.margins[QStyleSheetItem::MarginLeft]; + double _left = lay.margins[TQStyleSheetItem::MarginLeft]; eLeft->changeValue( _left ); //prev1->setLeft( _left ); done by leftChanged() below leftChanged( _left ); // sets min value for eFirstLine - double _right = lay.margins[QStyleSheetItem::MarginRight]; + double _right = lay.margins[TQStyleSheetItem::MarginRight]; eRight->changeValue( _right ); prev1->setRight( _right ); - double _first = lay.margins[QStyleSheetItem::MarginFirstLine]; + double _first = lay.margins[TQStyleSheetItem::MarginFirstLine]; eFirstLine->changeValue( _first ); prev1->setFirst( _first ); - double _before = lay.margins[QStyleSheetItem::MarginTop]; + double _before = lay.margins[TQStyleSheetItem::MarginTop]; eBefore->changeValue( _before ); prev1->setBefore( _before ); - double _after = lay.margins[QStyleSheetItem::MarginBottom]; + double _after = lay.margins[TQStyleSheetItem::MarginBottom]; eAfter->changeValue( _after ); prev1->setAfter( _after ); @@ -1113,23 +1115,23 @@ void KoIndentSpacingWidget::display( const KoParagLayout & lay ) } updateLineSpacing( _type ); - eSpacing->setValue( (_type == KoParagLayout::LS_MULTIPLE) ? QMAX( 1, _spacing ) + eSpacing->setValue( (_type == KoParagLayout::LS_MULTIPLE) ? TQMAX( 1, _spacing ) : KoUnit::toUserValue( _spacing, m_unit ) ); - eSpacingPercent->setValue( ( _type == KoParagLayout::LS_MULTIPLE ) ? qRound( _spacing * 100 ) : 100 ); + eSpacingPercent->setValue( ( _type == KoParagLayout::LS_MULTIPLE ) ? tqRound( _spacing * 100 ) : 100 ); } void KoIndentSpacingWidget::save( KoParagLayout & lay ) { lay.setLineSpacingValue(lineSpacing()); lay.lineSpacingType = lineSpacingType(); - lay.margins[QStyleSheetItem::MarginLeft] = leftIndent(); - lay.margins[QStyleSheetItem::MarginRight] = rightIndent(); - lay.margins[QStyleSheetItem::MarginFirstLine] = firstLineIndent(); - lay.margins[QStyleSheetItem::MarginTop] = spaceBeforeParag(); - lay.margins[QStyleSheetItem::MarginBottom] = spaceAfterParag(); + lay.margins[TQStyleSheetItem::MarginLeft] = leftIndent(); + lay.margins[TQStyleSheetItem::MarginRight] = rightIndent(); + lay.margins[TQStyleSheetItem::MarginFirstLine] = firstLineIndent(); + lay.margins[TQStyleSheetItem::MarginTop] = spaceBeforeParag(); + lay.margins[TQStyleSheetItem::MarginBottom] = spaceAfterParag(); } -QString KoIndentSpacingWidget::tabName() +TQString KoIndentSpacingWidget::tabName() { return i18n( "Indent && S&pacing" ); } @@ -1138,7 +1140,7 @@ void KoIndentSpacingWidget::leftChanged( double val ) { prev1->setLeft( val ); // The minimum first-line margin is -leftMargin() (where leftMargin>=0) - eFirstLine->setMinValue( -QMAX( 0, val ) ); + eFirstLine->setMinValue( -TQMAX( 0, val ) ); } void KoIndentSpacingWidget::rightChanged( double val ) @@ -1203,24 +1205,24 @@ void KoIndentSpacingWidget::afterChanged( double _val ) } -KoParagAlignWidget::KoParagAlignWidget( bool breakLine, QWidget * parent, const char * name ) - : KoParagLayoutWidget( KoParagDia::PD_ALIGN, parent, name ) +KoParagAlignWidget::KoParagAlignWidget( bool breakLine, TQWidget * tqparent, const char * name ) + : KoParagLayoutWidget( KoParagDia::PD_ALIGN, tqparent, name ) { - QGridLayout *grid = new QGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout *grid = new TQGridLayout( this, 3, 2, KDialog::marginHint(), KDialog::spacingHint() ); - QVGroupBox * AlignGroup = new QVGroupBox( i18n( "Alignment" ), this ); + TQVGroupBox * AlignGroup = new TQVGroupBox( i18n( "Alignment" ), this ); - rLeft = new QRadioButton( i18n( "&Left" ), AlignGroup ); - connect( rLeft, SIGNAL( clicked() ), this, SLOT( alignLeft() ) ); + rLeft = new TQRadioButton( i18n( "&Left" ), AlignGroup ); + connect( rLeft, TQT_SIGNAL( clicked() ), this, TQT_SLOT( alignLeft() ) ); - rCenter = new QRadioButton( i18n( "C&enter" ), AlignGroup ); - connect( rCenter, SIGNAL( clicked() ), this, SLOT( alignCenter() ) ); + rCenter = new TQRadioButton( i18n( "C&enter" ), AlignGroup ); + connect( rCenter, TQT_SIGNAL( clicked() ), this, TQT_SLOT( alignCenter() ) ); - rRight = new QRadioButton( i18n( "&Right" ), AlignGroup ); - connect( rRight, SIGNAL( clicked() ), this, SLOT( alignRight() ) ); + rRight = new TQRadioButton( i18n( "&Right" ), AlignGroup ); + connect( rRight, TQT_SIGNAL( clicked() ), this, TQT_SLOT( alignRight() ) ); - rJustify = new QRadioButton( i18n( "&Justify" ), AlignGroup ); - connect( rJustify, SIGNAL( clicked() ), this, SLOT( alignJustify() ) ); + rJustify = new TQRadioButton( i18n( "&Justify" ), AlignGroup ); + connect( rJustify, TQT_SIGNAL( clicked() ), this, TQT_SLOT( alignJustify() ) ); clearAligns(); rLeft->setChecked( true ); @@ -1228,15 +1230,15 @@ KoParagAlignWidget::KoParagAlignWidget( bool breakLine, QWidget * parent, const grid->addWidget(AlignGroup, 0, 0); // --------------- End of page /frame --------------- - QGroupBox * endFramePage = new QGroupBox( i18n( "Behavior at &End of Frame/Page" ), this ); - QGridLayout * endFramePageGrid = new QGridLayout( endFramePage, 4, 1, + TQGroupBox * endFramePage = new TQGroupBox( i18n( "Behavior at &End of Frame/Page" ), this ); + TQGridLayout * endFramePageGrid = new TQGridLayout( endFramePage, 4, 1, KDialog::marginHint(), KDialog::spacingHint() ); - cKeepLinesTogether = new QCheckBox( i18n("&Keep lines together"),endFramePage); + cKeepLinesTogether = new TQCheckBox( i18n("&Keep lines together"),endFramePage); endFramePageGrid->addWidget( cKeepLinesTogether, 1, 0 ); - cHardBreakBefore = new QCheckBox( i18n("Insert break before paragraph"),endFramePage); + cHardBreakBefore = new TQCheckBox( i18n("Insert break before paragraph"),endFramePage); endFramePageGrid->addWidget( cHardBreakBefore, 2, 0 ); - cHardBreakAfter = new QCheckBox( i18n("Insert break after paragraph"),endFramePage); + cHardBreakAfter = new TQCheckBox( i18n("Insert break after paragraph"),endFramePage); endFramePageGrid->addWidget( cHardBreakAfter, 3, 0 ); endFramePageGrid->addRowSpacing( 0, fontMetrics().height() / 2 ); // groupbox title @@ -1271,22 +1273,24 @@ int KoParagAlignWidget::pageBreaking() const void KoParagAlignWidget::display( const KoParagLayout & lay ) { - int align = lay.alignment; + int align = lay.tqalignment; prev2->setAlign( align ); clearAligns(); switch ( align ) { - case Qt::AlignAuto: // see KoView::setAlign - case Qt::AlignLeft: +#ifndef USE_QT4 + case TQt::AlignAuto: // see KoView::setAlign +#endif // USE_QT4 + case TQt::AlignLeft: rLeft->setChecked( true ); break; - case Qt::AlignHCenter: + case TQt::AlignHCenter: rCenter->setChecked( true ); break; - case Qt::AlignRight: + case TQt::AlignRight: rRight->setChecked( true ); break; - case Qt::AlignJustify: + case TQt::AlignJustify: rJustify->setChecked( true ); } @@ -1298,49 +1302,49 @@ void KoParagAlignWidget::display( const KoParagLayout & lay ) void KoParagAlignWidget::save( KoParagLayout & lay ) { - lay.alignment = align(); + lay.tqalignment = align(); lay.pageBreaking = pageBreaking(); } int KoParagAlignWidget::align() const { - if ( rLeft->isChecked() ) return Qt::AlignLeft; - else if ( rCenter->isChecked() ) return Qt::AlignHCenter; - else if ( rRight->isChecked() ) return Qt::AlignRight; - else if ( rJustify->isChecked() ) return Qt::AlignJustify; + if ( rLeft->isChecked() ) return TQt::AlignLeft; + else if ( rCenter->isChecked() ) return TQt::AlignHCenter; + else if ( rRight->isChecked() ) return TQt::AlignRight; + else if ( rJustify->isChecked() ) return TQt::AlignJustify; - return Qt::AlignLeft; + return TQt::AlignLeft; } -QString KoParagAlignWidget::tabName() +TQString KoParagAlignWidget::tabName() { return i18n( "General &Layout" ); } void KoParagAlignWidget::alignLeft() { - prev2->setAlign( Qt::AlignLeft ); + prev2->setAlign( TQt::AlignLeft ); clearAligns(); rLeft->setChecked( true ); } void KoParagAlignWidget::alignCenter() { - prev2->setAlign( Qt::AlignHCenter ); + prev2->setAlign( TQt::AlignHCenter ); clearAligns(); rCenter->setChecked( true ); } void KoParagAlignWidget::alignRight() { - prev2->setAlign( Qt::AlignRight ); + prev2->setAlign( TQt::AlignRight ); clearAligns(); rRight->setChecked( true ); } void KoParagAlignWidget::alignJustify() { - prev2->setAlign( Qt::AlignJustify ); + prev2->setAlign( TQt::AlignJustify ); clearAligns(); rJustify->setChecked( true ); } @@ -1355,11 +1359,11 @@ void KoParagAlignWidget::clearAligns() //////////////////////////////////////////////////////////////////////////////// -KoParagDecorationWidget::KoParagDecorationWidget( QWidget * parent, +KoParagDecorationWidget::KoParagDecorationWidget( TQWidget * tqparent, const char * name ) - : KoParagLayoutWidget( KoParagDia::PD_DECORATION, parent, name ) + : KoParagLayoutWidget( KoParagDia::PD_DECORATION, tqparent, name ) { - QVBoxLayout *tabLayout = new QVBoxLayout( this ); + TQVBoxLayout *tabLayout = new TQVBoxLayout( this ); wDeco = new KoParagDecorationTab( this ); tabLayout->add( wDeco ); @@ -1373,33 +1377,33 @@ KoParagDecorationWidget::KoParagDecorationWidget( QWidget * parent, // Set up Border Width combo box for( unsigned int i = 1; i <= 10; i++ ) - wDeco->cbBorderWidth->insertItem(QString::number(i)); + wDeco->cbBorderWidth->insertItem(TQString::number(i)); // Setup the border toggle buttons, and merge checkbox - connect( wDeco->bBorderLeft, SIGNAL( toggled( bool ) ), - this, SLOT( brdLeftToggled( bool ) ) ); - connect( wDeco->bBorderRight, SIGNAL( toggled( bool ) ), - this, SLOT( brdRightToggled( bool ) ) ); - connect( wDeco->bBorderTop, SIGNAL( toggled( bool ) ), - this, SLOT( brdTopToggled( bool ) ) ); - connect( wDeco->bBorderBottom, SIGNAL( toggled( bool ) ), - this, SLOT( brdBottomToggled( bool ) ) ); - connect( wDeco->cbJoinBorder, SIGNAL( toggled( bool ) ), - this, SLOT( brdJoinToggled( bool ) ) ); + connect( wDeco->bBorderLeft, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SLOT( brdLeftToggled( bool ) ) ); + connect( wDeco->bBorderRight, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SLOT( brdRightToggled( bool ) ) ); + connect( wDeco->bBorderTop, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SLOT( brdTopToggled( bool ) ) ); + connect( wDeco->bBorderBottom, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SLOT( brdBottomToggled( bool ) ) ); + connect( wDeco->cbJoinBorder, TQT_SIGNAL( toggled( bool ) ), + this, TQT_SLOT( brdJoinToggled( bool ) ) ); // Set up Border preview widget wPreview = new KoBorderPreview( wDeco->borderPreview ); - QVBoxLayout *previewLayout = new QVBoxLayout( wDeco->borderPreview ); + TQVBoxLayout *previewLayout = new TQVBoxLayout( wDeco->borderPreview ); previewLayout->addWidget( wPreview ); - connect( wPreview, SIGNAL( choosearea(QMouseEvent * ) ), - this, SLOT( slotPressEvent(QMouseEvent *) ) ); + connect( wPreview, TQT_SIGNAL( choosearea(TQMouseEvent * ) ), + this, TQT_SLOT( slotPressEvent(TQMouseEvent *) ) ); } /////// // Current GUI selections KoBorder::BorderStyle KoParagDecorationWidget::curBorderStyle() const { - QString selection = wDeco->cbBorderStyle->currentText(); + TQString selection = wDeco->cbBorderStyle->currentText(); return KoBorder::getStyle( selection ); } @@ -1407,7 +1411,7 @@ unsigned int KoParagDecorationWidget::curBorderWidth() const { return wDeco->cbBorderWidth->currentText().toUInt(); } -QColor KoParagDecorationWidget::curBorderColor() const { +TQColor KoParagDecorationWidget::curBorderColor() const { return wDeco->bBorderColor->color(); } /////// @@ -1441,16 +1445,16 @@ void KoParagDecorationWidget::clickedBorderPreview( KoBorder& border, // Establish which border position was clicked in the border preview, // and update the appropriate border -void KoParagDecorationWidget::slotPressEvent(QMouseEvent *_ev) +void KoParagDecorationWidget::slotPressEvent(TQMouseEvent *_ev) { const int OFFSETX = 15; const int OFFSETY = 7; const int Ko_SPACE = 30; - QRect r = wPreview->contentsRect(); - QRect rect(r.x() + OFFSETX, r.y() + OFFSETY, + TQRect r = wPreview->contentsRect(); + TQRect rect(r.x() + OFFSETX, r.y() + OFFSETY, r.width() - OFFSETX, r.y() + OFFSETY + Ko_SPACE); - if(rect.contains(QPoint(_ev->x(),_ev->y()))) + if(rect.tqcontains(TQPoint(_ev->x(),_ev->y()))) { clickedBorderPreview( m_topBorder, KoBorder::TopBorder, wDeco->bBorderTop ); @@ -1458,7 +1462,7 @@ void KoParagDecorationWidget::slotPressEvent(QMouseEvent *_ev) rect.setCoords(r.x() + OFFSETX, r.height() - OFFSETY - Ko_SPACE, r.width() - OFFSETX, r.height() - OFFSETY); - if(rect.contains(QPoint(_ev->x(),_ev->y()))) + if(rect.tqcontains(TQPoint(_ev->x(),_ev->y()))) { clickedBorderPreview( m_bottomBorder, KoBorder::BottomBorder, wDeco->bBorderBottom ); @@ -1466,7 +1470,7 @@ void KoParagDecorationWidget::slotPressEvent(QMouseEvent *_ev) rect.setCoords(r.x() + OFFSETX, r.y() + OFFSETY, r.x() + Ko_SPACE + OFFSETX, r.height() - OFFSETY); - if(rect.contains(QPoint(_ev->x(),_ev->y()))) + if(rect.tqcontains(TQPoint(_ev->x(),_ev->y()))) { clickedBorderPreview( m_leftBorder, KoBorder::LeftBorder, wDeco->bBorderLeft ); @@ -1474,7 +1478,7 @@ void KoParagDecorationWidget::slotPressEvent(QMouseEvent *_ev) rect.setCoords(r.width() - OFFSETX - Ko_SPACE, r.y() + OFFSETY, r.width() - OFFSETX, r.height() - OFFSETY); - if(rect.contains(QPoint(_ev->x(),_ev->y()))) + if(rect.tqcontains(TQPoint(_ev->x(),_ev->y()))) { clickedBorderPreview( m_rightBorder, KoBorder::RightBorder, wDeco->bBorderRight ); @@ -1526,11 +1530,11 @@ void KoParagDecorationWidget::save( KoParagLayout & lay ) lay.joinBorder = m_joinBorder; } -QColor KoParagDecorationWidget::backgroundColor() const { +TQColor KoParagDecorationWidget::backgroundColor() const { return wDeco->bBackgroundColor->color(); } -QString KoParagDecorationWidget::tabName() { +TQString KoParagDecorationWidget::tabName() { // Why D&e..? Because &De.. conflicts with &Delete in // the style manager. return i18n( "D&ecorations" ); @@ -1590,56 +1594,56 @@ void KoParagDecorationWidget::brdJoinToggled( bool _on ) { //////////////////////////////////////////////////////////////////////////////// -KoParagCounterWidget::KoParagCounterWidget( bool disableAll, QWidget * parent, const char * name ) - : KoParagLayoutWidget( KoParagDia::PD_NUMBERING, parent, name ) +KoParagCounterWidget::KoParagCounterWidget( bool disableAll, TQWidget * tqparent, const char * name ) + : KoParagLayoutWidget( KoParagDia::PD_NUMBERING, tqparent, name ) { - QVBoxLayout *Form1Layout = new QVBoxLayout( this ); + TQVBoxLayout *Form1Layout = new TQVBoxLayout( this ); Form1Layout->setSpacing( KDialog::spacingHint() ); Form1Layout->setMargin( KDialog::marginHint() ); - gNumbering = new QButtonGroup( this, "numberingGroup" ); + gNumbering = new TQButtonGroup( this, "numberingGroup" ); gNumbering->setTitle( i18n( "Numbering" ) ); gNumbering->setColumnLayout(0, Qt::Vertical ); - gNumbering->layout()->setSpacing( 0 ); - gNumbering->layout()->setMargin( 0 ); - QHBoxLayout *numberingGroupLayout = new QHBoxLayout( gNumbering->layout() ); - numberingGroupLayout->setAlignment( Qt::AlignTop ); + gNumbering->tqlayout()->setSpacing( 0 ); + gNumbering->tqlayout()->setMargin( 0 ); + TQHBoxLayout *numberingGroupLayout = new TQHBoxLayout( gNumbering->tqlayout() ); + numberingGroupLayout->tqsetAlignment( TQt::AlignTop ); numberingGroupLayout->setSpacing( KDialog::spacingHint() ); numberingGroupLayout->setMargin( KDialog::marginHint() ); // What type of numbering is required? - QRadioButton *rNone = new QRadioButton( gNumbering, "rNone" ); + TQRadioButton *rNone = new TQRadioButton( gNumbering, "rNone" ); rNone->setText( i18n( "&None" ) ); numberingGroupLayout->addWidget( rNone ); gNumbering->insert( rNone , KoParagCounter::NUM_NONE); - QRadioButton *rList = new QRadioButton( gNumbering, "rList" ); + TQRadioButton *rList = new TQRadioButton( gNumbering, "rList" ); rList->setText( i18n( "&List" ) ); gNumbering->insert( rList , KoParagCounter::NUM_LIST); numberingGroupLayout->addWidget( rList ); - QRadioButton *rChapter = new QRadioButton( gNumbering, "rChapter" ); + TQRadioButton *rChapter = new TQRadioButton( gNumbering, "rChapter" ); rChapter->setText( i18n( "Chapt&er" ) ); gNumbering->insert( rChapter , KoParagCounter::NUM_CHAPTER); numberingGroupLayout->addWidget( rChapter ); Form1Layout->addWidget( gNumbering ); - connect( gNumbering, SIGNAL( clicked( int ) ), this, SLOT( numTypeChanged( int ) ) ); + connect( gNumbering, TQT_SIGNAL( clicked( int ) ), this, TQT_SLOT( numTypeChanged( int ) ) ); m_styleWidget = new KoCounterStyleWidget( true, false, disableAll, this ); - connect( m_styleWidget, SIGNAL( sig_suffixChanged (const QString &) ), this, SLOT( suffixChanged(const QString &) ) ); - connect( m_styleWidget, SIGNAL( sig_prefixChanged (const QString &) ), this, SLOT( prefixChanged(const QString &) ) ); - connect( m_styleWidget, SIGNAL( sig_startChanged(int) ), this, SLOT( startChanged(int) ) ); - connect( m_styleWidget, SIGNAL( sig_restartChanged(bool) ), this, SLOT( restartChanged(bool) ) ); - connect( m_styleWidget, SIGNAL( sig_depthChanged (int) ), this, SLOT( depthChanged(int) ) ); - connect( m_styleWidget, SIGNAL( sig_displayLevelsChanged (int) ), this, SLOT( displayLevelsChanged(int) ) ); - connect( m_styleWidget, SIGNAL( sig_alignmentChanged (int) ), this, SLOT( alignmentChanged(int) ) ); - connect( m_styleWidget, SIGNAL( changeCustomBullet( const QString & , QChar ) ), this, SLOT( slotChangeCustomBullet( const QString & , QChar ) ) ); + connect( m_styleWidget, TQT_SIGNAL( sig_suffixChanged (const TQString &) ), this, TQT_SLOT( suffixChanged(const TQString &) ) ); + connect( m_styleWidget, TQT_SIGNAL( sig_prefixChanged (const TQString &) ), this, TQT_SLOT( prefixChanged(const TQString &) ) ); + connect( m_styleWidget, TQT_SIGNAL( sig_startChanged(int) ), this, TQT_SLOT( startChanged(int) ) ); + connect( m_styleWidget, TQT_SIGNAL( sig_restartChanged(bool) ), this, TQT_SLOT( restartChanged(bool) ) ); + connect( m_styleWidget, TQT_SIGNAL( sig_depthChanged (int) ), this, TQT_SLOT( depthChanged(int) ) ); + connect( m_styleWidget, TQT_SIGNAL( sig_displayLevelsChanged (int) ), this, TQT_SLOT( displayLevelsChanged(int) ) ); + connect( m_styleWidget, TQT_SIGNAL( sig_tqalignmentChanged (int) ), this, TQT_SLOT( tqalignmentChanged(int) ) ); + connect( m_styleWidget, TQT_SIGNAL( changeCustomBullet( const TQString & , TQChar ) ), this, TQT_SLOT( slotChangeCustomBullet( const TQString & , TQChar ) ) ); - connect( m_styleWidget, SIGNAL( sig_numTypeChanged( int ) ), this, SLOT( numTypeChanged(int ) ) ); - connect( m_styleWidget, SIGNAL( changeStyle( KoParagCounter::Style ) ), this, SLOT( styleChanged (KoParagCounter::Style ) ) ); + connect( m_styleWidget, TQT_SIGNAL( sig_numTypeChanged( int ) ), this, TQT_SLOT( numTypeChanged(int ) ) ); + connect( m_styleWidget, TQT_SIGNAL( changeStyle( KoParagCounter::Style ) ), this, TQT_SLOT( styleChanged (KoParagCounter::Style ) ) ); Form1Layout->addWidget( m_styleWidget ); @@ -1652,7 +1656,7 @@ KoParagCounterWidget::KoParagCounterWidget( bool disableAll, QWidget * parent, c preview->setEnabled( false ); } - QSpacerItem* spacer = new QSpacerItem( 0, 0, QSizePolicy::Minimum, QSizePolicy::Expanding); + TQSpacerItem* spacer = new TQSpacerItem( 0, 0, TQSizePolicy::Minimum, TQSizePolicy::Expanding); Form1Layout->addItem( spacer ); } @@ -1662,14 +1666,14 @@ void KoParagCounterWidget::styleChanged( KoParagCounter::Style st ) updatePreview(); } -void KoParagCounterWidget::slotChangeCustomBullet( const QString & f, QChar c) +void KoParagCounterWidget::slotChangeCustomBullet( const TQString & f, TQChar c) { m_counter.setCustomBulletFont( f ); m_counter.setCustomBulletCharacter( c ); preview->setCounter( m_counter ); } -QString KoParagCounterWidget::tabName() { +TQString KoParagCounterWidget::tabName() { return i18n( "B&ullets/Numbers" ); } @@ -1701,7 +1705,7 @@ void KoParagCounterWidget::display( const KoParagLayout & lay ) { void KoParagCounterWidget::updatePreview() { preview->setCounter(m_counter); - preview->repaint(true); + preview->tqrepaint(true); } void KoParagCounterWidget::save( KoParagLayout & lay ) { @@ -1716,16 +1720,16 @@ void KoParagCounterWidget::save( KoParagLayout & lay ) { lay.counter = new KoParagCounter( m_counter ); } -KoTabulatorsLineEdit::KoTabulatorsLineEdit( QWidget *parent, double lower, double upper, double step, double value /*= 0.0*/, KoUnit::Unit unit /*= KoUnit::U_PT*/, unsigned int precision /*= 2*/, const char *name /*= 0*/ ) - : KoUnitDoubleSpinBox ( parent, lower, upper, step, value, unit, precision, name ) +KoTabulatorsLineEdit::KoTabulatorsLineEdit( TQWidget *tqparent, double lower, double upper, double step, double value /*= 0.0*/, KoUnit::Unit unit /*= KoUnit::U_PT*/, unsigned int precision /*= 2*/, const char *name /*= 0*/ ) + : KoUnitDoubleSpinBox ( tqparent, lower, upper, step, value, unit, precision, name ) { setRange( 0, 9999, 1, false); } -void KoTabulatorsLineEdit::keyPressEvent ( QKeyEvent *ke ) +void KoTabulatorsLineEdit::keyPressEvent ( TQKeyEvent *ke ) { - if( ke->key() == QKeyEvent::Key_Return || - ke->key() == QKeyEvent::Key_Enter ) + if( ke->key() == Qt::Key_Return || + ke->key() == Qt::Key_Enter ) { emit keyReturnPressed(); return; @@ -1733,123 +1737,123 @@ void KoTabulatorsLineEdit::keyPressEvent ( QKeyEvent *ke ) KoUnitDoubleSpinBox::keyPressEvent (ke); } -KoParagTabulatorsWidget::KoParagTabulatorsWidget( KoUnit::Unit unit, double frameWidth,QWidget * parent, const char * name ) - : KoParagLayoutWidget( KoParagDia::PD_TABS, parent, name ), m_unit(unit) { - QString length; +KoParagTabulatorsWidget::KoParagTabulatorsWidget( KoUnit::Unit unit, double frameWidth,TQWidget * tqparent, const char * name ) + : KoParagLayoutWidget( KoParagDia::PD_TABS, tqparent, name ), m_unit(unit) { + TQString length; if(frameWidth==-1) { frameWidth=9999; m_toplimit=9999; } else { m_toplimit=frameWidth; length=i18n("Frame width: %1 %2") - .arg(KoUnit::toUserStringValue(frameWidth,m_unit)) - .arg(KoUnit::unitName(m_unit)); + .tqarg(KoUnit::toUserStringValue(frameWidth,m_unit)) + .tqarg(KoUnit::unitName(m_unit)); frameWidth=KoUnit::toUserValue(frameWidth,m_unit); } - QVBoxLayout* Form1Layout = new QVBoxLayout( this ); + TQVBoxLayout* Form1Layout = new TQVBoxLayout( this ); Form1Layout->setSpacing( KDialog::spacingHint() ); Form1Layout->setMargin( KDialog::marginHint() ); - QHBoxLayout* Layout13 = new QHBoxLayout; + TQHBoxLayout* Layout13 = new TQHBoxLayout; Layout13->setSpacing( KDialog::spacingHint() ); Layout13->setMargin( 0 ); //? - lstTabs = new QListBox( this); + lstTabs = new TQListBox( this); lstTabs->insertItem( "mytabvalue" ); - lstTabs->setMaximumSize( QSize( 300, 32767 ) ); + lstTabs->setMaximumSize( TQSize( 300, 32767 ) ); Layout13->addWidget( lstTabs ); - editLayout = new QVBoxLayout; + editLayout = new TQVBoxLayout; editLayout->setSpacing( KDialog::spacingHint() ); editLayout->setMargin( 0 ); //? - gPosition = new QGroupBox( this, "gPosition" ); + gPosition = new TQGroupBox( this, "gPosition" ); gPosition->setTitle( i18n( "Po&sition" ) ); gPosition->setColumnLayout(0, Qt::Vertical ); - gPosition->layout()->setSpacing( 0 ); - gPosition->layout()->setMargin( 0 ); - QVBoxLayout* GroupBox2Layout = new QVBoxLayout( gPosition->layout() ); - GroupBox2Layout->setAlignment( Qt::AlignTop ); + gPosition->tqlayout()->setSpacing( 0 ); + gPosition->tqlayout()->setMargin( 0 ); + TQVBoxLayout* GroupBox2Layout = new TQVBoxLayout( gPosition->tqlayout() ); + GroupBox2Layout->tqsetAlignment( TQt::AlignTop ); GroupBox2Layout->setSpacing( KDialog::spacingHint() ); GroupBox2Layout->setMargin( KDialog::marginHint() ); - QHBoxLayout* Layout5 = new QHBoxLayout; + TQHBoxLayout* Layout5 = new TQHBoxLayout; Layout5->setSpacing( KDialog::spacingHint() ); Layout5->setMargin( 0 ); //? sTabPos = new KoTabulatorsLineEdit( gPosition, 0, 9999, 1, 0.0, m_unit ); sTabPos->setRange( 0, 9999, 1 ); - sTabPos->setMaximumSize( QSize( 100, 32767 ) ); + sTabPos->setMaximumSize( TQSize( 100, 32767 ) ); Layout5->addWidget( sTabPos ); - QSpacerItem* spacer = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); Layout5->addItem( spacer ); GroupBox2Layout->addLayout( Layout5 ); editLayout->addWidget( gPosition ); - QLabel* TextLabel1 = new QLabel( gPosition ); - QString unitDescription = KoUnit::unitDescription( m_unit ); + TQLabel* TextLabel1 = new TQLabel( gPosition ); + TQString unitDescription = KoUnit::unitDescription( m_unit ); TextLabel1->setText( length ); GroupBox2Layout->addWidget( TextLabel1 ); - bgAlign = new QButtonGroup( this ); + bgAlign = new TQButtonGroup( this ); bgAlign->setTitle( i18n( "Alignment" ) ); bgAlign->setColumnLayout(0, Qt::Vertical ); - bgAlign->layout()->setSpacing( 0 ); - bgAlign->layout()->setMargin( 0 ); - QVBoxLayout* ButtonGroup1Layout = new QVBoxLayout( bgAlign->layout() ); - ButtonGroup1Layout->setAlignment( Qt::AlignTop ); + bgAlign->tqlayout()->setSpacing( 0 ); + bgAlign->tqlayout()->setMargin( 0 ); + TQVBoxLayout* ButtonGroup1Layout = new TQVBoxLayout( bgAlign->tqlayout() ); + ButtonGroup1Layout->tqsetAlignment( TQt::AlignTop ); ButtonGroup1Layout->setSpacing( KDialog::spacingHint() ); ButtonGroup1Layout->setMargin( KDialog::marginHint() ); - rAlignLeft = new QRadioButton( bgAlign ); + rAlignLeft = new TQRadioButton( bgAlign ); rAlignLeft->setText( i18n( "&Left" ) ); ButtonGroup1Layout->addWidget( rAlignLeft ); - rAlignCentre = new QRadioButton( bgAlign ); + rAlignCentre = new TQRadioButton( bgAlign ); rAlignCentre->setText( i18n( "C&enter" ) ); ButtonGroup1Layout->addWidget( rAlignCentre ); - rAlignRight = new QRadioButton( bgAlign ); + rAlignRight = new TQRadioButton( bgAlign ); rAlignRight->setText( i18n( "&Right" ) ); ButtonGroup1Layout->addWidget( rAlignRight ); - QHBoxLayout* Layout8 = new QHBoxLayout; + TQHBoxLayout* Layout8 = new TQHBoxLayout; Layout8->setSpacing( KDialog::spacingHint() ); Layout8->setMargin( 0 ); - rAlignVar = new QRadioButton( bgAlign ); + rAlignVar = new TQRadioButton( bgAlign ); rAlignVar->setText( i18n( "On followin&g character: " ) ); Layout8->addWidget( rAlignVar ); - sAlignChar = new QLineEdit( bgAlign); - sAlignChar->setMaximumSize( QSize( 60, 32767 ) ); - sAlignChar->setText(QString(KGlobal::locale()->decimalSymbol()[0])); + sAlignChar = new TQLineEdit( bgAlign); + sAlignChar->setMaximumSize( TQSize( 60, 32767 ) ); + sAlignChar->setText(TQString(KGlobal::locale()->decimalSymbol()[0])); Layout8->addWidget( sAlignChar ); - QSpacerItem* spacer_2 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer_2 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); Layout8->addItem( spacer_2 ); ButtonGroup1Layout->addLayout( Layout8 ); editLayout->addWidget( bgAlign ); - gTabLeader = new QGroupBox( this, "gTabLeader" ); + gTabLeader = new TQGroupBox( this, "gTabLeader" ); gTabLeader->setTitle( i18n( "Tab Leader" ) ); - QVBoxLayout* GroupBox5Layout = new QVBoxLayout( gTabLeader ); - GroupBox5Layout->setAlignment( Qt::AlignTop ); + TQVBoxLayout* GroupBox5Layout = new TQVBoxLayout( gTabLeader ); + GroupBox5Layout->tqsetAlignment( TQt::AlignTop ); GroupBox5Layout->setSpacing( KDialog::spacingHint() ); GroupBox5Layout->setMargin( KDialog::marginHint() ); GroupBox5Layout->addSpacing( fontMetrics().height() / 2 ); // groupbox title - QLabel* TextLabel1_2 = new QLabel( gTabLeader ); + TQLabel* TextLabel1_2 = new TQLabel( gTabLeader ); TextLabel1_2->setText( i18n( "The space a tab uses can be filled with a pattern." ) ); GroupBox5Layout->addWidget( TextLabel1_2 ); - QGridLayout *fillingGrid = new QGridLayout( 0L, 2, 2, 0, KDialog::spacingHint() ); + TQGridLayout *fillingGrid = new TQGridLayout( 0L, 2, 2, 0, KDialog::spacingHint() ); - QLabel* TextLabel2 = new QLabel( gTabLeader); + TQLabel* TextLabel2 = new TQLabel( gTabLeader); TextLabel2->setText( i18n( "&Filling:" ) ); - TextLabel2->setAlignment( AlignRight ); + TextLabel2->tqsetAlignment( AlignRight ); fillingGrid->addWidget( TextLabel2, 0, 0 ); - cFilling = new QComboBox( FALSE, gTabLeader); + cFilling = new TQComboBox( FALSE, gTabLeader); cFilling->insertItem( i18n( "Blank" ) ); cFilling->insertItem( "_ _ _ _ _ _"); // DOT cFilling->insertItem( "_________"); // SOLID @@ -1859,8 +1863,8 @@ KoParagTabulatorsWidget::KoParagTabulatorsWidget( KoUnit::Unit unit, double fram TextLabel2->setBuddy( cFilling ); fillingGrid->addWidget( cFilling, 0, 1 ); - QLabel * TextLabel3 = new QLabel( i18n("&Width:"), gTabLeader ); - TextLabel3->setAlignment( AlignRight ); + TQLabel * TextLabel3 = new TQLabel( i18n("&Width:"), gTabLeader ); + TextLabel3->tqsetAlignment( AlignRight ); fillingGrid->addWidget( TextLabel3, 1, 0 ); eWidth = new KoUnitDoubleSpinBox( gTabLeader ); @@ -1871,43 +1875,43 @@ KoParagTabulatorsWidget::KoParagTabulatorsWidget( KoUnit::Unit unit, double fram GroupBox5Layout->addLayout( fillingGrid ); editLayout->addWidget( gTabLeader ); - QSpacerItem* spacer_4 = new QSpacerItem( 20, 20, QSizePolicy::Minimum, QSizePolicy::Expanding ); + TQSpacerItem* spacer_4 = new TQSpacerItem( 20, 20, TQSizePolicy::Minimum, TQSizePolicy::Expanding ); editLayout->addItem( spacer_4 ); Layout13->addLayout( editLayout ); Form1Layout->addLayout( Layout13 ); - QHBoxLayout* Layout4 = new QHBoxLayout; + TQHBoxLayout* Layout4 = new TQHBoxLayout; Layout4->setSpacing( KDialog::spacingHint() ); Layout4->setMargin( 0 ); - bNew = new QPushButton( this); + bNew = new TQPushButton( this); bNew->setText( i18n( "&New" ) ); Layout4->addWidget( bNew ); - bDelete = new QPushButton( this); + bDelete = new TQPushButton( this); bDelete->setText( i18n( "&Delete" ) ); Layout4->addWidget( bDelete ); - bDeleteAll = new QPushButton( this); + bDeleteAll = new TQPushButton( this); bDeleteAll->setText( i18n( "Delete All" ) ); Layout4->addWidget( bDeleteAll ); - QSpacerItem* spacer_5 = new QSpacerItem( 20, 20, QSizePolicy::Expanding, QSizePolicy::Minimum ); + TQSpacerItem* spacer_5 = new TQSpacerItem( 20, 20, TQSizePolicy::Expanding, TQSizePolicy::Minimum ); Layout4->addItem( spacer_5 ); Form1Layout->addLayout( Layout4 ); //signal valueChanged passes value which the user see (unlike the value() function) //so fromUserValue has to be used in slotTabValueChanged - connect(sTabPos,SIGNAL(valueChanged(double)), this, SLOT(slotTabValueChanged(double ))); - connect(sTabPos,SIGNAL( keyReturnPressed()),this,SLOT(newClicked())); - connect(sAlignChar,SIGNAL(textChanged( const QString & )), this, SLOT(slotAlignCharChanged( const QString & ))); - connect(bNew,SIGNAL(clicked ()),this,SLOT(newClicked())); - connect(bDelete,SIGNAL(clicked ()),this,SLOT(deleteClicked())); - connect(bDeleteAll,SIGNAL(clicked ()),this,SLOT(deleteAllClicked())); - connect(bgAlign,SIGNAL(clicked (int)),this,SLOT(updateAlign(int))); - connect(cFilling,SIGNAL(activated (int)),this,SLOT(updateFilling(int))); - connect(eWidth,SIGNAL(valueChangedPt( double ) ),this,SLOT(updateWidth())); - connect(lstTabs,SIGNAL(highlighted (int)),this,SLOT(setActiveItem(int))); + connect(sTabPos,TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(slotTabValueChanged(double ))); + connect(sTabPos,TQT_SIGNAL( keyReturnPressed()),this,TQT_SLOT(newClicked())); + connect(sAlignChar,TQT_SIGNAL(textChanged( const TQString & )), this, TQT_SLOT(slotAlignCharChanged( const TQString & ))); + connect(bNew,TQT_SIGNAL(clicked ()),this,TQT_SLOT(newClicked())); + connect(bDelete,TQT_SIGNAL(clicked ()),this,TQT_SLOT(deleteClicked())); + connect(bDeleteAll,TQT_SIGNAL(clicked ()),this,TQT_SLOT(deleteAllClicked())); + connect(bgAlign,TQT_SIGNAL(clicked (int)),this,TQT_SLOT(updateAlign(int))); + connect(cFilling,TQT_SIGNAL(activated (int)),this,TQT_SLOT(updateFilling(int))); + connect(eWidth,TQT_SIGNAL(valueChangedPt( double ) ),this,TQT_SLOT(updateWidth())); + connect(lstTabs,TQT_SIGNAL(highlighted (int)),this,TQT_SLOT(setActiveItem(int))); noSignals=false; } @@ -1923,7 +1927,7 @@ void KoParagTabulatorsWidget::slotTabValueChanged( double val ) { noSignals=false; } -void KoParagTabulatorsWidget::slotAlignCharChanged( const QString &/*_text*/ ) { +void KoParagTabulatorsWidget::slotAlignCharChanged( const TQString &/*_text*/ ) { // select align 3 and update data structures. bgAlign->setButton(3); m_tabList[lstTabs->currentItem()].alignChar=sAlignChar->text()[0]; @@ -1956,7 +1960,7 @@ void KoParagTabulatorsWidget::newClicked() { newTab.ptWidth=m_tabList[selected].ptWidth; m_tabList.insert(m_tabList.at(selected), newTab); lstTabs->insertItem( tabToString(newTab), selected); - lstTabs->setCurrentItem(lstTabs->findItem(tabToString(newTab))); + lstTabs->setCurrentItem(lstTabs->tqfindItem(tabToString(newTab))); sortLists(); } } @@ -1971,7 +1975,7 @@ void KoParagTabulatorsWidget::deleteClicked() { lstTabs->removeItem(selected); m_tabList.remove(m_tabList[selected]); if(lstTabs->count() >0) { - lstTabs->setCurrentItem(QMIN(static_cast<unsigned int>(selected), lstTabs->count()-1 )); + lstTabs->setCurrentItem(TQMIN(static_cast<unsigned int>(selected), lstTabs->count()-1 )); } else { bDeleteAll->setEnabled(false); bDelete->setEnabled(false); @@ -2007,7 +2011,7 @@ void KoParagTabulatorsWidget::setActiveItem(int selected) { bgAlign->setButton(2); break; case T_DEC_PNT: bgAlign->setButton(3); - sAlignChar->setText(QString(selectedTab->alignChar)); + sAlignChar->setText(TQString(selectedTab->alignChar)); break; case T_LEFT: default: @@ -2049,7 +2053,7 @@ void KoParagTabulatorsWidget::setCurrentTab( double tabPos ) { kdWarning() << "KoParagTabulatorsWidget::setCurrentTab: no tab found at pos=" << tabPos << endl; } -QString KoParagTabulatorsWidget::tabToString(const KoTabulator &tab) { +TQString KoParagTabulatorsWidget::tabToString(const KoTabulator &tab) { return KoUnit::toUserStringValue( tab.ptPos, m_unit); } @@ -2093,7 +2097,7 @@ void KoParagTabulatorsWidget::updateFilling(int selected) { void KoParagTabulatorsWidget::updateWidth() { KoTabulator *selectedTab = &m_tabList[lstTabs->currentItem()]; - selectedTab->ptWidth = QMAX( 0, eWidth->value() ); + selectedTab->ptWidth = TQMAX( 0, eWidth->value() ); } void KoParagTabulatorsWidget::sortLists() { @@ -2103,13 +2107,13 @@ void KoParagTabulatorsWidget::sortLists() { // we could just sort the listView, but to make sure we never have any problems with // inconsistent lists, just re-add.. - QString curValue=lstTabs->currentText(); + TQString curValue=lstTabs->currentText(); lstTabs->clear(); KoTabulatorList::ConstIterator it = m_tabList.begin(); for ( ; it != m_tabList.end(); ++it ) lstTabs->insertItem( KoUnit::toUserStringValue( (*it).ptPos, m_unit ) ); - lstTabs->setCurrentItem(lstTabs->findItem(curValue)); + lstTabs->setCurrentItem(lstTabs->tqfindItem(curValue)); noSignals=false; } @@ -2136,16 +2140,16 @@ void KoParagTabulatorsWidget::save( KoParagLayout & lay ) { lay.setTabList( m_tabList ); } -QString KoParagTabulatorsWidget::tabName() { +TQString KoParagTabulatorsWidget::tabName() { return i18n( "&Tabulators" ); } /******************************************************************/ /* Class: KoParagDia */ /******************************************************************/ -KoParagDia::KoParagDia( QWidget* parent, const char* name, +KoParagDia::KoParagDia( TQWidget* tqparent, const char* name, int flags, KoUnit::Unit unit, double _frameWidth, bool breakLine, bool disableAll ) - : KDialogBase(Tabbed, QString::null, Ok | Cancel | User1 | Apply, Ok, parent, name, true ) + : KDialogBase(Tabbed, TQString(), Ok | Cancel | User1 | Apply, Ok, tqparent, name, true ) { m_decorationsWidget = 0; m_flags = flags; @@ -2153,37 +2157,37 @@ KoParagDia::KoParagDia( QWidget* parent, const char* name, if ( m_flags & PD_SPACING ) { - QVBox * page = addVBoxPage( i18n( "Indent && S&pacing" ) ); + TQVBox * page = addVBoxPage( i18n( "Indent && S&pacing" ) ); m_indentSpacingWidget = new KoIndentSpacingWidget( unit,_frameWidth,page, "indent-spacing" ); - m_indentSpacingWidget->layout()->setMargin(0); + m_indentSpacingWidget->tqlayout()->setMargin(0); } if ( m_flags & PD_ALIGN ) { - QVBox * page = addVBoxPage( i18n( "General &Layout" ) ); + TQVBox * page = addVBoxPage( i18n( "General &Layout" ) ); m_alignWidget = new KoParagAlignWidget( breakLine, page, "align" ); - m_alignWidget->layout()->setMargin(0); + m_alignWidget->tqlayout()->setMargin(0); } if ( m_flags & PD_DECORATION ) { - QVBox * page = addVBoxPage( i18n( "D&ecorations" ) ); + TQVBox * page = addVBoxPage( i18n( "D&ecorations" ) ); m_decorationsWidget = new KoParagDecorationWidget( page, "decorations"); - m_decorationsWidget->layout()->setMargin(0); + m_decorationsWidget->tqlayout()->setMargin(0); } if ( m_flags & PD_NUMBERING ) { - QVBox * page = addVBoxPage( i18n( "B&ullets/Numbers" ) ); + TQVBox * page = addVBoxPage( i18n( "B&ullets/Numbers" ) ); m_counterWidget = new KoParagCounterWidget( disableAll , page, "numbers" ); - m_counterWidget->layout()->setMargin(0); + m_counterWidget->tqlayout()->setMargin(0); } if ( m_flags & PD_TABS ) { - QVBox * page = addVBoxPage( i18n( "&Tabulators" ) ); + TQVBox * page = addVBoxPage( i18n( "&Tabulators" ) ); m_tabulatorsWidget = new KoParagTabulatorsWidget( unit,_frameWidth, page, "tabs"); - m_tabulatorsWidget->layout()->setMargin(0); + m_tabulatorsWidget->tqlayout()->setMargin(0); } - connect( this, SIGNAL( user1Clicked() ), this, SLOT(slotReset())); - setInitialSize( QSize(630, 500) ); + connect( this, TQT_SIGNAL( user1Clicked() ), this, TQT_SLOT(slotReset())); + setInitialSize( TQSize(630, 500) ); } KoParagDia::~KoParagDia() @@ -2206,19 +2210,19 @@ void KoParagDia::setCurrentPage( int page ) switch( page ) { case PD_SPACING: - showPage( pageIndex( m_indentSpacingWidget->parentWidget() ) ); + showPage( pageIndex( m_indentSpacingWidget->tqparentWidget() ) ); break; case PD_ALIGN: - showPage( pageIndex( m_alignWidget->parentWidget() ) ); + showPage( pageIndex( m_alignWidget->tqparentWidget() ) ); break; case PD_DECORATION: - showPage( pageIndex( m_decorationsWidget->parentWidget() ) ); + showPage( pageIndex( m_decorationsWidget->tqparentWidget() ) ); break; case PD_NUMBERING: - showPage( pageIndex( m_counterWidget->parentWidget() ) ); + showPage( pageIndex( m_counterWidget->tqparentWidget() ) ); break; case PD_TABS: - showPage( pageIndex( m_tabulatorsWidget->parentWidget() ) ); + showPage( pageIndex( m_tabulatorsWidget->tqparentWidget() ) ); break; default: break; @@ -2268,12 +2272,12 @@ KoParagLayout KoParagDia::paragLayout() const newLayout.setLineSpacingValue( lineSpacing() ); newLayout.lineSpacingType = lineSpacingType(); newLayout.setTabList( tabListTabulator() ); - newLayout.alignment = align(); - newLayout.margins[QStyleSheetItem::MarginFirstLine] = firstLineIndent(); - newLayout.margins[QStyleSheetItem::MarginLeft] = leftIndent(); - newLayout.margins[QStyleSheetItem::MarginRight] = rightIndent(); - newLayout.margins[QStyleSheetItem::MarginTop] = spaceBeforeParag(); - newLayout.margins[QStyleSheetItem::MarginBottom] = spaceAfterParag(); + newLayout.tqalignment = align(); + newLayout.margins[TQStyleSheetItem::MarginFirstLine] = firstLineIndent(); + newLayout.margins[TQStyleSheetItem::MarginLeft] = leftIndent(); + newLayout.margins[TQStyleSheetItem::MarginRight] = rightIndent(); + newLayout.margins[TQStyleSheetItem::MarginTop] = spaceBeforeParag(); + newLayout.margins[TQStyleSheetItem::MarginBottom] = spaceAfterParag(); newLayout.pageBreaking = pageBreaking(); newLayout.leftBorder = leftBorder(); newLayout.rightBorder = rightBorder(); |