From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: 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 --- kpresenter/KPrBrushProperty.cpp | 146 ++++++++++++++++++++-------------------- 1 file changed, 73 insertions(+), 73 deletions(-) (limited to 'kpresenter/KPrBrushProperty.cpp') diff --git a/kpresenter/KPrBrushProperty.cpp b/kpresenter/KPrBrushProperty.cpp index 6e27e118..7e4b4371 100644 --- a/kpresenter/KPrBrushProperty.cpp +++ b/kpresenter/KPrBrushProperty.cpp @@ -22,49 +22,49 @@ #include "gradientpropertyui.h" #include "KPrPBPreview.h" -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include #include #include #include -KPrBrushProperty::KPrBrushProperty( QWidget *parent, const char *name, const KPrBrushCmd::Brush &brush ) - : QWidget( parent, name ) +KPrBrushProperty::KPrBrushProperty( TQWidget *tqparent, const char *name, const KPrBrushCmd::Brush &brush ) + : TQWidget( tqparent, name ) , m_brush( brush ) { - QGridLayout *layout = new QGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); + TQGridLayout *tqlayout = new TQGridLayout( this, 1, 1, KDialog::marginHint(), KDialog::spacingHint() ); m_typeCombo = new KComboBox( this ); - layout->addWidget( m_typeCombo, 0, 1 ); + tqlayout->addWidget( m_typeCombo, 0, 1 ); m_typeCombo->insertItem( i18n( "Single Color" ) ); m_typeCombo->insertItem( i18n( "Gradient" ) ); m_typeCombo->insertItem( i18n( "Transparent" ) ); - QWhatsThis::add(m_typeCombo, i18n( "You can choose between Single Color, Gradient or Transparent as the type." ) ); + TQWhatsThis::add(m_typeCombo, i18n( "You can choose between Single Color, Gradient or Transparent as the type." ) ); - QLabel *typeLabel = new QLabel( i18n( "&Type:" ), this ); - layout->addWidget( typeLabel, 0, 0 ); + TQLabel *typeLabel = new TQLabel( i18n( "&Type:" ), this ); + tqlayout->addWidget( typeLabel, 0, 0 ); typeLabel->setBuddy( m_typeCombo ); - m_stack = new QWidgetStack( this ); - layout->addMultiCellWidget( m_stack, 1, 1, 0, 1 ); - connect( m_typeCombo, SIGNAL( activated( int ) ), - this, SLOT( slotTypeChanged( int ) ) ); + m_stack = new TQWidgetStack( this ); + tqlayout->addMultiCellWidget( m_stack, 1, 1, 0, 1 ); + connect( m_typeCombo, TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( slotTypeChanged( int ) ) ); m_brushUI = new BrushPropertyUI( m_stack ); - m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 100 ) ); - m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 94 ) ); - m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 88 ) ); - m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 63 ) ); - m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 50 ) ); - m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 37 ) ); - m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 12 ) ); - m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).arg( 6 ) ); + m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).tqarg( 100 ) ); + m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).tqarg( 94 ) ); + m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).tqarg( 88 ) ); + m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).tqarg( 63 ) ); + m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).tqarg( 50 ) ); + m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).tqarg( 37 ) ); + m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).tqarg( 12 ) ); + m_brushUI->styleCombo->insertItem( i18n( "%1% Fill Pattern" ).tqarg( 6 ) ); m_brushUI->styleCombo->insertItem( i18n( "Horizontal Lines" ) ); m_brushUI->styleCombo->insertItem( i18n( "Vertical Lines" ) ); m_brushUI->styleCombo->insertItem( i18n( "Crossing Lines" ) ); @@ -73,14 +73,14 @@ KPrBrushProperty::KPrBrushProperty( QWidget *parent, const char *name, const KPr m_brushUI->styleCombo->insertItem( i18n( "Diagonal Crossing Lines" ) ); m_preview_color = new KPrPBPreview( m_brushUI->previewPanel, 0, KPrPBPreview::Brush ); - QHBoxLayout *hbox = new QHBoxLayout( m_brushUI->previewPanel ); - QWhatsThis::add(m_preview_color, i18n( "This displays a preview of your choices." ) ); + TQHBoxLayout *hbox = new TQHBoxLayout( m_brushUI->previewPanel ); + TQWhatsThis::add(m_preview_color, i18n( "This displays a preview of your choices." ) ); hbox->addWidget(m_preview_color); - connect( m_brushUI->styleCombo, SIGNAL( activated( int ) ), - this, SLOT( slotBrushChanged() ) ); - connect( m_brushUI->colorChooser, SIGNAL( changed( const QColor& ) ), - this, SLOT( slotBrushChanged() ) ); + connect( m_brushUI->styleCombo, TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( slotBrushChanged() ) ); + connect( m_brushUI->colorChooser, TQT_SIGNAL( changed( const TQColor& ) ), + this, TQT_SLOT( slotBrushChanged() ) ); m_stack->addWidget( m_brushUI, 0 ); @@ -95,24 +95,24 @@ KPrBrushProperty::KPrBrushProperty( QWidget *parent, const char *name, const KPr m_gradientUI->styleCombo->insertItem( i18n( "Pyramid" ) ); m_preview_gradient = new KPrPBPreview( m_gradientUI->previewPanel, 0, KPrPBPreview::Gradient ); - hbox = new QHBoxLayout( m_gradientUI->previewPanel ); + hbox = new TQHBoxLayout( m_gradientUI->previewPanel ); hbox->addWidget(m_preview_gradient); - connect( m_gradientUI->styleCombo, SIGNAL( activated( int ) ), - this, SLOT( slotBackColorTypeChanged() ) ); - connect( m_gradientUI->color1Chooser, SIGNAL( changed( const QColor& ) ), - this, SLOT( slotColor1Changed() ) ); - connect( m_gradientUI->color2Chooser, SIGNAL( changed( const QColor& ) ), - this, SLOT( slotColor2Changed() ) ); - connect( m_gradientUI->unbalancedCheckBox, SIGNAL( clicked() ), - this, SLOT( slotUnbalancedChanged() ) ); - connect( m_gradientUI->xSlider, SIGNAL( valueChanged( int ) ), - this, SLOT( slotXFactorChanged() ) ); - connect( m_gradientUI->ySlider, SIGNAL( valueChanged( int ) ), - this, SLOT( slotYFactorChanged() ) ); + connect( m_gradientUI->styleCombo, TQT_SIGNAL( activated( int ) ), + this, TQT_SLOT( slotBackColorTypeChanged() ) ); + connect( m_gradientUI->color1Chooser, TQT_SIGNAL( changed( const TQColor& ) ), + this, TQT_SLOT( slotColor1Changed() ) ); + connect( m_gradientUI->color2Chooser, TQT_SIGNAL( changed( const TQColor& ) ), + this, TQT_SLOT( slotColor2Changed() ) ); + connect( m_gradientUI->unbalancedCheckBox, TQT_SIGNAL( clicked() ), + this, TQT_SLOT( slotUnbalancedChanged() ) ); + connect( m_gradientUI->xSlider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( slotXFactorChanged() ) ); + connect( m_gradientUI->ySlider, TQT_SIGNAL( valueChanged( int ) ), + this, TQT_SLOT( slotYFactorChanged() ) ); m_stack->addWidget( m_gradientUI, 1 ); - m_stack->addWidget( new QFrame(), 2 ); // the transparent case + m_stack->addWidget( new TQFrame(), 2 ); // the transparent case slotReset(); } @@ -132,57 +132,57 @@ FillType KPrBrushProperty::getFillType() const } -QBrush KPrBrushProperty::getQBrush() const +TQBrush KPrBrushProperty::getTQBrush() const { - QBrush brush; + TQBrush brush; switch ( m_brushUI->styleCombo->currentItem() ) { case 0: - brush.setStyle( SolidPattern ); + brush.setStyle( Qt::SolidPattern ); break; case 1: - brush.setStyle( Dense1Pattern ); + brush.setStyle( Qt::Dense1Pattern ); break; case 2: - brush.setStyle( Dense2Pattern ); + brush.setStyle( Qt::Dense2Pattern ); break; case 3: - brush.setStyle( Dense3Pattern ); + brush.setStyle( Qt::Dense3Pattern ); break; case 4: - brush.setStyle( Dense4Pattern ); + brush.setStyle( Qt::Dense4Pattern ); break; case 5: - brush.setStyle( Dense5Pattern ); + brush.setStyle( Qt::Dense5Pattern ); break; case 6: - brush.setStyle( Dense6Pattern ); + brush.setStyle( Qt::Dense6Pattern ); break; case 7: - brush.setStyle( Dense7Pattern ); + brush.setStyle( Qt::Dense7Pattern ); break; case 8: - brush.setStyle( HorPattern ); + brush.setStyle( Qt::HorPattern ); break; case 9: - brush.setStyle( VerPattern ); + brush.setStyle( Qt::VerPattern ); break; case 10: - brush.setStyle( CrossPattern ); + brush.setStyle( Qt::CrossPattern ); break; case 11: - brush.setStyle( BDiagPattern ); + brush.setStyle( Qt::BDiagPattern ); break; case 12: - brush.setStyle( FDiagPattern ); + brush.setStyle( Qt::FDiagPattern ); break; case 13: - brush.setStyle( DiagCrossPattern ); + brush.setStyle( Qt::DiagCrossPattern ); break; } if( m_typeCombo->currentItem() == 2) - brush.setStyle( QBrush::NoBrush ); + brush.setStyle( Qt::NoBrush ); brush.setColor( m_brushUI->colorChooser->color() ); @@ -190,13 +190,13 @@ QBrush KPrBrushProperty::getQBrush() const } -QColor KPrBrushProperty::getGColor1()const +TQColor KPrBrushProperty::getGColor1()const { return m_gradientUI->color1Chooser->color(); } -QColor KPrBrushProperty::getGColor2()const +TQColor KPrBrushProperty::getGColor2()const { return m_gradientUI->color2Chooser->color(); } @@ -233,7 +233,7 @@ int KPrBrushProperty::getBrushPropertyChange() const if ( getFillType() == FT_BRUSH ) { - QBrush brush = getQBrush(); + TQBrush brush = getTQBrush(); if ( fillTypeChanged || brush.color() != m_brush.brush.color() ) { flags |= KPrBrushCmd::BrushColor; @@ -284,7 +284,7 @@ int KPrBrushProperty::getBrushPropertyChange() const KPrBrushCmd::Brush KPrBrushProperty::getBrush() const { - KPrBrushCmd::Brush brush( getQBrush(), + KPrBrushCmd::Brush brush( getTQBrush(), getGColor1(), getGColor2(), getGType(), @@ -311,10 +311,10 @@ void KPrBrushProperty::apply() m_brush.fillType = getFillType(); if ( flags & KPrBrushCmd::BrushColor ) - m_brush.brush.setColor( getQBrush().color() ); + m_brush.brush.setColor( getTQBrush().color() ); if ( flags & KPrBrushCmd::BrushStyle ) - m_brush.brush.setStyle( getQBrush().style() ); + m_brush.brush.setStyle( getTQBrush().style() ); if ( flags & KPrBrushCmd::GradientColor1 ) m_brush.gColor1 = getGColor1(); @@ -336,7 +336,7 @@ void KPrBrushProperty::apply() } -void KPrBrushProperty::setQBrush( const QBrush &brush ) +void KPrBrushProperty::setTQBrush( const TQBrush &brush ) { switch ( brush.style() ) { @@ -394,7 +394,7 @@ void KPrBrushProperty::setQBrush( const QBrush &brush ) } -void KPrBrushProperty::setGradient( const QColor &_c1, const QColor &_c2, BCType _t, +void KPrBrushProperty::setGradient( const TQColor &_c1, const TQColor &_c2, BCType _t, bool _unbalanced, int _xfactor, int _yfactor ) { m_gradientUI->styleCombo->setCurrentItem( (int) _t - 1 ); @@ -421,7 +421,7 @@ void KPrBrushProperty::slotReset() { if ( m_brush.gType == BCT_PLAIN ) m_brush.gType = BCT_GHORZ; - setQBrush( m_brush.brush ); + setTQBrush( m_brush.brush ); setGradient( m_brush.gColor1, m_brush.gColor2, m_brush.gType, @@ -430,7 +430,7 @@ void KPrBrushProperty::slotReset() m_brush.yfactor ); int panelIndex; - if( m_brush.fillType == FT_BRUSH && m_brush.brush.style() == QBrush::NoBrush ) + if( m_brush.fillType == FT_BRUSH && m_brush.brush.style() == TQBrush::NoBrush ) panelIndex = 2; else panelIndex = (int)m_brush.fillType; @@ -449,7 +449,7 @@ void KPrBrushProperty::slotTypeChanged( int pos ) void KPrBrushProperty::slotBrushChanged() { - m_preview_color->setBrush( getQBrush() ); + m_preview_color->setBrush( getTQBrush() ); } -- cgit v1.2.1