summaryrefslogtreecommitdiffstats
path: root/krita/plugins/tools/defaulttools/kis_tool_zoom.cc
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-06-25 05:28:35 +0000
commitf008adb5a77e094eaf6abf3fc0f36958e66896a5 (patch)
tree8e9244c4d4957c36be81e15b566b4aa5ea26c982 /krita/plugins/tools/defaulttools/kis_tool_zoom.cc
parent1210f27b660efb7b37ff43ec68763e85a403471f (diff)
downloadkoffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.tar.gz
koffice-f008adb5a77e094eaf6abf3fc0f36958e66896a5.zip
TQt4 port koffice
This should enable compilation under both Qt3 and Qt4; fixes for any missed components will be forthcoming git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/koffice@1238284 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'krita/plugins/tools/defaulttools/kis_tool_zoom.cc')
-rw-r--r--krita/plugins/tools/defaulttools/kis_tool_zoom.cc46
1 files changed, 23 insertions, 23 deletions
diff --git a/krita/plugins/tools/defaulttools/kis_tool_zoom.cc b/krita/plugins/tools/defaulttools/kis_tool_zoom.cc
index a5567f83..f866e5e2 100644
--- a/krita/plugins/tools/defaulttools/kis_tool_zoom.cc
+++ b/krita/plugins/tools/defaulttools/kis_tool_zoom.cc
@@ -41,12 +41,12 @@ KisToolZoom::KisToolZoom()
setName("tool_zoom");
m_subject = 0;
m_dragging = false;
- m_startPos = QPoint(0, 0);
- m_endPos = QPoint(0, 0);
+ m_startPos = TQPoint(0, 0);
+ m_endPos = TQPoint(0, 0);
m_plusCursor = KisCursor::load("tool_zoom_plus_cursor.png", 8, 8);
m_minusCursor = KisCursor::load("tool_zoom_minus_cursor.png", 8, 8);
setCursor(m_plusCursor);
- connect(&m_timer, SIGNAL(timeout()), SLOT(slotTimer()));
+ connect(&m_timer, TQT_SIGNAL(timeout()), TQT_SLOT(slotTimer()));
}
KisToolZoom::~KisToolZoom()
@@ -62,10 +62,10 @@ void KisToolZoom::update(KisCanvasSubject *subject)
void KisToolZoom::paint(KisCanvasPainter& gc)
{
if (m_dragging)
- paintOutline(gc, QRect());
+ paintOutline(gc, TQRect());
}
-void KisToolZoom::paint(KisCanvasPainter& gc, const QRect& rc)
+void KisToolZoom::paint(KisCanvasPainter& gc, const TQRect& rc)
{
if (m_dragging)
paintOutline(gc, rc);
@@ -75,8 +75,8 @@ void KisToolZoom::buttonPress(KisButtonPressEvent *e)
{
if (m_subject && m_subject->currentImg() && !m_dragging) {
if (e->button() == Qt::LeftButton) {
- m_startPos = e->pos().floorQPoint();
- m_endPos = e->pos().floorQPoint();
+ m_startPos = e->pos().floorTQPoint();
+ m_endPos = e->pos().floorTQPoint();
m_dragging = true;
}
}
@@ -88,7 +88,7 @@ void KisToolZoom::move(KisMoveEvent *e)
if (m_startPos != m_endPos)
paintOutline();
- m_endPos = e->pos().floorQPoint();
+ m_endPos = e->pos().floorTQPoint();
paintOutline();
}
}
@@ -98,19 +98,19 @@ void KisToolZoom::buttonRelease(KisButtonReleaseEvent *e)
if (m_subject && m_dragging && e->button() == Qt::LeftButton) {
KisCanvasController *controller = m_subject->canvasController();
- m_endPos = e->pos().floorQPoint();
+ m_endPos = e->pos().floorTQPoint();
m_dragging = false;
- QPoint delta = m_endPos - m_startPos;
+ TQPoint delta = m_endPos - m_startPos;
if (sqrt(delta.x() * delta.x() + delta.y() * delta.y()) < 10) {
- if (e->state() & Qt::ControlButton) {
+ if (e->state() & TQt::ControlButton) {
controller->zoomOut(m_endPos.x(), m_endPos.y());
} else {
controller->zoomIn(m_endPos.x(), m_endPos.y());
}
} else {
- controller->zoomTo(QRect(m_startPos, m_endPos));
+ controller->zoomTo(TQRect(m_startPos, m_endPos));
}
}
}
@@ -129,13 +129,13 @@ void KisToolZoom::deactivate()
void KisToolZoom::slotTimer()
{
#if KDE_IS_VERSION(3,4,0)
- int state = kapp->keyboardMouseState() & (Qt::ShiftButton|Qt::ControlButton|Qt::AltButton);
+ int state = kapp->keyboardMouseState() & (TQt::ShiftButton|TQt::ControlButton|TQt::AltButton);
#else
int state = kapp->keyboardModifiers() & (KApplication::ShiftModifier
|KApplication::ControlModifier|KApplication::Modifier1);
#endif
- if (state & Qt::ControlButton) {
+ if (state & TQt::ControlButton) {
m_subject->canvasController()->setCanvasCursor(m_minusCursor);
} else {
m_subject->canvasController()->setCanvasCursor(m_plusCursor);
@@ -148,29 +148,29 @@ void KisToolZoom::paintOutline()
KisCanvasController *controller = m_subject->canvasController();
KisCanvas *canvas = controller->kiscanvas();
KisCanvasPainter gc(canvas);
- QRect rc;
+ TQRect rc;
paintOutline(gc, rc);
}
}
-void KisToolZoom::paintOutline(KisCanvasPainter& gc, const QRect&)
+void KisToolZoom::paintOutline(KisCanvasPainter& gc, const TQRect&)
{
if (m_subject) {
KisCanvasController *controller = m_subject->canvasController();
RasterOp op = gc.rasterOp();
- QPen old = gc.pen();
- QPen pen(Qt::DotLine);
- QPoint start;
- QPoint end;
+ TQPen old = gc.pen();
+ TQPen pen(TQt::DotLine);
+ TQPoint start;
+ TQPoint end;
Q_ASSERT(controller);
start = controller->windowToView(m_startPos);
end = controller->windowToView(m_endPos);
- gc.setRasterOp(Qt::NotROP);
+ gc.setRasterOp(TQt::NotROP);
gc.setPen(pen);
- gc.drawRect(QRect(start, end));
+ gc.drawRect(TQRect(start, end));
gc.setRasterOp(op);
gc.setPen(old);
}
@@ -181,7 +181,7 @@ void KisToolZoom::setup(KActionCollection *collection)
m_action = static_cast<KRadioAction *>(collection->action(name()));
if (m_action == 0) {
- m_action = new KRadioAction(i18n("&Zoom"), "tool_zoom", Qt::Key_Z, this, SLOT(activate()), collection, name());
+ m_action = new KRadioAction(i18n("&Zoom"), "tool_zoom", TQt::Key_Z, this, TQT_SLOT(activate()), collection, name());
m_action->setToolTip(i18n("Zoom"));
m_action->setExclusiveGroup("tools");
m_ownAction = true;