summaryrefslogtreecommitdiffstats
path: root/krita/plugins/tools/tool_crop
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/tool_crop
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/tool_crop')
-rw-r--r--krita/plugins/tools/tool_crop/kis_tool_crop.cc200
-rw-r--r--krita/plugins/tools/tool_crop/kis_tool_crop.h57
-rw-r--r--krita/plugins/tools/tool_crop/tool_crop.cc10
-rw-r--r--krita/plugins/tools/tool_crop/tool_crop.h3
-rw-r--r--krita/plugins/tools/tool_crop/wdg_tool_crop.ui28
5 files changed, 150 insertions, 148 deletions
diff --git a/krita/plugins/tools/tool_crop/kis_tool_crop.cc b/krita/plugins/tools/tool_crop/kis_tool_crop.cc
index fd83e204..763e19b1 100644
--- a/krita/plugins/tools/tool_crop/kis_tool_crop.cc
+++ b/krita/plugins/tools/tool_crop/kis_tool_crop.cc
@@ -21,13 +21,13 @@
*/
-#include <qcheckbox.h>
-#include <qcombobox.h>
-#include <qobject.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qpushbutton.h>
-#include <qrect.h>
+#include <tqcheckbox.h>
+#include <tqcombobox.h>
+#include <tqobject.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqpushbutton.h>
+#include <tqrect.h>
#include <kdebug.h>
#include <kaction.h>
@@ -67,7 +67,7 @@ KisToolCrop::KisToolCrop()
setCursor(m_cropCursor);
m_subject = 0;
m_selecting = false;
- m_rectCrop = QRect(0, 0, 0, 0);
+ m_rectCrop = TQRect(0, 0, 0, 0);
m_handleSize = 13;
m_haveCropSelection = false;
m_optWidget = 0;
@@ -113,10 +113,10 @@ void KisToolCrop::deactivate()
void KisToolCrop::paint(KisCanvasPainter& gc)
{
- paintOutlineWithHandles(gc, QRect());
+ paintOutlineWithHandles(gc, TQRect());
}
-void KisToolCrop::paint(KisCanvasPainter& gc, const QRect& rc)
+void KisToolCrop::paint(KisCanvasPainter& gc, const TQRect& rc)
{
paintOutlineWithHandles(gc, rc);
}
@@ -133,7 +133,7 @@ void KisToolCrop::clearRect()
controller->kiscanvas()->update();
- m_rectCrop = QRect(0,0,0,0);
+ m_rectCrop = TQRect(0,0,0,0);
updateWidgetValues();
m_selecting = false;
@@ -147,8 +147,8 @@ void KisToolCrop::buttonPress(KisButtonPressEvent *e)
if (img && img->activeDevice() && e->button() == LeftButton) {
- QPoint pos = e->pos().floorQPoint();
- QRect b = img->bounds();
+ TQPoint pos = e->pos().floorTQPoint();
+ TQRect b = img->bounds();
if (pos.x() < b.x())
pos.setX(b.x());
@@ -164,7 +164,7 @@ void KisToolCrop::buttonPress(KisButtonPressEvent *e)
if( !m_haveCropSelection ) //if the selection is not set
{
- m_rectCrop = QRect( pos.x(), pos.y(), 0, 0);
+ m_rectCrop = TQRect( pos.x(), pos.y(), 0, 0);
paintOutlineWithHandles();
}
else
@@ -189,28 +189,28 @@ void KisToolCrop::move(KisMoveEvent *e)
{
paintOutlineWithHandles();
- m_rectCrop.setBottomRight( e->pos().floorQPoint());
+ m_rectCrop.setBottomRight( e->pos().floorTQPoint());
KisImageSP image = m_subject->currentImg();
- m_rectCrop.setRight( QMIN(m_rectCrop.right(), image->width()));
- m_rectCrop.setBottom( QMIN(m_rectCrop.bottom(), image->width()));
+ m_rectCrop.setRight( TQMIN(m_rectCrop.right(), image->width()));
+ m_rectCrop.setBottom( TQMIN(m_rectCrop.bottom(), image->width()));
m_rectCrop = m_rectCrop.normalize();
paintOutlineWithHandles();
}
else //if the crop selection is set
{
- m_dragStop = e->pos().floorQPoint();
+ m_dragStop = e->pos().floorTQPoint();
if (m_mouseOnHandleType != None && m_dragStart != m_dragStop ) {
- Q_INT32 imageWidth = m_subject->currentImg()->width();
- Q_INT32 imageHeight = m_subject->currentImg()->height();
+ TQ_INT32 imageWidth = m_subject->currentImg()->width();
+ TQ_INT32 imageHeight = m_subject->currentImg()->height();
paintOutlineWithHandles();
- QPoint pos = e->pos().floorQPoint();
+ TQPoint pos = e->pos().floorTQPoint();
if( m_mouseOnHandleType == Inside )
{
m_rectCrop.moveBy( ( m_dragStop.x() - m_dragStart.x() ), ( m_dragStop.y() - m_dragStart.y() ) );
@@ -232,35 +232,35 @@ void KisToolCrop::move(KisMoveEvent *e)
}
} else if(m_optWidget->boolRatio->isChecked())
{
- QPoint drag = m_dragStop - m_dragStart;
+ TQPoint drag = m_dragStop - m_dragStart;
if( ! m_optWidget->boolWidth->isChecked() && !m_optWidget->boolHeight->isChecked() )
{
switch (m_mouseOnHandleType)
{
case (UpperLeft):
{
- Q_INT32 dep = (drag.x() + drag.y()) / 2;
+ TQ_INT32 dep = (drag.x() + drag.y()) / 2;
m_rectCrop.setTop( m_rectCrop.top() + dep );
m_rectCrop.setLeft( (int) ( m_rectCrop.right() - m_optWidget->doubleRatio->value() * m_rectCrop.height() ) );
}
break;
case (LowerRight):
{
- Q_INT32 dep = (drag.x() + drag.y()) / 2;
+ TQ_INT32 dep = (drag.x() + drag.y()) / 2;
m_rectCrop.setBottom( m_rectCrop.bottom() + dep );
m_rectCrop.setWidth( (int) ( m_optWidget->doubleRatio->value() * m_rectCrop.height() ) );
break;
}
case (UpperRight):
{
- Q_INT32 dep = (drag.x() - drag.y()) / 2;
+ TQ_INT32 dep = (drag.x() - drag.y()) / 2;
m_rectCrop.setTop( m_rectCrop.top() - dep );
m_rectCrop.setWidth( (int) ( m_optWidget->doubleRatio->value() * m_rectCrop.height() ) );
break;
}
case (LowerLeft):
{
- Q_INT32 dep = (drag.x() - drag.y()) / 2;
+ TQ_INT32 dep = (drag.x() - drag.y()) / 2;
m_rectCrop.setBottom( m_rectCrop.bottom() - dep );
m_rectCrop.setLeft( (int) ( m_rectCrop.right() - m_optWidget->doubleRatio->value() * m_rectCrop.height() ) );
break;
@@ -359,8 +359,8 @@ void KisToolCrop::move(KisMoveEvent *e)
}
m_rectCrop = m_rectCrop.normalize();
- m_rectCrop = m_rectCrop.intersect( QRect(0,0, imageWidth + 1, imageHeight + 1 ) );
- m_dragStart = e->pos().floorQPoint();
+ m_rectCrop = m_rectCrop.intersect( TQRect(0,0, imageWidth + 1, imageHeight + 1 ) );
+ m_dragStart = e->pos().floorTQPoint();
paintOutlineWithHandles();
}
}
@@ -371,7 +371,7 @@ void KisToolCrop::move(KisMoveEvent *e)
if ( m_haveCropSelection ) //if the crop selection is set
{
KisCanvasController *controller = m_subject->canvasController();
- Q_INT32 type = mouseOnHandle(controller->windowToView(e->pos().floorQPoint()));
+ TQ_INT32 type = mouseOnHandle(controller->windowToView(e->pos().floorTQPoint()));
//set resize cursor if we are on one of the handles
setMoveResizeCursor(type);
}
@@ -381,7 +381,7 @@ void KisToolCrop::move(KisMoveEvent *e)
void KisToolCrop::updateWidgetValues(bool updateratio)
{
- QRect r = realRectCrop();
+ TQRect r = realRectCrop();
setOptionWidgetX(r.x());
setOptionWidgetY(r.y());
setOptionWidgetWidth(r.width() );
@@ -414,12 +414,12 @@ void KisToolCrop::validateSelection(bool updateratio)
KisImageSP image = m_subject->currentImg();
if (image) {
- Q_INT32 imageWidth = image->width();
- Q_INT32 imageHeight = image->height();
- m_rectCrop.setLeft(QMAX(0, m_rectCrop.left()));
- m_rectCrop.setTop(QMAX(0, m_rectCrop.top()));
- m_rectCrop.setRight(QMIN(imageWidth, m_rectCrop.right()));
- m_rectCrop.setBottom(QMIN(imageHeight, m_rectCrop.bottom()));
+ TQ_INT32 imageWidth = image->width();
+ TQ_INT32 imageHeight = image->height();
+ m_rectCrop.setLeft(TQMAX(0, m_rectCrop.left()));
+ m_rectCrop.setTop(TQMAX(0, m_rectCrop.top()));
+ m_rectCrop.setRight(TQMIN(imageWidth, m_rectCrop.right()));
+ m_rectCrop.setBottom(TQMIN(imageHeight, m_rectCrop.bottom()));
updateWidgetValues(updateratio);
}
@@ -432,36 +432,36 @@ void KisToolCrop::paintOutlineWithHandles()
KisCanvasController *controller = m_subject->canvasController();
KisCanvas *canvas = controller->kiscanvas();
KisCanvasPainter gc(canvas);
- QRect rc;
+ TQRect rc;
paintOutlineWithHandles(gc, rc);
}
}
-void KisToolCrop::paintOutlineWithHandles(KisCanvasPainter& gc, const QRect&)
+void KisToolCrop::paintOutlineWithHandles(KisCanvasPainter& gc, const TQRect&)
{
if (m_subject && (m_selecting || m_haveCropSelection)) {
KisCanvasController *controller = m_subject->canvasController();
RasterOp op = gc.rasterOp();
- QPen old = gc.pen();
- QPen pen(Qt::SolidLine);
+ TQPen old = gc.pen();
+ TQPen pen(TQt::SolidLine);
pen.setWidth(1);
- QPoint start;
- QPoint end;
+ TQPoint start;
+ TQPoint end;
Q_ASSERT(controller);
start = controller->windowToView(m_rectCrop.topLeft());
end = controller->windowToView(m_rectCrop.bottomRight());
- gc.setRasterOp(Qt::NotROP);
+ gc.setRasterOp(TQt::NotROP);
gc.setPen(pen);
//draw handles
- m_handlesRegion = handles(QRect(start, end));
+ m_handlesRegion = handles(TQRect(start, end));
- Q_INT32 startx;
- Q_INT32 starty;
- Q_INT32 endx;
- Q_INT32 endy;
+ TQ_INT32 startx;
+ TQ_INT32 starty;
+ TQ_INT32 endx;
+ TQ_INT32 endy;
if(start.x()<=end.x())
{
startx=start.x();
@@ -500,10 +500,10 @@ void KisToolCrop::paintOutlineWithHandles(KisCanvasPainter& gc, const QRect&)
gc.drawLine(startx,endy + m_handleSize / 2 + 1, startx, controller->kiscanvas()->height());
gc.drawLine(endx,0,endx,starty - m_handleSize / 2);
gc.drawLine(endx + m_handleSize / 2 + 1,starty, controller->kiscanvas()->width(), starty);
- QMemArray <QRect> rects = m_handlesRegion.rects ();
- for (QMemArray <QRect>::ConstIterator it = rects.begin (); it != rects.end (); ++it)
+ TQMemArray <TQRect> rects = m_handlesRegion.rects ();
+ for (TQMemArray <TQRect>::ConstIterator it = rects.begin (); it != rects.end (); ++it)
{
- gc.fillRect (*it, Qt::black);
+ gc.fillRect (*it, TQt::black);
}
@@ -523,12 +523,12 @@ void KisToolCrop::crop() {
if (!img)
return;
- QRect rc = realRectCrop().normalize();
+ TQRect rc = realRectCrop().normalize();
// The visitor adds the undo steps to the macro
if (m_optWidget->cmbType->currentItem() == 0) {
- QRect dirty = img->bounds();
+ TQRect dirty = img->bounds();
// The layer(s) under the current layer will take care of adding
// undo information to the Crop macro.
@@ -548,7 +548,7 @@ void KisToolCrop::crop() {
img->resize(rc, true);
}
- m_rectCrop = QRect(0,0,0,0);
+ m_rectCrop = TQRect(0,0,0,0);
updateWidgetValues();
}
@@ -660,7 +660,7 @@ void KisToolCrop::setRatio(double )
}
}
-void KisToolCrop::setOptionWidgetX(Q_INT32 x)
+void KisToolCrop::setOptionWidgetX(TQ_INT32 x)
{
// Disable signals otherwise we get the valueChanged signal, which we don't want
// to go through the logic for setting values that way.
@@ -669,21 +669,21 @@ void KisToolCrop::setOptionWidgetX(Q_INT32 x)
m_optWidget->intX->blockSignals(false);
}
-void KisToolCrop::setOptionWidgetY(Q_INT32 y)
+void KisToolCrop::setOptionWidgetY(TQ_INT32 y)
{
m_optWidget->intY->blockSignals(true);
m_optWidget->intY->setValue(y);
m_optWidget->intY->blockSignals(false);
}
-void KisToolCrop::setOptionWidgetWidth(Q_INT32 x)
+void KisToolCrop::setOptionWidgetWidth(TQ_INT32 x)
{
m_optWidget->intWidth->blockSignals(true);
m_optWidget->intWidth->setValue(x);
m_optWidget->intWidth->blockSignals(false);
}
-void KisToolCrop::setOptionWidgetHeight(Q_INT32 y)
+void KisToolCrop::setOptionWidgetHeight(TQ_INT32 y)
{
m_optWidget->intHeight->blockSignals(true);
m_optWidget->intHeight->setValue(y);
@@ -698,23 +698,23 @@ void KisToolCrop::setOptionWidgetRatio(double ratio)
}
-QWidget* KisToolCrop::createOptionWidget(QWidget* parent)
+TQWidget* KisToolCrop::createOptionWidget(TQWidget* tqparent)
{
- m_optWidget = new WdgToolCrop(parent);
+ m_optWidget = new WdgToolCrop(tqparent);
Q_CHECK_PTR(m_optWidget);
- connect(m_optWidget->bnCrop, SIGNAL(clicked()), this, SLOT(crop()));
+ connect(m_optWidget->bnCrop, TQT_SIGNAL(clicked()), this, TQT_SLOT(crop()));
- connect(m_optWidget->intX, SIGNAL(valueChanged(int)), this, SLOT(setCropX(int)));
- connect(m_optWidget->intY, SIGNAL(valueChanged(int)), this, SLOT(setCropY(int)));
- connect(m_optWidget->intWidth, SIGNAL(valueChanged(int)), this, SLOT(setCropWidth(int)));
- connect(m_optWidget->intHeight, SIGNAL(valueChanged(int)), this, SLOT(setCropHeight(int)));
- connect(m_optWidget->doubleRatio, SIGNAL(valueChanged(double)), this, SLOT(setRatio( double )));
+ connect(m_optWidget->intX, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setCropX(int)));
+ connect(m_optWidget->intY, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setCropY(int)));
+ connect(m_optWidget->intWidth, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setCropWidth(int)));
+ connect(m_optWidget->intHeight, TQT_SIGNAL(valueChanged(int)), this, TQT_SLOT(setCropHeight(int)));
+ connect(m_optWidget->doubleRatio, TQT_SIGNAL(valueChanged(double)), this, TQT_SLOT(setRatio( double )));
return m_optWidget;
}
-QWidget* KisToolCrop::optionWidget()
+TQWidget* KisToolCrop::optionWidget()
{
return m_optWidget;
}
@@ -728,7 +728,7 @@ void KisToolCrop::setup(KActionCollection *collection)
"tool_crop",
0,
this,
- SLOT(activate()),
+ TQT_SLOT(activate()),
collection,
name());
Q_CHECK_PTR(m_action);
@@ -740,31 +740,31 @@ void KisToolCrop::setup(KActionCollection *collection)
}
}
-QRect toQRect(double x, double y, int w, int h)
+TQRect toTQRect(double x, double y, int w, int h)
{
- return QRect(int(x), int(y), w, h);
+ return TQRect(int(x), int(y), w, h);
}
-QRegion KisToolCrop::handles(QRect rect)
+TQRegion KisToolCrop::handles(TQRect rect)
{
- QRegion handlesRegion;
+ TQRegion handlesRegion;
//add handle at the lower right corner
- handlesRegion += toQRect( QABS( rect.width() ) - m_handleSize / 2.0, QABS( rect.height() ) - m_handleSize / 2.0, m_handleSize, m_handleSize );
+ handlesRegion += toTQRect( TQABS( rect.width() ) - m_handleSize / 2.0, TQABS( rect.height() ) - m_handleSize / 2.0, m_handleSize, m_handleSize );
//add handle at the upper right corner
- handlesRegion += toQRect( QABS( rect.width() ) - m_handleSize / 2.0 , 0 - m_handleSize / 2.0, m_handleSize, m_handleSize );
+ handlesRegion += toTQRect( TQABS( rect.width() ) - m_handleSize / 2.0 , 0 - m_handleSize / 2.0, m_handleSize, m_handleSize );
//add rectangle at the lower left corner
- handlesRegion += toQRect( 0 - m_handleSize / 2.0 , QABS( rect.height() ) - m_handleSize / 2.0, m_handleSize, m_handleSize );
+ handlesRegion += toTQRect( 0 - m_handleSize / 2.0 , TQABS( rect.height() ) - m_handleSize / 2.0, m_handleSize, m_handleSize );
//add rectangle at the upper left corner
- handlesRegion += toQRect( 0 - m_handleSize / 2.0, 0 - m_handleSize / 2.0, m_handleSize, m_handleSize );
+ handlesRegion += toTQRect( 0 - m_handleSize / 2.0, 0 - m_handleSize / 2.0, m_handleSize, m_handleSize );
//add handle at the lower edge of the rectangle
- handlesRegion += toQRect( ( QABS( rect.width() ) - m_handleSize ) / 2.0 , QABS( rect.height() ) - m_handleSize / 2.0, m_handleSize, m_handleSize );
+ handlesRegion += toTQRect( ( TQABS( rect.width() ) - m_handleSize ) / 2.0 , TQABS( rect.height() ) - m_handleSize / 2.0, m_handleSize, m_handleSize );
//add handle at the right edge of the rectangle
- handlesRegion += toQRect( QABS( rect.width() ) - m_handleSize / 2.0 , ( QABS( rect.height() ) - m_handleSize ) / 2.0, m_handleSize, m_handleSize );
+ handlesRegion += toTQRect( TQABS( rect.width() ) - m_handleSize / 2.0 , ( TQABS( rect.height() ) - m_handleSize ) / 2.0, m_handleSize, m_handleSize );
//add handle at the upper edge of the rectangle
- handlesRegion += toQRect( ( QABS( rect.width() ) - m_handleSize ) / 2.0 , 0 - m_handleSize / 2.0, m_handleSize, m_handleSize );
+ handlesRegion += toTQRect( ( TQABS( rect.width() ) - m_handleSize ) / 2.0 , 0 - m_handleSize / 2.0, m_handleSize, m_handleSize );
//add handle at the left edge of the rectangle
- handlesRegion += toQRect( 0 - m_handleSize / 2.0, ( QABS( rect.height() ) - m_handleSize ) / 2.0, m_handleSize, m_handleSize );
+ handlesRegion += toTQRect( 0 - m_handleSize / 2.0, ( TQABS( rect.height() ) - m_handleSize ) / 2.0, m_handleSize, m_handleSize );
//move the handles to the correct position
if( rect.width() >= 0 && rect.height() >= 0)
@@ -773,30 +773,30 @@ QRegion KisToolCrop::handles(QRect rect)
}
else if( rect.width() < 0 && rect.height() >= 0)
{
- handlesRegion.translate ( rect.x() - QABS( rect.width() ), rect.y() );
+ handlesRegion.translate ( rect.x() - TQABS( rect.width() ), rect.y() );
}
else if( rect.width() >= 0 && rect.height() < 0)
{
- handlesRegion.translate ( rect.x(), rect.y() - QABS( rect.height() ) );
+ handlesRegion.translate ( rect.x(), rect.y() - TQABS( rect.height() ) );
}
else if( rect.width() < 0 && rect.height() < 0)
{
- handlesRegion.translate ( rect.x() - QABS( rect.width() ), rect.y() - QABS( rect.height() ) );
+ handlesRegion.translate ( rect.x() - TQABS( rect.width() ), rect.y() - TQABS( rect.height() ) );
}
return handlesRegion;
}
-Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
+TQ_INT32 KisToolCrop::mouseOnHandle(TQPoint currentViewPoint)
{
KisCanvasController *controller = m_subject->canvasController();
Q_ASSERT(controller);
- QPoint start = controller->windowToView(m_rectCrop.topLeft());
- QPoint end = controller->windowToView(m_rectCrop.bottomRight());
+ TQPoint start = controller->windowToView(m_rectCrop.topLeft());
+ TQPoint end = controller->windowToView(m_rectCrop.bottomRight());
- Q_INT32 startx;
- Q_INT32 starty;
- Q_INT32 endx;
- Q_INT32 endy;
+ TQ_INT32 startx;
+ TQ_INT32 starty;
+ TQ_INT32 endx;
+ TQ_INT32 endy;
if(start.x()<=end.x())
{
startx=start.x();
@@ -818,7 +818,7 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
endy=start.y();
}
- if ( toQRect ( startx - m_handleSize / 2.0, starty - m_handleSize / 2.0, m_handleSize, m_handleSize ).contains( currentViewPoint ) )
+ if ( toTQRect ( startx - m_handleSize / 2.0, starty - m_handleSize / 2.0, m_handleSize, m_handleSize ).tqcontains( currentViewPoint ) )
{
if( !m_selecting )
{
@@ -827,7 +827,7 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
}
return UpperLeft;
}
- else if ( toQRect ( startx - m_handleSize / 2.0, endy - m_handleSize / 2.0, m_handleSize, m_handleSize ).contains( currentViewPoint ) )
+ else if ( toTQRect ( startx - m_handleSize / 2.0, endy - m_handleSize / 2.0, m_handleSize, m_handleSize ).tqcontains( currentViewPoint ) )
{
if( !m_selecting )
{
@@ -836,7 +836,7 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
}
return LowerLeft;
}
- else if ( toQRect ( endx - m_handleSize / 2.0, starty - m_handleSize / 2.0, m_handleSize, m_handleSize ).contains( currentViewPoint ) )
+ else if ( toTQRect ( endx - m_handleSize / 2.0, starty - m_handleSize / 2.0, m_handleSize, m_handleSize ).tqcontains( currentViewPoint ) )
{
if( !m_selecting )
{
@@ -845,7 +845,7 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
}
return UpperRight;
}
- else if ( toQRect ( endx - m_handleSize / 2.0, endy - m_handleSize / 2.0, m_handleSize, m_handleSize ).contains( currentViewPoint ) )
+ else if ( toTQRect ( endx - m_handleSize / 2.0, endy - m_handleSize / 2.0, m_handleSize, m_handleSize ).tqcontains( currentViewPoint ) )
{
if( !m_selecting )
{
@@ -854,7 +854,7 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
}
return LowerRight;
}
- else if ( toQRect ( startx + ( endx - startx - m_handleSize ) / 2.0, starty - m_handleSize / 2.0, m_handleSize, m_handleSize ).contains( currentViewPoint ) )
+ else if ( toTQRect ( startx + ( endx - startx - m_handleSize ) / 2.0, starty - m_handleSize / 2.0, m_handleSize, m_handleSize ).tqcontains( currentViewPoint ) )
{
if( !m_selecting )
{
@@ -862,7 +862,7 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
}
return Upper;
}
- else if ( toQRect ( startx + ( endx - startx - m_handleSize ) / 2.0, endy - m_handleSize / 2, m_handleSize, m_handleSize ).contains( currentViewPoint ) )
+ else if ( toTQRect ( startx + ( endx - startx - m_handleSize ) / 2.0, endy - m_handleSize / 2, m_handleSize, m_handleSize ).tqcontains( currentViewPoint ) )
{
if( !m_selecting )
{
@@ -870,7 +870,7 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
}
return Lower;
}
- else if ( toQRect ( startx - m_handleSize / 2.0, starty + ( endy - starty - m_handleSize ) / 2.0, m_handleSize, m_handleSize ).contains( currentViewPoint ) )
+ else if ( toTQRect ( startx - m_handleSize / 2.0, starty + ( endy - starty - m_handleSize ) / 2.0, m_handleSize, m_handleSize ).tqcontains( currentViewPoint ) )
{
if( !m_selecting )
{
@@ -878,7 +878,7 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
}
return Left;
}
- else if ( toQRect ( endx - m_handleSize / 2.0 , starty + ( endy - starty - m_handleSize ) / 2.0, m_handleSize, m_handleSize ).contains( currentViewPoint ) )
+ else if ( toTQRect ( endx - m_handleSize / 2.0 , starty + ( endy - starty - m_handleSize ) / 2.0, m_handleSize, m_handleSize ).tqcontains( currentViewPoint ) )
{
if( !m_selecting )
{
@@ -886,14 +886,14 @@ Q_INT32 KisToolCrop::mouseOnHandle(QPoint currentViewPoint)
}
return Right;
}
- else if ( toQRect ( startx , starty, endx - startx , endy - starty ).contains( currentViewPoint ) )
+ else if ( toTQRect ( startx , starty, endx - startx , endy - starty ).tqcontains( currentViewPoint ) )
{
return Inside;
}
else return None;
}
-void KisToolCrop::setMoveResizeCursor (Q_INT32 handle)
+void KisToolCrop::setMoveResizeCursor (TQ_INT32 handle)
{
switch (handle)
{
diff --git a/krita/plugins/tools/tool_crop/kis_tool_crop.h b/krita/plugins/tools/tool_crop/kis_tool_crop.h
index 538e4158..5be2daa2 100644
--- a/krita/plugins/tools/tool_crop/kis_tool_crop.h
+++ b/krita/plugins/tools/tool_crop/kis_tool_crop.h
@@ -21,26 +21,27 @@
#ifndef KIS_TOOL_CROP_H_
#define KIS_TOOL_CROP_H_
-#include <qpoint.h>
-#include <qregion.h>
+#include <tqpoint.h>
+#include <tqregion.h>
#include <kis_tool_non_paint.h>
#include <kis_tool_factory.h>
-class QRect;
-class QCursor;
+class TQRect;
+class TQCursor;
class WdgToolCrop;
/**
* Crop tool
*
* TODO: - crop from selection -- i.e, set crop outline to the exact bounds of the selection.
- * - (when moving to Qt 4: replace rectangle with darker, dimmer overlay layer
+ * - (when moving to TQt 4: replace rectangle with darker, dimmer overlay layer
* like we have for selections right now)
*/
class KisToolCrop : public KisToolNonPaint {
typedef KisToolNonPaint super;
Q_OBJECT
+ TQ_OBJECT
public:
@@ -49,14 +50,14 @@ public:
virtual void update(KisCanvasSubject *subject);
- virtual QWidget* createOptionWidget(QWidget* parent);
- virtual QWidget* optionWidget();
+ virtual TQWidget* createOptionWidget(TQWidget* tqparent);
+ virtual TQWidget* optionWidget();
virtual void setup(KActionCollection *collection);
virtual enumToolType toolType() { return TOOL_TRANSFORM; }
- virtual Q_UINT32 priority() { return 1; }
+ virtual TQ_UINT32 priority() { return 1; }
virtual void paint(KisCanvasPainter& gc);
- virtual void paint(KisCanvasPainter& gc, const QRect& rc);
+ virtual void paint(KisCanvasPainter& gc, const TQRect& rc);
virtual void buttonPress(KisButtonPressEvent *e);
virtual void move(KisMoveEvent *e);
virtual void buttonRelease(KisButtonReleaseEvent *e);
@@ -70,16 +71,16 @@ public slots:
private:
void clearRect();
- QRegion handles(QRect rect);
+ TQRegion handles(TQRect rect);
void paintOutlineWithHandles();
- void paintOutlineWithHandles(KisCanvasPainter& gc, const QRect& rc);
- Q_INT32 mouseOnHandle (const QPoint currentViewPoint);
- void setMoveResizeCursor (Q_INT32 handle);
+ void paintOutlineWithHandles(KisCanvasPainter& gc, const TQRect& rc);
+ TQ_INT32 mouseOnHandle (const TQPoint currentViewPoint);
+ void setMoveResizeCursor (TQ_INT32 handle);
void validateSelection(bool updateratio = true);
- void setOptionWidgetX(Q_INT32 x);
- void setOptionWidgetY(Q_INT32 y);
- void setOptionWidgetWidth(Q_INT32 x);
- void setOptionWidgetHeight(Q_INT32 y);
+ void setOptionWidgetX(TQ_INT32 x);
+ void setOptionWidgetY(TQ_INT32 y);
+ void setOptionWidgetWidth(TQ_INT32 x);
+ void setOptionWidgetHeight(TQ_INT32 y);
void setOptionWidgetRatio(double ratio);
private slots:
@@ -91,26 +92,26 @@ private slots:
void setCropHeight(int y);
void setRatio(double ratio);
- inline QRect realRectCrop() { QRect r = m_rectCrop; r.setSize(r.size() - QSize(1,1)); return r; }
+ inline TQRect realRectCrop() { TQRect r = m_rectCrop; r.setSize(r.size() - TQSize(1,1)); return r; }
private:
void updateWidgetValues(bool updateratio = true);
KisCanvasSubject *m_subject;
- QRect m_rectCrop; // Is the coordinate of the outline rect and not of the region to crop (to get the region to crop you need to remove 1 to width and height
-// QPoint m_startPos;
-// QPoint m_endPos;
+ TQRect m_rectCrop; // Is the coordinate of the outline rect and not of the region to crop (to get the region to crop you need to remove 1 to width and height
+// TQPoint m_startPos;
+// TQPoint m_endPos;
bool m_selecting;
- QPoint m_dragStart;
- QPoint m_dragStop;
+ TQPoint m_dragStart;
+ TQPoint m_dragStop;
WdgToolCrop* m_optWidget;
- Q_INT32 m_handleSize;
- QRegion m_handlesRegion;
+ TQ_INT32 m_handleSize;
+ TQRegion m_handlesRegion;
bool m_haveCropSelection;
- Q_INT32 m_dx, m_dy;
- Q_INT32 m_mouseOnHandleType;
- QCursor m_cropCursor;
+ TQ_INT32 m_dx, m_dy;
+ TQ_INT32 m_mouseOnHandleType;
+ TQCursor m_cropCursor;
enum handleType
{
diff --git a/krita/plugins/tools/tool_crop/tool_crop.cc b/krita/plugins/tools/tool_crop/tool_crop.cc
index 542af31b..7090b713 100644
--- a/krita/plugins/tools/tool_crop/tool_crop.cc
+++ b/krita/plugins/tools/tool_crop/tool_crop.cc
@@ -20,7 +20,7 @@
#include <stdlib.h>
#include <vector>
-#include <qpoint.h>
+#include <tqpoint.h>
#include <klocale.h>
#include <kiconloader.h>
@@ -42,14 +42,14 @@ typedef KGenericFactory<ToolCrop> ToolCropFactory;
K_EXPORT_COMPONENT_FACTORY( kritatoolcrop, ToolCropFactory( "krita" ) )
-ToolCrop::ToolCrop(QObject *parent, const char *name, const QStringList &)
- : KParts::Plugin(parent, name)
+ToolCrop::ToolCrop(TQObject *tqparent, const char *name, const TQStringList &)
+ : KParts::Plugin(tqparent, name)
{
setInstance(ToolCropFactory::instance());
- if ( parent->inherits("KisToolRegistry") )
+ if ( tqparent->inherits("KisToolRegistry") )
{
- KisToolRegistry * r = dynamic_cast<KisToolRegistry*>(parent);
+ KisToolRegistry * r = dynamic_cast<KisToolRegistry*>(tqparent);
r->add(new KisToolCropFactory());
}
diff --git a/krita/plugins/tools/tool_crop/tool_crop.h b/krita/plugins/tools/tool_crop/tool_crop.h
index 1ebe9064..df5d7c28 100644
--- a/krita/plugins/tools/tool_crop/tool_crop.h
+++ b/krita/plugins/tools/tool_crop/tool_crop.h
@@ -29,8 +29,9 @@ class KisView;
class ToolCrop : public KParts::Plugin
{
Q_OBJECT
+ TQ_OBJECT
public:
- ToolCrop(QObject *parent, const char *name, const QStringList &);
+ ToolCrop(TQObject *tqparent, const char *name, const TQStringList &);
virtual ~ToolCrop();
private:
diff --git a/krita/plugins/tools/tool_crop/wdg_tool_crop.ui b/krita/plugins/tools/tool_crop/wdg_tool_crop.ui
index 8099af7c..4f857cf9 100644
--- a/krita/plugins/tools/tool_crop/wdg_tool_crop.ui
+++ b/krita/plugins/tools/tool_crop/wdg_tool_crop.ui
@@ -1,6 +1,6 @@
<!DOCTYPE UI><UI version="3.3" stdsetdef="1">
<class>WdgToolCrop</class>
-<widget class="QWidget">
+<widget class="TQWidget">
<property name="name">
<cstring>WdgToolCrop</cstring>
</property>
@@ -25,9 +25,9 @@
<property name="spacing">
<number>0</number>
</property>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout3</cstring>
+ <cstring>tqlayout3</cstring>
</property>
<grid>
<property name="name">
@@ -39,7 +39,7 @@
<property name="spacing">
<number>3</number>
</property>
- <widget class="QLabel" row="0" column="0">
+ <widget class="TQLabel" row="0" column="0">
<property name="name">
<cstring>textLabel1</cstring>
</property>
@@ -66,7 +66,7 @@
<number>1000000000</number>
</property>
</widget>
- <widget class="QCheckBox" row="0" column="2">
+ <widget class="TQCheckBox" row="0" column="2">
<property name="name">
<cstring>boolWidth</cstring>
</property>
@@ -93,7 +93,7 @@
<number>1000000000</number>
</property>
</widget>
- <widget class="QCheckBox" row="1" column="2">
+ <widget class="TQCheckBox" row="1" column="2">
<property name="name">
<cstring>boolHeight</cstring>
</property>
@@ -104,7 +104,7 @@
<string>Will keep the height of the crop constant</string>
</property>
</widget>
- <widget class="QLabel" row="1" column="0">
+ <widget class="TQLabel" row="1" column="0">
<property name="name">
<cstring>textLabel3</cstring>
</property>
@@ -123,7 +123,7 @@
<number>2</number>
</property>
</widget>
- <widget class="QCheckBox" row="2" column="2">
+ <widget class="TQCheckBox" row="2" column="2">
<property name="name">
<cstring>boolRatio</cstring>
</property>
@@ -136,9 +136,9 @@
</widget>
</grid>
</widget>
- <widget class="QLayoutWidget">
+ <widget class="TQLayoutWidget">
<property name="name">
- <cstring>layout9</cstring>
+ <cstring>tqlayout9</cstring>
</property>
<hbox>
<property name="name">
@@ -147,7 +147,7 @@
<property name="margin">
<number>0</number>
</property>
- <widget class="QComboBox">
+ <widget class="TQComboBox">
<item>
<property name="text">
<string>Layer</string>
@@ -165,7 +165,7 @@
<number>1</number>
</property>
</widget>
- <widget class="QPushButton">
+ <widget class="TQPushButton">
<property name="name">
<cstring>bnCrop</cstring>
</property>
@@ -185,7 +185,7 @@
<property name="sizeType">
<enum>Expanding</enum>
</property>
- <property name="sizeHint">
+ <property name="tqsizeHint">
<size>
<width>20</width>
<height>16</height>
@@ -204,7 +204,7 @@
<tabstop>cmbType</tabstop>
<tabstop>bnCrop</tabstop>
</tabstops>
-<layoutdefaults spacing="6" margin="11"/>
+<tqlayoutdefaults spacing="6" margin="11"/>
<includehints>
<includehint>knuminput.h</includehint>
<includehint>knuminput.h</includehint>