diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-08-02 19:23:46 +0000 |
commit | eba47f8f0637f451e21348187591e1f1fd58ac74 (patch) | |
tree | 448f10b95c656604acc331a3236c1e59bde5c1ad /kview/kviewcanvas | |
parent | c7e8736c69373f48b0401319757c742e8607431a (diff) | |
download | tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.tar.gz tdegraphics-eba47f8f0637f451e21348187591e1f1fd58ac74.zip |
TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdegraphics@1158446 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kview/kviewcanvas')
-rw-r--r-- | kview/kviewcanvas/config/confmodules.cpp | 44 | ||||
-rw-r--r-- | kview/kviewcanvas/config/confmodules.h | 8 | ||||
-rw-r--r-- | kview/kviewcanvas/config/defaults.h | 10 | ||||
-rw-r--r-- | kview/kviewcanvas/kimagecanvas.cpp | 152 | ||||
-rw-r--r-- | kview/kviewcanvas/kimagecanvas.h | 96 | ||||
-rw-r--r-- | kview/kviewcanvas/kimageholder.cpp | 68 | ||||
-rw-r--r-- | kview/kviewcanvas/kimageholder.h | 54 | ||||
-rw-r--r-- | kview/kviewcanvas/test/test.cpp | 8 |
8 files changed, 220 insertions, 220 deletions
diff --git a/kview/kviewcanvas/config/confmodules.cpp b/kview/kviewcanvas/config/confmodules.cpp index c5e47dac..4ecf07b9 100644 --- a/kview/kviewcanvas/config/confmodules.cpp +++ b/kview/kviewcanvas/config/confmodules.cpp @@ -20,9 +20,9 @@ #include "generalconfigwidget.h" #include "defaults.h" -#include <qlayout.h> -#include <qcheckbox.h> -#include <qframe.h> +#include <tqlayout.h> +#include <tqcheckbox.h> +#include <tqframe.h> #include <klocale.h> #include <ksimpleconfig.h> @@ -31,14 +31,14 @@ #include <knuminput.h> #include <kgenericfactory.h> -typedef KGenericFactory<KViewCanvasConfig, QWidget> KViewCanvasConfigFactory; +typedef KGenericFactory<KViewCanvasConfig, TQWidget> KViewCanvasConfigFactory; K_EXPORT_COMPONENT_FACTORY( kcm_kviewcanvasconfig, KViewCanvasConfigFactory( "kcm_kviewcanvasconfig" ) ) -KViewCanvasConfig::KViewCanvasConfig( QWidget * parent, const char *, const QStringList & args ) +KViewCanvasConfig::KViewCanvasConfig( TQWidget * parent, const char *, const TQStringList & args ) : KCModule( KViewCanvasConfigFactory::instance(), parent, args ) , m_config( new KConfig( "kviewcanvasrc" ) ) { - QBoxLayout * layout = new QVBoxLayout( this ); + TQBoxLayout * layout = new TQVBoxLayout( this ); layout->setAutoAdd( true ); m_pWidget = new GeneralConfigWidget( this ); @@ -52,21 +52,21 @@ KViewCanvasConfig::KViewCanvasConfig( QWidget * parent, const char *, const QStr for( unsigned int i = 1; i <= Defaults::numOfBlendEffects; ++i ) { - QCheckListItem * item = new QCheckListItem( m_pWidget->m_pListView, i18n( Defaults::blendEffectDescription[ i ] ), QCheckListItem::CheckBox ); + TQCheckListItem * item = new TQCheckListItem( m_pWidget->m_pListView, i18n( Defaults::blendEffectDescription[ i ] ), TQCheckListItem::CheckBox ); m_items.append( item ); } - connect( m_pWidget->m_pListView, SIGNAL( clicked( QListViewItem * ) ), this, SLOT( configChanged() ) ); - connect( m_pWidget->m_pListView, SIGNAL( spacePressed( QListViewItem * ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pListView, TQT_SIGNAL( clicked( TQListViewItem * ) ), this, TQT_SLOT( configChanged() ) ); + connect( m_pWidget->m_pListView, TQT_SIGNAL( spacePressed( TQListViewItem * ) ), this, TQT_SLOT( configChanged() ) ); - connect( m_pWidget->m_pSmoothScaling, SIGNAL( toggled( bool ) ), this, SLOT( configChanged() ) ); - connect( m_pWidget->m_pKeepRatio, SIGNAL( toggled( bool ) ), this, SLOT( configChanged() ) ); - connect( m_pWidget->m_pCenterImage, SIGNAL( toggled( bool ) ), this, SLOT( configChanged() ) ); - connect( m_pWidget->m_bgColor, SIGNAL( changed( const QColor & ) ), this, SLOT( configChanged() ) ); - connect( m_pWidget->m_pMinWidth, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); - connect( m_pWidget->m_pMaxWidth, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); - connect( m_pWidget->m_pMinHeight, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); - connect( m_pWidget->m_pMaxHeight, SIGNAL( valueChanged( int ) ), this, SLOT( configChanged() ) ); + connect( m_pWidget->m_pSmoothScaling, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( configChanged() ) ); + connect( m_pWidget->m_pKeepRatio, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( configChanged() ) ); + connect( m_pWidget->m_pCenterImage, TQT_SIGNAL( toggled( bool ) ), this, TQT_SLOT( configChanged() ) ); + connect( m_pWidget->m_bgColor, TQT_SIGNAL( changed( const TQColor & ) ), this, TQT_SLOT( configChanged() ) ); + connect( m_pWidget->m_pMinWidth, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( configChanged() ) ); + connect( m_pWidget->m_pMaxWidth, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( configChanged() ) ); + connect( m_pWidget->m_pMinHeight, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( configChanged() ) ); + connect( m_pWidget->m_pMaxHeight, TQT_SIGNAL( valueChanged( int ) ), this, TQT_SLOT( configChanged() ) ); load(); } @@ -90,9 +90,9 @@ void KViewCanvasConfig::save() cfgGroup.writeEntry( "Maximum Height", m_pWidget->m_pMaxHeight->value() ); KConfigGroup cfgGroup2( m_config, "Blend Effects" ); - QCheckListItem *item = m_items.first(); + TQCheckListItem *item = m_items.first(); for( int i = 1; item; item = m_items.next(), ++i ) - cfgGroup2.writeEntry( QString::number( i ), item->isOn() ); + cfgGroup2.writeEntry( TQString::number( i ), item->isOn() ); m_config->sync(); } @@ -111,9 +111,9 @@ void KViewCanvasConfig::load() m_pWidget->m_pMaxHeight->setValue( cfgGroup.readNumEntry( "Maximum Height", Defaults::maxSize.height() ) ); KConfigGroup cfgGroup2( m_config, "Blend Effects" ); - QCheckListItem * item = m_items.first(); + TQCheckListItem * item = m_items.first(); for( int i = 1; item; item = m_items.next(), ++i ) - item->setOn( cfgGroup2.readBoolEntry( QString::number( i ), false ) ); + item->setOn( cfgGroup2.readBoolEntry( TQString::number( i ), false ) ); } void KViewCanvasConfig::defaults() @@ -129,7 +129,7 @@ void KViewCanvasConfig::defaults() m_pWidget->m_pMaxWidth ->setValue( Defaults::maxSize.width() ); m_pWidget->m_pMaxHeight->setValue( Defaults::maxSize.height() ); - QCheckListItem * item = m_items.first(); + TQCheckListItem * item = m_items.first(); for( int i = 1; item; item = m_items.next(), ++i ) item->setOn( false ); emit changed( true ); diff --git a/kview/kviewcanvas/config/confmodules.h b/kview/kviewcanvas/config/confmodules.h index f7dfe262..e513a9cd 100644 --- a/kview/kviewcanvas/config/confmodules.h +++ b/kview/kviewcanvas/config/confmodules.h @@ -20,17 +20,17 @@ #define CONFMODULES_H #include <kcmodule.h> -#include <qptrlist.h> +#include <tqptrlist.h> class GeneralConfigWidget; -class QCheckListItem; +class TQCheckListItem; class KConfig; class KViewCanvasConfig : public KCModule { Q_OBJECT public: - KViewCanvasConfig( QWidget * parent, const char * name = 0, const QStringList & args = QStringList() ); + KViewCanvasConfig( TQWidget * parent, const char * name = 0, const TQStringList & args = TQStringList() ); ~KViewCanvasConfig(); void load(); @@ -43,7 +43,7 @@ class KViewCanvasConfig : public KCModule private: KConfig * m_config; GeneralConfigWidget * m_pWidget; - QPtrList<QCheckListItem> m_items; + TQPtrList<TQCheckListItem> m_items; }; // vim:sw=4:ts=4 diff --git a/kview/kviewcanvas/config/defaults.h b/kview/kviewcanvas/config/defaults.h index 0a92d651..02abbb19 100644 --- a/kview/kviewcanvas/config/defaults.h +++ b/kview/kviewcanvas/config/defaults.h @@ -20,16 +20,16 @@ #define DEFAULTS_H #include <klocale.h> -#include <qsize.h> -#include <qcolor.h> +#include <tqsize.h> +#include <tqcolor.h> namespace Defaults { static const bool smoothScaling = false; static const bool keepAspectRatio = true; static const bool centerImage = true; - static const QColor bgColor( Qt::black ); - static const QSize minSize( 1, 1 ); - static const QSize maxSize( 10000, 10000 ); + static const TQColor bgColor( Qt::black ); + static const TQSize minSize( 1, 1 ); + static const TQSize maxSize( 10000, 10000 ); static const unsigned int numOfBlendEffects = 4; static const char * blendEffectDescription[ 6 ] = { I18N_NOOP( "No Blending" ), diff --git a/kview/kviewcanvas/kimagecanvas.cpp b/kview/kviewcanvas/kimagecanvas.cpp index 6c54850f..97001670 100644 --- a/kview/kviewcanvas/kimagecanvas.cpp +++ b/kview/kviewcanvas/kimagecanvas.cpp @@ -21,11 +21,11 @@ #include "version.h" #include "config/defaults.h" -#include <qcolor.h> -#include <qimage.h> -#include <qapplication.h> -#include <qwmatrix.h> -#include <qtimer.h> +#include <tqcolor.h> +#include <tqimage.h> +#include <tqapplication.h> +#include <tqwmatrix.h> +#include <tqtimer.h> #include <kpixmap.h> #include <kdebug.h> @@ -43,14 +43,14 @@ typedef KGenericFactory<KImageCanvas> KImageCanvasFactory; K_EXPORT_COMPONENT_FACTORY( libkviewcanvas, KImageCanvasFactory( "kviewcanvas" ) ) -KImageCanvas::KImageCanvas( QWidget * parent, const char * name, const QStringList & ) - : QScrollView( parent, name, WResizeNoErase | WStaticContents ) +KImageCanvas::KImageCanvas( TQWidget * parent, const char * name, const TQStringList & ) + : TQScrollView( parent, name, WResizeNoErase | WStaticContents ) , m_client( 0 ) , m_oldClient( 0 ) , m_image( 0 ) , m_imageTransformed( 0 ) , m_pixmap( 0 ) - , m_pTimer( new QTimer( this, "KImageCanvas/Timer" ) ) + , m_pTimer( new TQTimer( this, "KImageCanvas/Timer" ) ) , m_maxsize( Defaults::maxSize ) , m_minsize( Defaults::minSize ) , m_currentsize( 0, 0 ) @@ -66,22 +66,22 @@ KImageCanvas::KImageCanvas( QWidget * parent, const char * name, const QStringLi , m_iBlendTimerId( 0 ) { kdDebug( 4620 ) << k_funcinfo << endl; - setFrameStyle( QFrame::NoFrame ); - setResizePolicy( QScrollView::Manual ); + setFrameStyle( TQFrame::NoFrame ); + setResizePolicy( TQScrollView::Manual ); setMinimumSize( 0, 0 ); setBgColor( Defaults::bgColor ); - connect( this, SIGNAL( imageChanged() ), this, SLOT( slotImageChanged() ) ); - connect( m_pTimer, SIGNAL( timeout() ), this, SLOT( hideCursor() ) ); + connect( this, TQT_SIGNAL( imageChanged() ), this, TQT_SLOT( slotImageChanged() ) ); + connect( m_pTimer, TQT_SIGNAL( timeout() ), this, TQT_SLOT( hideCursor() ) ); KSettings::Dispatcher::self()->registerInstance( KImageCanvasFactory::instance(), this, - SLOT( loadSettings() ) ); + TQT_SLOT( loadSettings() ) ); viewport()->setFocusProxy( this ); clear(); - QWidget::setMouseTracking( true ); + TQWidget::setMouseTracking( true ); viewport()->setMouseTracking( true ); m_cursor.setShape( Qt::CrossCursor ); viewport()->setCursor( m_cursor ); @@ -97,7 +97,7 @@ KImageCanvas::~KImageCanvas() delete m_pixmap; m_pixmap = 0; } -void KImageCanvas::setBgColor( const QColor & color ) +void KImageCanvas::setBgColor( const TQColor & color ) { kdDebug( 4620 ) << k_funcinfo << endl; viewport()->setPaletteBackgroundColor( color ); @@ -105,7 +105,7 @@ void KImageCanvas::setBgColor( const QColor & color ) m_client->setPaletteBackgroundColor( color ); } -const QColor & KImageCanvas::bgColor() const +const TQColor & KImageCanvas::bgColor() const { kdDebug( 4620 ) << k_funcinfo << endl; return viewport()->paletteBackgroundColor(); @@ -120,38 +120,38 @@ int KImageCanvas::imageDepth() const return m_image->depth(); } -QSize KImageCanvas::imageSize() const +TQSize KImageCanvas::imageSize() const { //kdDebug( 4620 ) << k_funcinfo << endl; if( ! m_image ) - return QSize( 0, 0 ); + return TQSize( 0, 0 ); - return m_matrix.isIdentity() ? m_image->size() : m_matrix.mapRect( QRect( QPoint(), m_image->size() ) ).size(); + return m_matrix.isIdentity() ? m_image->size() : m_matrix.mapRect( TQRect( TQPoint(), m_image->size() ) ).size(); } -QSize KImageCanvas::currentSize() const +TQSize KImageCanvas::currentSize() const { kdDebug( 4620 ) << k_funcinfo << endl; if( ! m_image ) - return QSize( 0, 0 ); + return TQSize( 0, 0 ); return m_currentsize; } -const QImage * KImageCanvas::image() const +const TQImage * KImageCanvas::image() const { if( m_imageTransformed ) return m_imageTransformed; return m_image; } -QRect KImageCanvas::selection() const +TQRect KImageCanvas::selection() const { kdDebug( 4620 ) << k_funcinfo << endl; if( m_client ) return m_selection; else - return QRect(); + return TQRect(); } void KImageCanvas::setCentered( bool centered ) @@ -164,13 +164,13 @@ void KImageCanvas::setCentered( bool centered ) } } -void KImageCanvas::setImage( const QImage & newimage ) +void KImageCanvas::setImage( const TQImage & newimage ) { bool emitHasImage = m_image ? false : true; m_matrix.reset(); matrixChanged(); delete m_image; - m_image = new QImage( newimage ); + m_image = new TQImage( newimage ); m_bNewImage = true; // don't emit the signal here - call the slot directly slotImageChanged(); @@ -181,14 +181,14 @@ void KImageCanvas::setImage( const QImage & newimage ) emit hasImage( true ); } -void KImageCanvas::setImage( const QImage & newimage, const QSize & size ) +void KImageCanvas::setImage( const TQImage & newimage, const TQSize & size ) { kdDebug( 4620 ) << k_funcinfo << size << endl; bool emitHasImage = m_image ? false : true; m_matrix.reset(); matrixChanged(); delete m_image; - m_image = new QImage( newimage ); + m_image = new TQImage( newimage ); m_bNewImage = true; // don't emit the signal here - call the slot directly slotImageChanged(); @@ -214,7 +214,7 @@ void KImageCanvas::setZoom( double zoom ) } } -void KImageCanvas::boundImageTo( const QSize & size ) +void KImageCanvas::boundImageTo( const TQSize & size ) { bool keepAspectRatio = m_keepaspectratio; m_keepaspectratio = true; @@ -222,7 +222,7 @@ void KImageCanvas::boundImageTo( const QSize & size ) m_keepaspectratio = keepAspectRatio; } -void KImageCanvas::setMaximumImageSize( const QSize & maxsize ) +void KImageCanvas::setMaximumImageSize( const TQSize & maxsize ) { kdDebug( 4620 ) << k_funcinfo << maxsize << endl; if( ( ! m_minsize.isEmpty() ) && @@ -237,7 +237,7 @@ void KImageCanvas::setMaximumImageSize( const QSize & maxsize ) resizeImage( m_currentsize ); } -void KImageCanvas::setMinimumImageSize( const QSize & minsize ) +void KImageCanvas::setMinimumImageSize( const TQSize & minsize ) { kdDebug( 4620 ) << k_funcinfo << minsize << endl; if( ( ! m_maxsize.isEmpty() ) && @@ -252,13 +252,13 @@ void KImageCanvas::setMinimumImageSize( const QSize & minsize ) resizeImage( m_currentsize ); } -void KImageCanvas::resizeImage( const QSize & newsize ) +void KImageCanvas::resizeImage( const TQSize & newsize ) { kdDebug( 4620 ) << k_funcinfo << endl; if( m_image == 0 ) return; - QSize size = newsize; + TQSize size = newsize; // check that it fits into min and max sizes checkBounds( size ); @@ -301,7 +301,7 @@ unsigned int KImageCanvas::numOfBlendEffects() const return Defaults::numOfBlendEffects; } -QString KImageCanvas::blendEffectDescription( unsigned int idx ) const +TQString KImageCanvas::blendEffectDescription( unsigned int idx ) const { kdDebug( 4620 ) << k_funcinfo << endl; switch( idx ) @@ -321,14 +321,14 @@ QString KImageCanvas::blendEffectDescription( unsigned int idx ) const return i18n( Defaults::blendEffectDescription[ 4 ] ); } kdError( 4620 ) << "Effect description for effect with index " << idx << " doesn't exist\n"; - return QString::null; + return TQString::null; } -bool KImageCanvas::eventFilter( QObject * obj, QEvent * ev ) +bool KImageCanvas::eventFilter( TQObject * obj, TQEvent * ev ) { - if( ( obj == m_client || obj == m_oldClient ) && ev->type() == QEvent::MouseMove ) - mouseMoveEvent( static_cast<QMouseEvent*>( ev ) ); - return QScrollView::eventFilter( obj, ev ); + if( ( obj == m_client || obj == m_oldClient ) && ev->type() == TQEvent::MouseMove ) + mouseMoveEvent( static_cast<TQMouseEvent*>( ev ) ); + return TQScrollView::eventFilter( obj, ev ); } void KImageCanvas::setFastScale( bool fastscale ) @@ -370,7 +370,7 @@ void KImageCanvas::flipHorizontal( bool change ) if( change ) { - QWMatrix matrix( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); + TQWMatrix matrix( 1.0F, 0.0F, 0.0F, -1.0F, 0.0F, 0.0F ); *m_image = m_image->xForm( matrix ); emit imageChanged(); } @@ -391,7 +391,7 @@ void KImageCanvas::flipVertical( bool change ) if( change ) { - QWMatrix matrix( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); + TQWMatrix matrix( -1.0F, 0.0F, 0.0F, 1.0F, 0.0F, 0.0F ); *m_image = m_image->xForm( matrix ); emit imageChanged(); } @@ -412,7 +412,7 @@ void KImageCanvas::rotate( double a, bool change ) if( change ) { - QWMatrix matrix; + TQWMatrix matrix; matrix.rotate( a ); *m_image = m_image->xForm( matrix ); emit imageChanged(); @@ -427,13 +427,13 @@ void KImageCanvas::rotate( double a, bool change ) updateImage(); } -void KImageCanvas::checkBounds( QSize & newsize ) +void KImageCanvas::checkBounds( TQSize & newsize ) { kdDebug( 4620 ) << k_funcinfo << endl; if( m_keepaspectratio ) { // check that the new size has the same aspect ratio the original image had - QSize origsize = imageSize(); + TQSize origsize = imageSize(); double x1 = double( origsize.height() ) / double( newsize.height() ); double x2 = double( origsize.width() ) / double( newsize.width() ); if( ( newsize * x1 != origsize ) || ( newsize * x2 != origsize ) ) @@ -485,13 +485,13 @@ void KImageCanvas::checkBounds( QSize & newsize ) } } -void KImageCanvas::zoomFromSize( const QSize & newsize ) +void KImageCanvas::zoomFromSize( const TQSize & newsize ) { kdDebug( 4620 ) << k_funcinfo << endl; if( ! m_image ) return; - QSize originalsize = imageSize(); + TQSize originalsize = imageSize(); double widthzoom = double( newsize.width() ) / double( originalsize.width() ); double heightzoom = double( newsize.height() ) / double( originalsize.height() ); double zoom = ( widthzoom + heightzoom ) / 2; @@ -508,7 +508,7 @@ void KImageCanvas::sizeFromZoom( double zoom ) if( ! m_image ) return; - QSize newsize = zoom * imageSize(); + TQSize newsize = zoom * imageSize(); kdDebug( 4620 ) << "change size from " << imageSize() << " to " << newsize << endl; resizeImage( newsize ); } @@ -517,7 +517,7 @@ void KImageCanvas::updateImage() { kdDebug( 4620 ) << k_funcinfo << endl; if( ! m_bImageUpdateScheduled ) - QTimer::singleShot( 0, this, SLOT( slotUpdateImage() ) ); + TQTimer::singleShot( 0, this, TQT_SLOT( slotUpdateImage() ) ); m_bImageUpdateScheduled = true; } @@ -532,7 +532,7 @@ void KImageCanvas::slotUpdateImage() if( m_bImageChanged || m_bSizeChanged || m_bMatrixChanged ) { kdDebug( 4620 ) << "actually updating the image now" << endl; - QApplication::setOverrideCursor( WaitCursor ); + TQApplication::setOverrideCursor( WaitCursor ); if( m_bNewImage || ! m_client ) { finishNewClient(); @@ -543,14 +543,14 @@ void KImageCanvas::slotUpdateImage() if( m_bSizeChanged || m_bNewImage ) { - QSize sh = m_client->sizeHint(); + TQSize sh = m_client->sizeHint(); if( ! sh.isValid() ) - sh = QSize( 0, 0 ); + sh = TQSize( 0, 0 ); m_client->resize( sh ); resizeContents( sh.width(), sh.height() ); center(); } - QRect drawRect = m_client->drawRect(); + TQRect drawRect = m_client->drawRect(); switch( m_iBlendEffect ) { case NoBlending: @@ -576,7 +576,7 @@ void KImageCanvas::slotUpdateImage() } m_client->update(); m_iBlendTimerId = startTimer( 5 ); - QApplication::restoreOverrideCursor(); + TQApplication::restoreOverrideCursor(); } m_bNewImage = false; @@ -585,7 +585,7 @@ void KImageCanvas::slotUpdateImage() m_bMatrixChanged = false; } -void KImageCanvas::mouseMoveEvent( QMouseEvent * ) +void KImageCanvas::mouseMoveEvent( TQMouseEvent * ) { if( m_cursor.shape() == Qt::BlankCursor ) { @@ -598,21 +598,21 @@ void KImageCanvas::mouseMoveEvent( QMouseEvent * ) } -void KImageCanvas::resizeEvent( QResizeEvent * ev ) +void KImageCanvas::resizeEvent( TQResizeEvent * ev ) { kdDebug( 4620 ) << "KImageCanvas resized to " << ev->size() << endl; - QScrollView::resizeEvent( ev ); + TQScrollView::resizeEvent( ev ); center(); } -void KImageCanvas::contentsMousePressEvent( QMouseEvent * ev ) +void KImageCanvas::contentsMousePressEvent( TQMouseEvent * ev ) { if ( ev->button() == RightButton ) emit contextPress( ev->globalPos() ); - QScrollView::contentsMousePressEvent( ev ); + TQScrollView::contentsMousePressEvent( ev ); } -void KImageCanvas::contentsWheelEvent( QWheelEvent * ev ) +void KImageCanvas::contentsWheelEvent( TQWheelEvent * ev ) { //kdDebug( 4620 ) << k_funcinfo << endl; // Ctrl+Wheelmouse changes the zoom. @@ -673,10 +673,10 @@ void KImageCanvas::contentsWheelEvent( QWheelEvent * ev ) setFastScale( oldscale ); } else - QScrollView::contentsWheelEvent( ev ); + TQScrollView::contentsWheelEvent( ev ); } -void KImageCanvas::keyPressEvent( QKeyEvent * ev ) +void KImageCanvas::keyPressEvent( TQKeyEvent * ev ) { //kdDebug( 4620 ) << k_funcinfo << endl; switch( ev->key() ) @@ -711,11 +711,11 @@ void KImageCanvas::keyPressEvent( QKeyEvent * ev ) } } -void KImageCanvas::timerEvent( QTimerEvent * ev ) +void KImageCanvas::timerEvent( TQTimerEvent * ev ) { if( ev->timerId() == m_iBlendTimerId ) { - QRect drawRect = m_client->drawRect(); + TQRect drawRect = m_client->drawRect(); switch( m_iBlendEffect ) { case NoBlending: @@ -795,7 +795,7 @@ const KPixmap KImageCanvas::pixmap() { delete m_imageTransformed; // we create a new image transformed by the matrix - m_imageTransformed = new QImage( m_matrix.isIdentity() ? *m_image : m_image->xForm( m_matrix ) ); + m_imageTransformed = new TQImage( m_matrix.isIdentity() ? *m_image : m_image->xForm( m_matrix ) ); kdDebug( 4620 ) << "Size of m_image: " << m_image->size() << endl; kdDebug( 4620 ) << "Size of m_imageTransformed: " << m_imageTransformed->size() << endl; } @@ -806,7 +806,7 @@ const KPixmap KImageCanvas::pixmap() if( m_fastscale ) { // fast scaling is needed so we need to scale now - QWMatrix matrix( m_matrix ); + TQWMatrix matrix( m_matrix ); matrix.scale( m_zoom, m_zoom ); if( ! matrix.isIdentity() ) return m_pixmap->xForm( matrix ); @@ -832,10 +832,10 @@ void KImageCanvas::loadSettings() setBgColor( cfgGroup.readColorEntry( "Background Color", &bgColor() ) ); - setMinimumImageSize( QSize( cfgGroup.readNumEntry( "Minimum Width", + setMinimumImageSize( TQSize( cfgGroup.readNumEntry( "Minimum Width", minimumImageSize().width() ), cfgGroup.readNumEntry( "Minimum Height", minimumImageSize().height() ) ) ); - setMaximumImageSize( QSize( cfgGroup.readNumEntry( "Maximum Width", + setMaximumImageSize( TQSize( cfgGroup.readNumEntry( "Maximum Width", maximumImageSize().width() ), cfgGroup.readNumEntry( "Maximum Height", maximumImageSize().height() ) ) ); @@ -845,7 +845,7 @@ void KImageCanvas::loadSettings() m_vEffects.clear(); for( unsigned int i = 1; i <= numOfBlendEffects(); ++i ) { - if( blendConfig.readBoolEntry( QString::number( i ), false ) ) + if( blendConfig.readBoolEntry( TQString::number( i ), false ) ) m_vEffects.push_back( i ); } // and now tell the canvas what blend effect to use @@ -853,7 +853,7 @@ void KImageCanvas::loadSettings() */ } -void KImageCanvas::selected( const QRect & rect ) +void KImageCanvas::selected( const TQRect & rect ) { //kdDebug( 4620 ) << k_funcinfo << rect << endl; m_selection = rect; @@ -868,9 +868,9 @@ void KImageCanvas::selected( const QRect & rect ) emit selectionChanged( m_selection ); } -void KImageCanvas::mapCursorPos( const QPoint & pos ) +void KImageCanvas::mapCursorPos( const TQPoint & pos ) { - QPoint mapped( static_cast<int>( ( pos.x() + 0.5 ) / m_zoom ), static_cast<int>( ( pos.y() + 0.5 ) / m_zoom ) ); + TQPoint mapped( static_cast<int>( ( pos.x() + 0.5 ) / m_zoom ), static_cast<int>( ( pos.y() + 0.5 ) / m_zoom ) ); //kdDebug( 4620 ) << k_funcinfo << pos << " -> " << mapped << endl; emit cursorPos( mapped ); } @@ -935,15 +935,15 @@ KImageHolder * KImageCanvas::createNewClient() client->setMouseTracking( true ); client->installEventFilter( this ); setFocusProxy( client ); - client->setFocusPolicy( QWidget::StrongFocus ); + client->setFocusPolicy( TQWidget::StrongFocus ); client->setFocus(); addChild( client, 0, 0 ); - connect( client, SIGNAL( contextPress( const QPoint& ) ), SIGNAL( contextPress( const QPoint& ) ) ); - connect( client, SIGNAL( cursorPos( const QPoint & ) ), SLOT( mapCursorPos( const QPoint & ) ) ); - connect( client, SIGNAL( selected( const QRect & ) ), SLOT( selected( const QRect & ) ) ); - connect( client, SIGNAL( wannaScroll( int, int ) ), SLOT( scrollBy( int, int ) ) ); + connect( client, TQT_SIGNAL( contextPress( const TQPoint& ) ), TQT_SIGNAL( contextPress( const TQPoint& ) ) ); + connect( client, TQT_SIGNAL( cursorPos( const TQPoint & ) ), TQT_SLOT( mapCursorPos( const TQPoint & ) ) ); + connect( client, TQT_SIGNAL( selected( const TQRect & ) ), TQT_SLOT( selected( const TQRect & ) ) ); + connect( client, TQT_SIGNAL( wannaScroll( int, int ) ), TQT_SLOT( scrollBy( int, int ) ) ); return client; } diff --git a/kview/kviewcanvas/kimagecanvas.h b/kview/kviewcanvas/kimagecanvas.h index 8a0bffda..04934c74 100644 --- a/kview/kviewcanvas/kimagecanvas.h +++ b/kview/kviewcanvas/kimagecanvas.h @@ -22,16 +22,16 @@ #include "kimageviewer/canvas.h" -#include <qscrollview.h> -#include <qwmatrix.h> -#include <qcursor.h> -#include <qrect.h> +#include <tqscrollview.h> +#include <tqwmatrix.h> +#include <tqcursor.h> +#include <tqrect.h> #include <kdemacros.h> class KImageHolder; -class QColor; -class QImage; +class TQColor; +class TQImage; class KPixmap; /** @@ -39,14 +39,14 @@ class KPixmap; * @author Matthias Kretz <[email protected]> * @version $Id$ */ -class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas +class KDE_EXPORT KImageCanvas : public TQScrollView, public KImageViewer::Canvas { Q_OBJECT public: /** * KImageCanvas Constructor */ - KImageCanvas( QWidget * parent, const char * name, const QStringList & args ); + KImageCanvas( TQWidget * parent, const char * name, const TQStringList & args ); /** * KImageCanvas Destructor @@ -56,12 +56,12 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas /** * set the background color of the canvas */ - void setBgColor( const QColor & ); + void setBgColor( const TQColor & ); /** * returns the current background color */ - const QColor & bgColor() const; + const TQColor & bgColor() const; /** * the depth of the contained image @@ -71,12 +71,12 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas /** * the size of the unzoomed image */ - QSize imageSize() const; + TQSize imageSize() const; /** * the size of the zoomed (current) image */ - QSize currentSize() const; + TQSize currentSize() const; /** * returns the zoom factor @@ -86,7 +86,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas /** * returns the current (unzoomed) image */ - const QImage * image() const; + const TQImage * image() const; /** * Scrolls the content so that the point (x, y) is in the top-left corner. @@ -116,7 +116,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas /** * Return the selected rectangle */ - QRect selection() const; + TQRect selection() const; /** * Returns whether the aspect ratio of the image is kept @@ -131,30 +131,30 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas /** * @return the description of the blend effect */ - QString blendEffectDescription( unsigned int ) const; + TQString blendEffectDescription( unsigned int ) const; /** * @return the current maximum image size */ - const QSize & maximumImageSize() const { return m_maxsize; } + const TQSize & maximumImageSize() const { return m_maxsize; } /** * @return the current minimum image size */ - const QSize & minimumImageSize() const { return m_minsize; } + const TQSize & minimumImageSize() const { return m_minsize; } /** - * @return a pointer to the QWidget interface of this object + * @return a pointer to the TQWidget interface of this object */ - QWidget * widget() { return static_cast<QWidget *>( this ); } + TQWidget * widget() { return static_cast<TQWidget *>( this ); } - bool eventFilter( QObject *, QEvent * ); + bool eventFilter( TQObject *, TQEvent * ); signals: /** * a mouse button was pressed and a context menu should be openend */ - void contextPress( const QPoint& ); + void contextPress( const TQPoint& ); /** * the size of the image has changed (a new image was loaded, or the @@ -162,7 +162,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas * * it passes the new size of the image */ - void imageSizeChanged( const QSize & ); + void imageSizeChanged( const TQSize & ); /** * The zoom of the image has changed. @@ -173,7 +173,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas * The selection has changed. Connect to this signal if you want to * do something with a selection of the image (e.g. crop). */ - void selectionChanged( const QRect & ); + void selectionChanged( const TQRect & ); /** * Emitted when an image is finished being shown. If a blend effect is being used @@ -199,7 +199,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas /** * The current mouse cursor position on the image. */ - void cursorPos( const QPoint & ); + void cursorPos( const TQPoint & ); public slots: /** @@ -211,7 +211,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas /** * give the canvas a new image to show. The zoom level is kept. */ - void setImage( const QImage & ); + void setImage( const TQImage & ); /** * Give the canvas a new image to show. @@ -219,7 +219,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas * You have to pass the size the image should have when it appears * on screen. */ - void setImage( const QImage &, const QSize & ); + void setImage( const TQImage &, const TQSize & ); /** * set the zoom to be used when showing the image @@ -229,7 +229,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas /** * Fit the image into the requested width and height. */ - void boundImageTo( const QSize & size ); + void boundImageTo( const TQSize & size ); /** * Set the maximum size of the image. If this is set the image will @@ -237,7 +237,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas * * If you set this to 0x0 the image size may be as big as possible */ - void setMaximumImageSize( const QSize & ); + void setMaximumImageSize( const TQSize & ); /** * Set the minimum size of the image. If this is set the image will @@ -245,14 +245,14 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas * * If you set this to 0x0 the image size can be as small as possible */ - void setMinimumImageSize( const QSize & ); + void setMinimumImageSize( const TQSize & ); /** * Resize the image to the given size. It will keep the aspect ratio * as long as keepAspectRatio is true (default). The image will be as * large as possible within the given constraints. */ - void resizeImage( const QSize & ); + void resizeImage( const TQSize & ); /** * Hides the scrollbars of the canvas. It's still possible to scroll @@ -295,17 +295,17 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas void rotate( double a, bool change = false ); protected: - void checkBounds( QSize & newsize ); - void zoomFromSize( const QSize & ); + void checkBounds( TQSize & newsize ); + void zoomFromSize( const TQSize & ); void sizeFromZoom( double ); void updateImage(); - void mouseMoveEvent( QMouseEvent * ); - void resizeEvent( QResizeEvent * ); - void contentsMousePressEvent( QMouseEvent * ); - void contentsWheelEvent( QWheelEvent * ); - void keyPressEvent( QKeyEvent * ); - void timerEvent( QTimerEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void resizeEvent( TQResizeEvent * ); + void contentsMousePressEvent( TQMouseEvent * ); + void contentsWheelEvent( TQWheelEvent * ); + void keyPressEvent( TQKeyEvent * ); + void timerEvent( TQTimerEvent * ); protected slots: void slotUpdateImage(); @@ -314,8 +314,8 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas void loadSettings(); private slots: - void selected( const QRect & ); // map rect to unzoomed rect - void mapCursorPos( const QPoint & ); + void selected( const TQRect & ); // map rect to unzoomed rect + void mapCursorPos( const TQPoint & ); private: enum BlendEffect { @@ -335,16 +335,16 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas KImageHolder * m_client; KImageHolder * m_oldClient; - QImage * m_image; //unzoomed copy of the current image - QImage * m_imageTransformed; //xForm( m_matrix ) copy of the current image + TQImage * m_image; //unzoomed copy of the current image + TQImage * m_imageTransformed; //xForm( m_matrix ) copy of the current image KPixmap * m_pixmap; //copy of the current pixmap (if ( m_fastscale ) it's unzoomed else it's m_imageTransformed.smoothScale()d) - QTimer * m_pTimer; // timer for single shot to hide the cursor - QCursor m_cursor; // the cursor show in the canvas (for auto-hiding) + TQTimer * m_pTimer; // timer for single shot to hide the cursor + TQCursor m_cursor; // the cursor show in the canvas (for auto-hiding) - QWMatrix m_matrix; // the current transformation matrix - QSize m_maxsize, m_minsize; - QSize m_currentsize; + TQWMatrix m_matrix; // the current transformation matrix + TQSize m_maxsize, m_minsize; + TQSize m_currentsize; double m_zoom; bool m_fastscale; @@ -358,7 +358,7 @@ class KDE_EXPORT KImageCanvas : public QScrollView, public KImageViewer::Canvas bool m_bNewImage; int m_iBlendTimerId; - QRect m_selection; //unzoomed selection rect + TQRect m_selection; //unzoomed selection rect }; // vim:sw=4:ts=4 diff --git a/kview/kviewcanvas/kimageholder.cpp b/kview/kviewcanvas/kimageholder.cpp index 9009c7fc..6ca63698 100644 --- a/kview/kviewcanvas/kimageholder.cpp +++ b/kview/kviewcanvas/kimageholder.cpp @@ -20,32 +20,32 @@ #include <assert.h> -#include <qcolor.h> -#include <qwidget.h> -#include <qimage.h> -#include <qpainter.h> -#include <qpen.h> -#include <qmovie.h> -#include <qpixmap.h> +#include <tqcolor.h> +#include <tqwidget.h> +#include <tqimage.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqmovie.h> +#include <tqpixmap.h> #include <kpixmap.h> #include <kdebug.h> #include "kimageholder.h" -KImageHolder::KImageHolder( QWidget * parent, const char * name ) - : QWidget( parent, name, Qt::WResizeNoErase | Qt::WRepaintNoErase ) +KImageHolder::KImageHolder( TQWidget * parent, const char * name ) + : TQWidget( parent, name, Qt::WResizeNoErase | Qt::WRepaintNoErase ) , m_selected( false ) , m_bSelecting( false ) , m_scrollTimerId( 0 ) , m_xOffset( 0 ) , m_yOffset( 0 ) - , m_pen( new QPen( QColor( 255, 255, 255 ), 0, DashLine ) ) + , m_pen( new TQPen( TQColor( 255, 255, 255 ), 0, DashLine ) ) , m_pPixmap( 0 ) , m_pDoubleBuffer( 0 ) , m_pCheckboardPixmap( 0 ) { - setBackgroundMode( QWidget::NoBackground ); + setBackgroundMode( TQWidget::NoBackground ); } KImageHolder::~KImageHolder() @@ -60,7 +60,7 @@ KImageHolder::~KImageHolder() m_pCheckboardPixmap = 0; } -void KImageHolder::mousePressEvent( QMouseEvent *ev ) +void KImageHolder::mousePressEvent( TQMouseEvent *ev ) { //kdDebug( 4620 ) << k_funcinfo << " ev->state() = " << ev->state() << endl; // if the right mouse button is pressed emit the contextPress signal @@ -80,7 +80,7 @@ void KImageHolder::mousePressEvent( QMouseEvent *ev ) } } -void KImageHolder::mouseMoveEvent( QMouseEvent *ev ) +void KImageHolder::mouseMoveEvent( TQMouseEvent *ev ) { //FIXME: when scrolling the cursorpos shouldn't change if( this->rect().contains( ev->pos(), false ) ) @@ -91,12 +91,12 @@ void KImageHolder::mouseMoveEvent( QMouseEvent *ev ) // scroll when a modifier and left button or the middle button is pressed if( ev->state() & AltButton || ev->state() & ControlButton || ev->state() & ShiftButton || ev->state() & MidButton ) { - QPoint difference = m_scrollpos - ev->globalPos(); + TQPoint difference = m_scrollpos - ev->globalPos(); emit wannaScroll( difference.x(), difference.y() ); } else // create a selection { - QWidget * parentwidget = ( QWidget* )parent(); + TQWidget * parentwidget = ( TQWidget* )parent(); if( ! m_bSelecting ) { m_bSelecting = true; @@ -161,7 +161,7 @@ void KImageHolder::mouseMoveEvent( QMouseEvent *ev ) m_selection.setBottom( b ); emit selected( m_selection.normalize() ); - QPainter painter( this ); + TQPainter painter( this ); drawSelect( painter ); } } @@ -170,7 +170,7 @@ void KImageHolder::mouseMoveEvent( QMouseEvent *ev ) } } -void KImageHolder::mouseReleaseEvent( QMouseEvent * ev ) +void KImageHolder::mouseReleaseEvent( TQMouseEvent * ev ) { if( m_bSelecting ) { @@ -188,7 +188,7 @@ void KImageHolder::mouseReleaseEvent( QMouseEvent * ev ) clearSelection(); } -void KImageHolder::drawSelect( QPainter & painter ) +void KImageHolder::drawSelect( TQPainter & painter ) { painter.save(); painter.setRasterOp( XorROP ); @@ -199,15 +199,15 @@ void KImageHolder::drawSelect( QPainter & painter ) void KImageHolder::eraseSelect() { - QRegion r( m_selection.normalize() ); - QRect inner = m_selection.normalize(); + TQRegion r( m_selection.normalize() ); + TQRect inner = m_selection.normalize(); inner.rLeft() += 1; inner.rTop() += 1; inner.rRight() -= 1; inner.rBottom() -= 1; r -= inner; - QMemArray<QRect> rects = r.rects(); + TQMemArray<TQRect> rects = r.rects(); if( m_pDoubleBuffer ) for( unsigned int i = 0; i < rects.size(); ++i ) @@ -224,7 +224,7 @@ void KImageHolder::clearSelection() eraseSelect(); m_selected = false; } - m_selection.setSize( QSize( 0, 0 ) ); + m_selection.setSize( TQSize( 0, 0 ) ); emit selected( m_selection ); } @@ -235,7 +235,7 @@ void KImageHolder::setImage( const KPixmap & pix ) setPixmap( pix ); } -void KImageHolder::setImage( const QImage & image ) +void KImageHolder::setImage( const TQImage & image ) { clearSelection(); kdDebug( 4620 ) << "converting Image to Pixmap" << endl; @@ -244,11 +244,11 @@ void KImageHolder::setImage( const QImage & image ) setPixmap( pix ); } -void KImageHolder::setImage( const QMovie & /*movie*/ ) +void KImageHolder::setImage( const TQMovie & /*movie*/ ) { clearSelection(); //setMovie( movie ); - kdWarning( 4620 ) << "setImage( QMovie ) not implemented" << endl; + kdWarning( 4620 ) << "setImage( TQMovie ) not implemented" << endl; } void KImageHolder::clear() @@ -261,24 +261,24 @@ void KImageHolder::clear() clearSelection(); } -QRect KImageHolder::selection() const +TQRect KImageHolder::selection() const { if( m_selected ) return m_selection.normalize(); else - return QRect(); + return TQRect(); } -QSize KImageHolder::sizeHint() const +TQSize KImageHolder::sizeHint() const { if( m_pPixmap ) return m_pPixmap->size(); - return QSize( 0, 0 ); + return TQSize( 0, 0 ); } -void KImageHolder::paintEvent( QPaintEvent *ev ) +void KImageHolder::paintEvent( TQPaintEvent *ev ) { - QPainter painter( this ); + TQPainter painter( this ); painter.setClipRegion( ev->region().intersect( m_drawRect ) ); if( m_pPixmap ) { @@ -287,10 +287,10 @@ void KImageHolder::paintEvent( QPaintEvent *ev ) if( ! m_pDoubleBuffer ) { m_pDoubleBuffer = new KPixmap( m_pPixmap->size() ); - QPainter p( m_pDoubleBuffer ); + TQPainter p( m_pDoubleBuffer ); p.drawTiledPixmap( m_pDoubleBuffer->rect(), checkboardPixmap() ); p.end(); - bitBlt( m_pDoubleBuffer, QPoint( 0, 0 ), m_pPixmap, m_pPixmap->rect() ); + bitBlt( m_pDoubleBuffer, TQPoint( 0, 0 ), m_pPixmap, m_pPixmap->rect() ); } painter.drawPixmap( 0, 0, *m_pDoubleBuffer ); } @@ -301,7 +301,7 @@ void KImageHolder::paintEvent( QPaintEvent *ev ) drawSelect( painter ); } -void KImageHolder::timerEvent( QTimerEvent * ev ) +void KImageHolder::timerEvent( TQTimerEvent * ev ) { if( ev->timerId() != m_scrollTimerId ) return; diff --git a/kview/kviewcanvas/kimageholder.h b/kview/kviewcanvas/kimageholder.h index 780ce372..73148cbf 100644 --- a/kview/kviewcanvas/kimageholder.h +++ b/kview/kviewcanvas/kimageholder.h @@ -20,13 +20,13 @@ #ifndef _KIMAGEHOLDER_H #define _KIMAGEHOLDER_H -#include <qwidget.h> -class QRect; -class QPainter; -class QPen; -class QPixmap; +#include <tqwidget.h> +class TQRect; +class TQPainter; +class TQPen; +class TQPixmap; class KPixmap; -class QPoint; +class TQPoint; /** * @short Image widget @@ -36,15 +36,15 @@ class KImageHolder : public QWidget { Q_OBJECT public: - KImageHolder( QWidget *parent = 0, const char * name = 0 ); + KImageHolder( TQWidget *parent = 0, const char * name = 0 ); virtual ~KImageHolder(); void clearSelection(); void setImage( const KPixmap & ); - void setImage( const QImage & ); - void setImage( const QMovie & ); + void setImage( const TQImage & ); + void setImage( const TQMovie & ); /** * clears the ImageHolder @@ -54,37 +54,37 @@ class KImageHolder : public QWidget /** * the selected rect */ - QRect selection() const; + TQRect selection() const; - QSize sizeHint() const; + TQSize sizeHint() const; - void setDrawRect( const QRect & rect ) { m_drawRect = rect; } - const QRect & drawRect() const { return m_drawRect; } + void setDrawRect( const TQRect & rect ) { m_drawRect = rect; } + const TQRect & drawRect() const { return m_drawRect; } signals: - void contextPress( const QPoint& ); - void selected( const QRect & ); + void contextPress( const TQPoint& ); + void selected( const TQRect & ); void wannaScroll( int dx, int dy ); - void cursorPos( const QPoint & ); + void cursorPos( const TQPoint & ); protected: - void mousePressEvent( QMouseEvent * ); - void mouseMoveEvent( QMouseEvent * ); - void mouseReleaseEvent( QMouseEvent * ); - void paintEvent( QPaintEvent * ); - virtual void timerEvent( QTimerEvent * ); + void mousePressEvent( TQMouseEvent * ); + void mouseMoveEvent( TQMouseEvent * ); + void mouseReleaseEvent( TQMouseEvent * ); + void paintEvent( TQPaintEvent * ); + virtual void timerEvent( TQTimerEvent * ); private: - void drawSelect( QPainter & ); + void drawSelect( TQPainter & ); void eraseSelect(); void setPixmap( const KPixmap & ); private: - QRect m_selection; - QRect m_drawRect; - QPoint m_scrollpos; - QPoint m_selectionStartPoint; + TQRect m_selection; + TQRect m_drawRect; + TQPoint m_scrollpos; + TQPoint m_selectionStartPoint; const KPixmap & checkboardPixmap(); @@ -93,7 +93,7 @@ class KImageHolder : public QWidget int m_scrollTimerId; int m_xOffset, m_yOffset; - QPen *m_pen; + TQPen *m_pen; KPixmap * m_pPixmap; KPixmap * m_pDoubleBuffer; diff --git a/kview/kviewcanvas/test/test.cpp b/kview/kviewcanvas/test/test.cpp index 8422f944..e913ab59 100644 --- a/kview/kviewcanvas/test/test.cpp +++ b/kview/kviewcanvas/test/test.cpp @@ -11,13 +11,13 @@ #include <kmessagebox.h> #include <kparts/componentfactory.h> -#include <qimage.h> +#include <tqimage.h> KImageViewerTest::KImageViewerTest() : KParts::MainWindow( 0L, "KImageViewerTest" ) { - QWidget * widget = KParts::ComponentFactory::createInstanceFromQuery<QWidget>( - "KImageViewer/Canvas", QString::null, this ); + TQWidget * widget = KParts::ComponentFactory::createInstanceFromQuery<TQWidget>( + "KImageViewer/Canvas", TQString::null, this ); if( widget ) { m_part = dynamic_cast<KImageViewer::Canvas *>( widget ); @@ -36,7 +36,7 @@ KImageViewerTest::~KImageViewerTest() void KImageViewerTest::load(const KURL& url) { - QImage image( url.fileName() ); + TQImage image( url.fileName() ); if( m_part ) m_part->setImage( image ); else |