diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-06-22 00:30:31 +0000 |
commit | 69cac65817d949cda2672ec4f0aa73d5e66a0ba1 (patch) | |
tree | 073fde0496ea90eb5bf5cffe66a8da43a9f55fbc /kopete/libkopete/compat | |
parent | 3467e6464beac3a162839bf7078e22e3a74d73e7 (diff) | |
download | tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.tar.gz tdenetwork-69cac65817d949cda2672ec4f0aa73d5e66a0ba1.zip |
TQt4 port kdenetwork
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/kdenetwork@1237912 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kopete/libkopete/compat')
4 files changed, 31 insertions, 30 deletions
diff --git a/kopete/libkopete/compat/kpixmapregionselectordialog.cpp b/kopete/libkopete/compat/kpixmapregionselectordialog.cpp index c394af0f..b17da677 100644 --- a/kopete/libkopete/compat/kpixmapregionselectordialog.cpp +++ b/kopete/libkopete/compat/kpixmapregionselectordialog.cpp @@ -24,8 +24,8 @@ #include <klocale.h> #include <kdialog.h> -KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog(TQWidget *parent, - const char *name, bool modal ) : KDialogBase(parent, name, modal, i18n("Select Region of Image"), Help|Ok|Cancel, Ok, true ) +KPixmapRegionSelectorDialog::KPixmapRegionSelectorDialog(TQWidget *tqparent, + const char *name, bool modal ) : KDialogBase(tqparent, name, modal, i18n("Select Region of Image"), Help|Ok|Cancel, Ok, true ) { TQVBox *vbox=new TQVBox(this); new TQLabel(i18n("Please click and drag on the image to select the region of interest:"), vbox); @@ -40,9 +40,9 @@ KPixmapRegionSelectorDialog::~KPixmapRegionSelectorDialog() { } -TQRect KPixmapRegionSelectorDialog::getSelectedRegion(const TQPixmap &pixmap, TQWidget *parent ) +TQRect KPixmapRegionSelectorDialog::getSelectedRegion(const TQPixmap &pixmap, TQWidget *tqparent ) { - KPixmapRegionSelectorDialog dialog(parent); + KPixmapRegionSelectorDialog dialog(tqparent); dialog.pixmapRegionSelectorWidget()->setPixmap(pixmap); @@ -61,9 +61,9 @@ TQRect KPixmapRegionSelectorDialog::getSelectedRegion(const TQPixmap &pixmap, TQ return rect; } -TQRect KPixmapRegionSelectorDialog::getSelectedRegion(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *parent ) +TQRect KPixmapRegionSelectorDialog::getSelectedRegion(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *tqparent ) { - KPixmapRegionSelectorDialog dialog(parent); + KPixmapRegionSelectorDialog dialog(tqparent); dialog.pixmapRegionSelectorWidget()->setPixmap(pixmap); dialog.pixmapRegionSelectorWidget()->setSelectionAspectRatio(aspectRatioWidth,aspectRatioHeight); @@ -83,9 +83,9 @@ TQRect KPixmapRegionSelectorDialog::getSelectedRegion(const TQPixmap &pixmap, in return rect; } -TQImage KPixmapRegionSelectorDialog::getSelectedImage(const TQPixmap &pixmap, TQWidget *parent ) +TQImage KPixmapRegionSelectorDialog::getSelectedImage(const TQPixmap &pixmap, TQWidget *tqparent ) { - KPixmapRegionSelectorDialog dialog(parent); + KPixmapRegionSelectorDialog dialog(tqparent); dialog.pixmapRegionSelectorWidget()->setPixmap(pixmap); @@ -103,9 +103,9 @@ TQImage KPixmapRegionSelectorDialog::getSelectedImage(const TQPixmap &pixmap, TQ return image; } -TQImage KPixmapRegionSelectorDialog::getSelectedImage(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *parent ) +TQImage KPixmapRegionSelectorDialog::getSelectedImage(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *tqparent ) { - KPixmapRegionSelectorDialog dialog(parent); + KPixmapRegionSelectorDialog dialog(tqparent); dialog.pixmapRegionSelectorWidget()->setPixmap(pixmap); dialog.pixmapRegionSelectorWidget()->setSelectionAspectRatio(aspectRatioWidth,aspectRatioHeight); diff --git a/kopete/libkopete/compat/kpixmapregionselectordialog.h b/kopete/libkopete/compat/kpixmapregionselectordialog.h index ffc5551e..fbf2db6a 100644 --- a/kopete/libkopete/compat/kpixmapregionselectordialog.h +++ b/kopete/libkopete/compat/kpixmapregionselectordialog.h @@ -47,7 +47,7 @@ public: * later the setPixmap method of the KPixmapRegionSelectorWidget widget of * the new object. */ - KPixmapRegionSelectorDialog(TQWidget *parent=0L, const char *name=0L, + KPixmapRegionSelectorDialog(TQWidget *tqparent=0L, const char *name=0L, bool modal = false ); /** * The destructor of the dialog @@ -68,7 +68,7 @@ public: * @returns the selected rectangle, or an invalid rectangle if the user * pressed the Cancel button. */ - static TQRect getSelectedRegion(const TQPixmap &pixmap, TQWidget *parent = 0L ); + static TQRect getSelectedRegion(const TQPixmap &pixmap, TQWidget *tqparent = 0L ); /** * Creates a modal dialog, lets the user to select a region of the @p pixmap @@ -78,7 +78,7 @@ public: * @returns the selected rectangle, or an invalid rectangle if the user * pressed the Cancel button. */ - static TQRect getSelectedRegion(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *parent = 0L ); + static TQRect getSelectedRegion(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *tqparent = 0L ); /** * Creates a modal dialog, lets the user to select a region of the @p pixmap @@ -87,7 +87,7 @@ public: * @returns the selected image, or an invalid image if the user * pressed the Cancel button. */ - static TQImage getSelectedImage(const TQPixmap &pixmap, TQWidget *parent = 0L ); + static TQImage getSelectedImage(const TQPixmap &pixmap, TQWidget *tqparent = 0L ); /** * Creates a modal dialog, lets the user to select a region of the @p pixmap @@ -97,7 +97,7 @@ public: * @returns the selected image, or an invalid image if the user * pressed the Cancel button. */ - static TQImage getSelectedImage(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *parent = 0L ); + static TQImage getSelectedImage(const TQPixmap &pixmap, int aspectRatioWidth, int aspectRatioHeight, TQWidget *tqparent = 0L ); protected: KPixmapRegionSelectorWidget *m_pixmapSelectorWidget; diff --git a/kopete/libkopete/compat/kpixmapregionselectorwidget.cpp b/kopete/libkopete/compat/kpixmapregionselectorwidget.cpp index ada867bb..0468acdf 100644 --- a/kopete/libkopete/compat/kpixmapregionselectorwidget.cpp +++ b/kopete/libkopete/compat/kpixmapregionselectorwidget.cpp @@ -37,8 +37,8 @@ #include <tqcursor.h> #include <tqapplication.h> -KPixmapRegionSelectorWidget::KPixmapRegionSelectorWidget( TQWidget *parent, - const char *name) : TQWidget( parent, name) +KPixmapRegionSelectorWidget::KPixmapRegionSelectorWidget( TQWidget *tqparent, + const char *name) : TQWidget( tqparent, name) { TQHBoxLayout * hboxLayout=new TQHBoxLayout( this ); @@ -47,7 +47,7 @@ KPixmapRegionSelectorWidget::KPixmapRegionSelectorWidget( TQWidget *parent, vboxLayout->addStretch(); m_label = new TQLabel(this, "pixmapHolder"); - m_label->setBackgroundMode( Qt::NoBackground ); + m_label->setBackgroundMode( TQt::NoBackground ); m_label->installEventFilter( this ); vboxLayout->addWidget(m_label); @@ -108,9 +108,9 @@ void KPixmapRegionSelectorWidget::updatePixmap() m_linedPixmap = m_originalPixmap; painter.begin(&m_linedPixmap); - painter.setRasterOp( Qt::XorROP ); + painter.setRasterOp( TQt::XorROP ); painter.fillRect(0,0,m_linedPixmap.width(), m_linedPixmap.height(), - TQBrush( TQColor(255,255,255), Qt::BDiagPattern) ); + TQBrush( TQColor(255,255,255), TQt::BDiagPattern) ); painter.end(); TQImage image=m_linedPixmap.convertToImage(); @@ -125,7 +125,7 @@ void KPixmapRegionSelectorWidget::updatePixmap() m_originalPixmap, m_selectedRegion ); painter.setPen( TQColor(255,255,255) ); - painter.setRasterOp( Qt::XorROP ); + painter.setRasterOp( TQt::XorROP ); painter.drawRect( m_selectedRegion ); @@ -211,7 +211,7 @@ bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev) if ( ev->type() == TQEvent::MouseButtonPress ) { TQMouseEvent *mev= (TQMouseEvent *)(ev); - //kdDebug() << TQString("click at %1,%2").arg( mev->x() ).arg( mev->y() ) << endl; + //kdDebug() << TQString("click at %1,%2").tqarg( mev->x() ).tqarg( mev->y() ) << endl; if ( mev->button() == RightButton ) { @@ -223,16 +223,16 @@ bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev) TQCursor cursor; - if ( m_selectedRegion.contains( mev->pos() ) + if ( m_selectedRegion.tqcontains( mev->pos() ) && m_selectedRegion!=m_originalPixmap.rect() ) { m_state=Moving; - cursor.setShape( Qt::SizeAllCursor ); + cursor.setShape( TQt::SizeAllCursor ); } else { m_state=Resizing; - cursor.setShape( Qt::CrossCursor ); + cursor.setShape( TQt::CrossCursor ); } TQApplication::setOverrideCursor(cursor); @@ -246,7 +246,7 @@ bool KPixmapRegionSelectorWidget::eventFilter(TQObject *obj, TQEvent *ev) { TQMouseEvent *mev= (TQMouseEvent *)(ev); - //kdDebug() << TQString("move to %1,%2").arg( mev->x() ).arg( mev->y() ) << endl; + //kdDebug() << TQString("move to %1,%2").tqarg( mev->x() ).tqarg( mev->y() ) << endl; if ( m_state == Resizing ) { @@ -418,7 +418,7 @@ void KPixmapRegionSelectorWidget::setMaximumWidgetSize(int width, int height) if (m_selectedRegion == m_originalPixmap.rect()) m_selectedRegion=TQRect(); // kdDebug() << TQString(" original Pixmap :") << m_originalPixmap.rect() << endl; -// kdDebug() << TQString(" unzoomed Pixmap : %1 x %2 ").arg(m_unzoomedPixmap.width()).arg(m_unzoomedPixmap.height()) << endl; +// kdDebug() << TQString(" unzoomed Pixmap : %1 x %2 ").tqarg(m_unzoomedPixmap.width()).tqarg(m_unzoomedPixmap.height()) << endl; if ( !m_originalPixmap.isNull() && ( m_originalPixmap.width() > m_maxWidth || @@ -426,7 +426,7 @@ void KPixmapRegionSelectorWidget::setMaximumWidgetSize(int width, int height) { /* We have to resize the pixmap to get it complete on the screen */ TQImage image=m_originalPixmap.convertToImage(); - m_originalPixmap.convertFromImage( image.smoothScale( width, height, TQImage::ScaleMin ) ); + m_originalPixmap.convertFromImage( image.smoothScale( width, height, TQ_ScaleMin ) ); double oldZoomFactor = m_zoomFactor; m_zoomFactor=m_originalPixmap.width()/(double)m_unzoomedPixmap.width(); diff --git a/kopete/libkopete/compat/kpixmapregionselectorwidget.h b/kopete/libkopete/compat/kpixmapregionselectorwidget.h index 6b0a319b..036b232a 100644 --- a/kopete/libkopete/compat/kpixmapregionselectorwidget.h +++ b/kopete/libkopete/compat/kpixmapregionselectorwidget.h @@ -41,14 +41,15 @@ class KPopupMenu; * @author Antonio Larrosa <larrosa@kde.org> * @since 3.4 */ -class KOPETE_EXPORT KPixmapRegionSelectorWidget : public QWidget +class KOPETE_EXPORT KPixmapRegionSelectorWidget : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** * Constructor for a KPixmapRegionSelectorWidget. */ - KPixmapRegionSelectorWidget( TQWidget *parent = 0L, const char *name=0L); + KPixmapRegionSelectorWidget( TQWidget *tqparent = 0L, const char *name=0L); /** * Destructor for a KPixmapRegionSelectorWidget |