diff options
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."); } |