diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-07-05 06:00:29 +0000 |
commit | fecb0e67b23e8b83ba7fc881bb57bc48c0852d62 (patch) | |
tree | 6b8614802f0d01b353bc9ba78aff2090846c198e /libkdchart/KDChartWidget.cpp | |
parent | dadc34655c3ab961b0b0b94a10eaaba710f0b5e8 (diff) | |
download | kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.tar.gz kmymoney-fecb0e67b23e8b83ba7fc881bb57bc48c0852d62.zip |
TQt4 port kmymoney
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kmymoney@1239855 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'libkdchart/KDChartWidget.cpp')
-rw-r--r-- | libkdchart/KDChartWidget.cpp | 72 |
1 files changed, 36 insertions, 36 deletions
diff --git a/libkdchart/KDChartWidget.cpp b/libkdchart/KDChartWidget.cpp index 81164ea..00e4a45 100644 --- a/libkdchart/KDChartWidget.cpp +++ b/libkdchart/KDChartWidget.cpp @@ -34,7 +34,7 @@ #include "KDChartWidget.moc" #endif -#include <qpainter.h> +#include <tqpainter.h> /** \class KDChartWidget KDChartWidget.h @@ -49,7 +49,7 @@ \note If for some reason you are NOT using the KDChartWidget class but calling the painting methods of KDChart directly, you probably will also use the KDChartDataRegionList class: - This class is derived from QPtrList, so all of the Qt documentation + This class is derived from TQPtrList, so all of the TQt documentation for this class is valid for KDChartDataRegionList too, e.g. freeing of the pointers stored can either be done automatically or manually - so PLEASE take the time to read the reference information for this class! @@ -65,12 +65,12 @@ and setData before using this chart otherwise only a simple default bar chart will be shown. - \param parent the widget parent; passed on to QWidget - \param name the widget name; passed on to QWidget + \param tqparent the widget tqparent; passed on to TQWidget + \param name the widget name; passed on to TQWidget */ -KDChartWidget::KDChartWidget( QWidget* parent, const char* name ) : -QWidget( parent, name ), +KDChartWidget::KDChartWidget( TQWidget* tqparent, const char* name ) : +TQWidget( tqparent, name ), _params( 0 ), _data( 0 ), _activeData( false ), @@ -78,7 +78,7 @@ _mousePressedOnRegion( 0 ) { _dataRegions.setAutoDelete( true ); setDoubleBuffered( true ); - setBackgroundMode( Qt::NoBackground ); + setBackgroundMode( TQt::NoBackground ); } @@ -87,14 +87,14 @@ _mousePressedOnRegion( 0 ) \param params the specification of the chart \param data the data to be displayed as a chart - \param parent the widget parent; passed on to QWidget - \param name the widget name; passed on to QWidget + \param tqparent the widget tqparent; passed on to TQWidget + \param name the widget name; passed on to TQWidget */ KDChartWidget::KDChartWidget( KDChartParams* params, KDChartTableDataBase* data, - QWidget* parent, const char* name ) : -QWidget( parent, name ), + TQWidget* tqparent, const char* name ) : +TQWidget( tqparent, name ), _params( params ), _data( data ), _activeData( false ), @@ -102,7 +102,7 @@ _mousePressedOnRegion( 0 ) { _dataRegions.setAutoDelete( true ); setDoubleBuffered( true ); - setBackgroundMode( Qt::NoBackground ); + setBackgroundMode( TQt::NoBackground ); } @@ -116,14 +116,14 @@ KDChartWidget::~KDChartWidget() KDChartAutoColor::freeInstance(); } -void KDChartWidget::paintTo( QPainter& painter, - const QRect* rect ) +void KDChartWidget::paintTo( TQPainter& painter, + const TQRect* rect ) { KDChart::paint( &painter, _params, _data, &_dataRegions, rect ); } -void KDChartWidget::print( QPainter& painter, - const QRect* rect ) +void KDChartWidget::print( TQPainter& painter, + const TQRect* rect ) { bool oldOpt=true; if( _params ){ @@ -138,18 +138,18 @@ void KDChartWidget::print( QPainter& painter, _params->setOptimizeOutputForScreen( oldOpt ); } -void KDChartWidget::paintEvent( QPaintEvent* event ) +void KDChartWidget::paintEvent( TQPaintEvent* event ) { if( _doubleBuffered ) { // if double-buffering, paint onto the pixmap and copy // afterwards _buffer.fill( backgroundColor() ); - QPainter painter( &_buffer ); + TQPainter painter( &_buffer ); paintTo( painter ); bitBlt( this, event->rect().topLeft(), &_buffer, event->rect() ); } else { // if not double-buffering, paint directly into the window - QPainter painter( this ); + TQPainter painter( this ); paintTo( painter ); } } @@ -158,22 +158,22 @@ void KDChartWidget::paintEvent( QPaintEvent* event ) /** \internal */ -void KDChartWidget::mousePressEvent( QMouseEvent* event ) +void KDChartWidget::mousePressEvent( TQMouseEvent* event ) { if ( !_activeData ) return ; _mousePressedOnRegion = 0; KDChartDataRegion* current = 0; - //QPtrListIterator < KDChartDataRegion > it( _dataRegions ); + //TQPtrListIterator < KDChartDataRegion > it( _dataRegions ); for( current = _dataRegions.last(); current; current = _dataRegions.prev() ){ //while ( ( current = it.current() ) ) { - if ( current->contains( event->pos() ) ) { + if ( current->tqcontains( event->pos() ) ) { _mousePressedOnRegion = current; - if ( event->button() == LeftButton ){ + if ( event->button() == Qt::LeftButton ){ emit dataLeftPressed( current->row, current->col ); emit dataLeftPressed( event->pos() ); - }else if ( event->button() == MidButton ){ + }else if ( event->button() == Qt::MidButton ){ emit dataMiddlePressed( current->row, current->col ); emit dataMiddlePressed( event->pos() ); }else{ @@ -189,24 +189,24 @@ void KDChartWidget::mousePressEvent( QMouseEvent* event ) /** \internal */ -void KDChartWidget::mouseReleaseEvent( QMouseEvent* event ) +void KDChartWidget::mouseReleaseEvent( TQMouseEvent* event ) { if ( !_activeData ) return ; KDChartDataRegion* current = 0; - QPtrListIterator < KDChartDataRegion > it( _dataRegions ); + TQPtrListIterator < KDChartDataRegion > it( _dataRegions ); while ( ( current = it.current() ) ) { ++it; - if ( current->contains( event->pos() ) ) { - if ( event->button() == LeftButton ) { + if ( current->tqcontains( event->pos() ) ) { + if ( event->button() == Qt::LeftButton ) { emit dataLeftReleased( current->row, current->col ); emit dataLeftReleased( event->pos() ); if ( _mousePressedOnRegion == current ){ emit dataLeftClicked( current->row, current->col ); emit dataLeftClicked( event->pos() ); } - } else if ( event->button() == MidButton ) { + } else if ( event->button() == Qt::MidButton ) { emit dataMiddleReleased( current->row, current->col ); emit dataMiddleReleased( event->pos() ); if ( _mousePressedOnRegion == current ){ @@ -229,7 +229,7 @@ void KDChartWidget::mouseReleaseEvent( QMouseEvent* event ) /** \internal */ -void KDChartWidget::resizeEvent( QResizeEvent* /*event*/ ) +void KDChartWidget::resizeEvent( TQResizeEvent* /*event*/ ) { // if we use double-buffering, resize the buffer to the new size, // otherwise leave it alone @@ -244,8 +244,8 @@ void KDChartWidget::resizeEvent( QResizeEvent* /*event*/ ) display process, so this is turned off by default. If active data reporting is turned on when the widget is already - shown, data will be reported after the next repaint(). Call - repaint() explicitly if necessary. + shown, data will be reported after the next tqrepaint(). Call + tqrepaint() explicitly if necessary. Active data is currently supported for bar, pie, and line charts (the latter only with markers, as trying to hit the line would be @@ -281,7 +281,7 @@ bool KDChartWidget::isActiveData() const needs to be kept around. However, in most cases, it is worth spending the extra memory. Double-buffering is on by default. Turning double-buffering on or off does not trigger a - repaint. + tqrepaint. \param doublebuffered if true, turns double-buffering on, if false, turns double-buffering off @@ -401,7 +401,7 @@ KDChartTableDataBase* KDChartWidget::data() const */ /** - \fn void KDChartWidget::dataLeftClicked( const QPoint & pnt ) + \fn void KDChartWidget::dataLeftClicked( const TQPoint & pnt ) This signal is emitted when a data item was clicked onto with the left mouse button. @@ -413,7 +413,7 @@ KDChartTableDataBase* KDChartWidget::data() const \sa dataRightClicked, dataMiddleClicked */ /** - \fn void KDChartWidget::dataRightClicked( const QPoint & pnt ) + \fn void KDChartWidget::dataRightClicked( const TQPoint & pnt ) This signal is emitted when a data item was clicked onto with the right mouse button. @@ -425,7 +425,7 @@ KDChartTableDataBase* KDChartWidget::data() const \sa dataLeftClicked, dataMiddleClicked */ /** - \fn void KDChartWidget::dataMiddleClicked( const QPoint & pnt ) + \fn void KDChartWidget::dataMiddleClicked( const TQPoint & pnt ) This signal is emitted when a data item was clicked onto with the middle mouse button. |