summaryrefslogtreecommitdiffstats
path: root/krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc
diff options
context:
space:
mode:
Diffstat (limited to 'krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc')
-rw-r--r--krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc66
1 files changed, 33 insertions, 33 deletions
diff --git a/krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc b/krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc
index 61a4c2929..0f29844aa 100644
--- a/krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc
+++ b/krita/plugins/tools/selectiontools/kis_tool_select_rectangular.cc
@@ -21,10 +21,10 @@
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
*/
-#include <qapplication.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qlayout.h>
+#include <tqapplication.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqlayout.h>
#include <kdebug.h>
#include <kaction.h>
@@ -85,10 +85,10 @@ void KisToolSelectRectangular::update(KisCanvasSubject *subject)
void KisToolSelectRectangular::paint(KisCanvasPainter& gc)
{
if (m_selecting)
- paintOutline(gc, QRect());
+ paintOutline(gc, TQRect());
}
-void KisToolSelectRectangular::paint(KisCanvasPainter& gc, const QRect& rc)
+void KisToolSelectRectangular::paint(KisCanvasPainter& gc, const TQRect& rc)
{
if (m_selecting)
paintOutline(gc, rc);
@@ -127,23 +127,23 @@ void KisToolSelectRectangular::move(KisMoveEvent *e)
if (m_subject && m_selecting) {
paintOutline();
// move (alt) or resize rectangle
- if (e->state() & Qt::AltButton) {
+ if (e->state() & TQt::AltButton) {
KisPoint trans = e->pos() - m_endPos;
m_startPos += trans;
m_endPos += trans;
} else {
- KisPoint diag = e->pos() - (e->state() & Qt::ControlButton
+ KisPoint diag = e->pos() - (e->state() & TQt::ControlButton
? m_centerPos : m_startPos);
// square?
- if (e->state() & Qt::ShiftButton) {
- double size = QMAX(fabs(diag.x()), fabs(diag.y()));
+ if (e->state() & TQt::ShiftButton) {
+ double size = TQMAX(fabs(diag.x()), fabs(diag.y()));
double w = diag.x() < 0 ? -size : size;
double h = diag.y() < 0 ? -size : size;
diag = KisPoint(w, h);
}
// resize around center point?
- if (e->state() & Qt::ControlButton) {
+ if (e->state() & TQt::ControlButton) {
m_startPos = m_centerPos - diag;
m_endPos = m_centerPos + diag;
} else {
@@ -183,18 +183,18 @@ void KisToolSelectRectangular::buttonRelease(KisButtonReleaseEvent *e)
m_endPos.setX(img->width());
if (img && img->activeDevice()) {
- QApplication::setOverrideCursor(KisCursor::waitCursor());
+ TQApplication::setOverrideCursor(KisCursor::waitCursor());
KisPaintDeviceSP dev = img->activeDevice();
bool hasSelection = dev->hasSelection();
KisSelectedTransaction *t = 0;
if (img->undo()) t = new KisSelectedTransaction(i18n("Rectangular Selection"), dev);
KisSelectionSP selection = dev->selection();
- QRect rc(m_startPos.floorQPoint(), m_endPos.floorQPoint());
+ TQRect rc(m_startPos.floorTQPoint(), m_endPos.floorTQPoint());
rc = rc.normalize();
// We don't want the border of the 'rectangle' to be included in our selection
- rc.setSize(rc.size() - QSize(1,1));
+ rc.setSize(rc.size() - TQSize(1,1));
if(! hasSelection)
{
@@ -232,7 +232,7 @@ void KisToolSelectRectangular::buttonRelease(KisButtonReleaseEvent *e)
KisCanvasController *controller = m_subject -> canvasController();
controller -> kiscanvas() -> update();
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
}
@@ -246,29 +246,29 @@ void KisToolSelectRectangular::paintOutline()
KisCanvasController *controller = m_subject->canvasController();
KisCanvas *canvas = controller->kiscanvas();
KisCanvasPainter gc(canvas);
- QRect rc;
+ TQRect rc;
paintOutline(gc, rc);
}
}
-void KisToolSelectRectangular::paintOutline(KisCanvasPainter& gc, const QRect&)
+void KisToolSelectRectangular::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.floorQPoint());
- end = controller->windowToView(m_endPos.floorQPoint());
+ start = controller->windowToView(m_startPos.floorTQPoint());
+ end = controller->windowToView(m_endPos.floorTQPoint());
- 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);
}
@@ -286,9 +286,9 @@ void KisToolSelectRectangular::setup(KActionCollection *collection)
if (m_action == 0) {
m_action = new KRadioAction(i18n("&Rectangular Selection"),
"tool_rect_selection",
- Qt::Key_R,
+ TQt::Key_R,
this,
- SLOT(activate()),
+ TQT_SLOT(activate()),
collection,
name());
Q_CHECK_PTR(m_action);
@@ -298,21 +298,21 @@ void KisToolSelectRectangular::setup(KActionCollection *collection)
}
}
-QWidget* KisToolSelectRectangular::createOptionWidget(QWidget* parent)
+TQWidget* KisToolSelectRectangular::createOptionWidget(TQWidget* tqparent)
{
- m_optWidget = new KisSelectionOptions(parent, m_subject);
+ m_optWidget = new KisSelectionOptions(tqparent, m_subject);
Q_CHECK_PTR(m_optWidget);
m_optWidget->setCaption(i18n("Rectangular Selection"));
- connect (m_optWidget, SIGNAL(actionChanged(int)), this, SLOT(slotSetAction(int)));
+ connect (m_optWidget, TQT_SIGNAL(actionChanged(int)), this, TQT_SLOT(slotSetAction(int)));
- QVBoxLayout * l = dynamic_cast<QVBoxLayout*>(m_optWidget->layout());
- l->addItem(new QSpacerItem(1, 1, QSizePolicy::Fixed, QSizePolicy::Expanding));
+ TQVBoxLayout * l = dynamic_cast<TQVBoxLayout*>(m_optWidget->tqlayout());
+ l->addItem(new TQSpacerItem(1, 1, TQSizePolicy::Fixed, TQSizePolicy::Expanding));
return m_optWidget;
}
-QWidget* KisToolSelectRectangular::optionWidget()
+TQWidget* KisToolSelectRectangular::optionWidget()
{
return m_optWidget;
}