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 /karbon/widgets/vgradientwidget.cc | |
| 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 'karbon/widgets/vgradientwidget.cc')
| -rw-r--r-- | karbon/widgets/vgradientwidget.cc | 76 |
1 files changed, 38 insertions, 38 deletions
diff --git a/karbon/widgets/vgradientwidget.cc b/karbon/widgets/vgradientwidget.cc index 25e29cd72..49410a35a 100644 --- a/karbon/widgets/vgradientwidget.cc +++ b/karbon/widgets/vgradientwidget.cc @@ -18,14 +18,14 @@ * Boston, MA 02110-1301, USA. */ -#include <qlabel.h> -#include <qframe.h> -#include <qbitmap.h> +#include <tqlabel.h> +#include <tqframe.h> +#include <tqbitmap.h> #include <kcolorbutton.h> #include <kcombobox.h> #include <klocale.h> -#include <qpainter.h> +#include <tqpainter.h> #include <kiconloader.h> #include "vgradientwidget.h" @@ -54,10 +54,10 @@ static unsigned char colorStop_bits[] = { 0x7c, 0x00, 0xfe, 0x00, 0xfe, 0x00, 0xff, 0x01 }; -VGradientWidget::VGradientWidget( VGradient& gradient, QWidget* parent, const char* name ) - : QWidget( parent, name ), m_gradient( &gradient ) +VGradientWidget::VGradientWidget( VGradient& gradient, TQWidget* tqparent, const char* name ) + : TQWidget( tqparent, name ), m_gradient( &gradient ) { - setBackgroundMode( Qt::NoBackground ); + setBackgroundMode( TQt::NoBackground ); setMinimumSize( 105, 35 ); } // VGradientWidget::VGradientWidget @@ -65,39 +65,39 @@ VGradientWidget::~VGradientWidget() { } // VGradientWidget::~VGradientWidget -void VGradientWidget::paintColorStop( QPainter& p, int x, VColor& color ) +void VGradientWidget::paintColorStop( TQPainter& p, int x, VColor& color ) { - QBitmap bitmap; + TQBitmap bitmap; - bitmap = QBitmap( colorStop_width, colorStop_height, colorStop_bits, true ); + bitmap = TQBitmap( colorStop_width, colorStop_height, colorStop_bits, true ); bitmap.setMask( bitmap ); p.setPen( color ); p.drawPixmap( x - 4, 1, bitmap ); - bitmap = QBitmap( colorStopBorder_width, colorStopBorder_height, colorStopBorder_bits, true ); + bitmap = TQBitmap( colorStopBorder_width, colorStopBorder_height, colorStopBorder_bits, true ); bitmap.setMask( bitmap ); - p.setPen( Qt::black ); + p.setPen( TQt::black ); p.drawPixmap( x - 5, 1, bitmap ); } // VGradientWidget::paintColorStop -void VGradientWidget::paintMidPoint( QPainter& p, int x ) +void VGradientWidget::paintMidPoint( TQPainter& p, int x ) { - QBitmap bitmap( midPoint_width, midPoint_height, midPoint_bits, true ); + TQBitmap bitmap( midPoint_width, midPoint_height, midPoint_bits, true ); bitmap.setMask( bitmap ); - p.setPen( Qt::black ); + p.setPen( TQt::black ); p.drawPixmap( x - 3, 1, bitmap ); } // VGradientWidget::paintMidPoint -void VGradientWidget::paintEvent( QPaintEvent* ) +void VGradientWidget::paintEvent( TQPaintEvent* ) { int w = width() - 4; // available width for gradient and points int h = height() - 7; // available height for gradient and points int ph = colorStopBorder_height + 2; // point marker height int gh = h - ph; // gradient area height - QPixmap pixmap( width(), height() ); - VKoPainter gp( &pixmap, width(), height() ); - gp.setRasterOp( Qt::XorROP ); + TQPixmap pixmap( width(), height() ); + VKoPainter gp( TQT_TQPAINTDEVICE(&pixmap), width(), height() ); + gp.setRasterOp( TQt::XorROP ); VGradient gradient( *m_gradient ); gradient.setType( VGradient::linear ); gradient.setOrigin( KoPoint( 2, 2 ) ); @@ -115,9 +115,9 @@ void VGradientWidget::paintEvent( QPaintEvent* ) gp.drawRect( KoRect( 2, 2, w, gh ) ); gp.end(); - QPainter p( &pixmap ); + TQPainter p( &pixmap ); - p.setPen( colorGroup().light() ); + p.setPen( tqcolorGroup().light() ); // light frame around widget p.moveTo( 1, height() - 1 ); p.lineTo( 1, 1 ); @@ -129,7 +129,7 @@ void VGradientWidget::paintEvent( QPaintEvent* ) p.moveTo( 1, 3 + gh ); p.lineTo( width() - 1, 3 + gh ); - p.setPen( colorGroup().dark() ); + p.setPen( tqcolorGroup().dark() ); // left-top frame around widget p.moveTo( 0, height() - 1 ); p.lineTo( 0, 0 ); @@ -151,12 +151,12 @@ void VGradientWidget::paintEvent( QPaintEvent* ) m_pntArea.setRect( 2, height() - ph - 2, w, ph ); // clear point area - p.fillRect( m_pntArea.x(), m_pntArea.y(), m_pntArea.width(), m_pntArea.height(), colorGroup().background() ); + p.fillRect( m_pntArea.x(), m_pntArea.y(), m_pntArea.width(), m_pntArea.height(), tqcolorGroup().background() ); p.setClipRect( m_pntArea.x(), m_pntArea.y(), m_pntArea.width(), m_pntArea.height() ); p.translate( m_pntArea.x(), m_pntArea.y() ); - QPtrList<VColorStop>& colorStops = m_gradient->m_colorStops; + TQPtrList<VColorStop>& colorStops = m_gradient->m_colorStops; if( colorStops.count() > 1 ) { VColorStop* stop, *nextstop; @@ -172,12 +172,12 @@ void VGradientWidget::paintEvent( QPaintEvent* ) bitBlt( this, 0, 0, &pixmap, 0, 0, width(), height() ); } // VGradientWidget::paintEvent -void VGradientWidget::mousePressEvent( QMouseEvent* e ) +void VGradientWidget::mousePressEvent( TQMouseEvent* e ) { - if( ! m_pntArea.contains( e->x(), e->y() ) ) + if( ! m_pntArea.tqcontains( e->x(), e->y() ) ) return; - QPtrList<VColorStop>& colorStops = m_gradient->m_colorStops; + TQPtrList<VColorStop>& colorStops = m_gradient->m_colorStops; currentPoint = 0; @@ -213,11 +213,11 @@ void VGradientWidget::mousePressEvent( QMouseEvent* e ) } } // VGradientWidget::mousePressEvent -void VGradientWidget::mouseReleaseEvent( QMouseEvent* e ) +void VGradientWidget::mouseReleaseEvent( TQMouseEvent* e ) { if( e->button() == Qt::RightButton && currentPoint ) { - if( m_pntArea.contains( e->x(), e->y() ) && ( currentPoint % 2 == 1 ) ) + if( m_pntArea.tqcontains( e->x(), e->y() ) && ( currentPoint % 2 == 1 ) ) { int x = e->x() - m_pntArea.left(); // check if we are still above the actual ramp point @@ -230,12 +230,12 @@ void VGradientWidget::mouseReleaseEvent( QMouseEvent* e ) } } } - setCursor( QCursor( Qt::ArrowCursor ) ); + setCursor( TQCursor( TQt::ArrowCursor ) ); } // VGradientWidget::mouseReleaseEvent -void VGradientWidget::mouseDoubleClickEvent( QMouseEvent* e ) +void VGradientWidget::mouseDoubleClickEvent( TQMouseEvent* e ) { - if( ! m_pntArea.contains( e->x(), e->y() ) ) + if( ! m_pntArea.tqcontains( e->x(), e->y() ) ) return; if( e->button() != Qt::LeftButton ) @@ -244,8 +244,8 @@ void VGradientWidget::mouseDoubleClickEvent( QMouseEvent* e ) if( currentPoint % 2 == 1 ) { // ramp point hit -> change color - VColorDlg* d = new VColorDlg( m_gradient->m_colorStops.at( currentPoint / 2 )->color, this->topLevelWidget() ); - if( d->exec() == QDialog::Accepted ) + VColorDlg* d = new VColorDlg( m_gradient->m_colorStops.at( currentPoint / 2 )->color, this->tqtopLevelWidget() ); + if( d->exec() == TQDialog::Accepted ) { m_gradient->m_colorStops.at( currentPoint / 2 )->color = d->Color(); update(); @@ -256,8 +256,8 @@ void VGradientWidget::mouseDoubleClickEvent( QMouseEvent* e ) else if( currentPoint == 0 ) { // now point hit -> create new color stop - VColorDlg* d = new VColorDlg( m_gradient->m_colorStops.at( 0 )->color, this->topLevelWidget() ); - if( d->exec() == QDialog::Accepted ) + VColorDlg* d = new VColorDlg( m_gradient->m_colorStops.at( 0 )->color, this->tqtopLevelWidget() ); + if( d->exec() == TQDialog::Accepted ) { m_gradient->addStop( d->Color(), (float)( e->x() - 2 ) / ( m_pntArea.width() ), 0.5 ); update(); @@ -267,12 +267,12 @@ void VGradientWidget::mouseDoubleClickEvent( QMouseEvent* e ) } } // VGradientWidget::mouseDoubleClickEvent -void VGradientWidget::mouseMoveEvent( QMouseEvent* e ) +void VGradientWidget::mouseMoveEvent( TQMouseEvent* e ) { if( e->state() & Qt::RightButton ) return; - QPtrList<VColorStop>& colorStops = m_gradient->m_colorStops; + TQPtrList<VColorStop>& colorStops = m_gradient->m_colorStops; if( currentPoint >= colorStops.count() * 2 ) return; |
