diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-26 21:04:57 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-26 21:04:57 +0000 |
commit | bf7f88413be3831a9372d323d02fc0335b9f9188 (patch) | |
tree | 516fdef9206245b40a14f99b4e3d9ef9289196e0 /src/gvcore/imageviewtools.cpp | |
parent | e238aa77b1fb3c2f55aef2ef2c91ce52166d2cc8 (diff) | |
download | gwenview-bf7f88413be3831a9372d323d02fc0335b9f9188.tar.gz gwenview-bf7f88413be3831a9372d323d02fc0335b9f9188.zip |
TQt4 port Gwenview
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/gwenview@1233720 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gvcore/imageviewtools.cpp')
-rw-r--r-- | src/gvcore/imageviewtools.cpp | 52 |
1 files changed, 26 insertions, 26 deletions
diff --git a/src/gvcore/imageviewtools.cpp b/src/gvcore/imageviewtools.cpp index 5cb8fdd..699868a 100644 --- a/src/gvcore/imageviewtools.cpp +++ b/src/gvcore/imageviewtools.cpp @@ -1,7 +1,7 @@ // vim: set tabstop=4 shiftwidth=4 noexpandtab /* Gwenview - A simple image viewer for KDE -Copyright 2000-2004 Aur�lien G�teau +Copyright 2000-2004 Aur�lien G�teau This program is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License @@ -34,10 +34,10 @@ namespace Gwenview { // Helper function -static QCursor loadCursor(const QString& name) { - QString path; - path=locate("data", QString("gwenview/cursors/%1.png").arg(name)); - return QCursor(QPixmap(path)); +static TQCursor loadCursor(const TQString& name) { + TQString path; + path=locate("data", TQString("gwenview/cursors/%1.png").tqarg(name)); + return TQCursor(TQPixmap(path)); } @@ -52,22 +52,22 @@ ImageView::ToolBase::ToolBase(ImageView* view) ImageView::ToolBase::~ToolBase() {} -void ImageView::ToolBase::mouseMoveEvent(QMouseEvent*) {} -void ImageView::ToolBase::leftButtonPressEvent(QMouseEvent*) {} -void ImageView::ToolBase::leftButtonReleaseEvent(QMouseEvent*) {} +void ImageView::ToolBase::mouseMoveEvent(TQMouseEvent*) {} +void ImageView::ToolBase::leftButtonPressEvent(TQMouseEvent*) {} +void ImageView::ToolBase::leftButtonReleaseEvent(TQMouseEvent*) {} -void ImageView::ToolBase::midButtonReleaseEvent(QMouseEvent*) { +void ImageView::ToolBase::midButtonReleaseEvent(TQMouseEvent*) { mView->zoomToFit()->activate(); } -void ImageView::ToolBase::rightButtonPressEvent(QMouseEvent* event) { +void ImageView::ToolBase::rightButtonPressEvent(TQMouseEvent* event) { emit mView->requestContextMenu(event->globalPos()); } -void ImageView::ToolBase::rightButtonReleaseEvent(QMouseEvent*) { +void ImageView::ToolBase::rightButtonReleaseEvent(TQMouseEvent*) { } -void ImageView::ToolBase::wheelEvent(QWheelEvent* event) { +void ImageView::ToolBase::wheelEvent(TQWheelEvent* event) { event->accept(); } @@ -87,12 +87,12 @@ ImageView::ZoomTool::ZoomTool(ImageView* view) } -void ImageView::ZoomTool::zoomTo(const QPoint& pos, bool in) { +void ImageView::ZoomTool::zoomTo(const TQPoint& pos, bool in) { if (!mView->canZoom(in)) return; - QPoint centerPos=QPoint(mView->visibleWidth(), mView->visibleHeight())/2; + TQPoint centerPos=TQPoint(mView->visibleWidth(), mView->visibleHeight())/2; // Compute image position - QPoint imgPos=mView->viewportToContents(pos) - mView->offset(); + TQPoint imgPos=mView->viewportToContents(pos) - mView->offset(); double newZoom=mView->computeZoom(in); imgPos*=newZoom/mView->zoom(); @@ -101,22 +101,22 @@ void ImageView::ZoomTool::zoomTo(const QPoint& pos, bool in) { } -void ImageView::ZoomTool::leftButtonReleaseEvent(QMouseEvent* event) { +void ImageView::ZoomTool::leftButtonReleaseEvent(TQMouseEvent* event) { zoomTo(event->pos(), true); } -void ImageView::ZoomTool::wheelEvent(QWheelEvent* event) { +void ImageView::ZoomTool::wheelEvent(TQWheelEvent* event) { zoomTo(event->pos(), event->delta()>0); event->accept(); } -void ImageView::ZoomTool::rightButtonPressEvent(QMouseEvent*) { +void ImageView::ZoomTool::rightButtonPressEvent(TQMouseEvent*) { } -void ImageView::ZoomTool::rightButtonReleaseEvent(QMouseEvent* event) { +void ImageView::ZoomTool::rightButtonReleaseEvent(TQMouseEvent* event) { zoomTo(event->pos(), false); } @@ -126,7 +126,7 @@ void ImageView::ZoomTool::updateCursor() { } -QString ImageView::ZoomTool::hint() const { +TQString ImageView::ZoomTool::hint() const { return i18n("Left click to zoom in, right click to zoom out. You can also use the mouse wheel."); } @@ -143,7 +143,7 @@ ImageView::ScrollTool::ScrollTool(ImageView* view) } -void ImageView::ScrollTool::leftButtonPressEvent(QMouseEvent* event) { +void ImageView::ScrollTool::leftButtonPressEvent(TQMouseEvent* event) { mScrollStartX=event->x(); mScrollStartY=event->y(); mView->viewport()->setCursor(SizeAllCursor); @@ -151,7 +151,7 @@ void ImageView::ScrollTool::leftButtonPressEvent(QMouseEvent* event) { } -void ImageView::ScrollTool::mouseMoveEvent(QMouseEvent* event) { +void ImageView::ScrollTool::mouseMoveEvent(TQMouseEvent* event) { if (!mDragStarted) return; int deltaX,deltaY; @@ -165,7 +165,7 @@ void ImageView::ScrollTool::mouseMoveEvent(QMouseEvent* event) { } -void ImageView::ScrollTool::leftButtonReleaseEvent(QMouseEvent*) { +void ImageView::ScrollTool::leftButtonReleaseEvent(TQMouseEvent*) { if (!mDragStarted) return; mDragStarted=false; @@ -173,11 +173,11 @@ void ImageView::ScrollTool::leftButtonReleaseEvent(QMouseEvent*) { } -void ImageView::ScrollTool::wheelEvent(QWheelEvent* event) { +void ImageView::ScrollTool::wheelEvent(TQWheelEvent* event) { if (ImageViewConfig::mouseWheelScroll()) { int deltaX, deltaY; - if (event->state() & AltButton || event->orientation()==Horizontal) { + if (event->state() & AltButton || event->orientation()==Qt::Horizontal) { deltaX = event->delta(); deltaY = 0; } else { @@ -205,7 +205,7 @@ void ImageView::ScrollTool::updateCursor() { } -QString ImageView::ScrollTool::hint() const { +TQString ImageView::ScrollTool::hint() const { return i18n("Drag to move the image, middle-click to toggle auto-zoom. Hold the Control key to switch to the zoom tool."); } |