summaryrefslogtreecommitdiffstats
path: root/krita/plugins/tools/selectiontools/kis_tool_select_elliptical.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/selectiontools/kis_tool_select_elliptical.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/selectiontools/kis_tool_select_elliptical.cc')
-rw-r--r--krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc70
1 files changed, 35 insertions, 35 deletions
diff --git a/krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc b/krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc
index 226277b2..a97518ce 100644
--- a/krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc
+++ b/krita/plugins/tools/selectiontools/kis_tool_select_elliptical.cc
@@ -18,10 +18,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>
@@ -84,10 +84,10 @@ void KisToolSelectElliptical::update(KisCanvasSubject *subject)
void KisToolSelectElliptical::paint(KisCanvasPainter& gc)
{
if (m_selecting)
- paintOutline(gc, QRect());
+ paintOutline(gc, TQRect());
}
-void KisToolSelectElliptical::paint(KisCanvasPainter& gc, const QRect& rc)
+void KisToolSelectElliptical::paint(KisCanvasPainter& gc, const TQRect& rc)
{
if (m_selecting)
paintOutline(gc, rc);
@@ -131,23 +131,23 @@ void KisToolSelectElliptical::move(KisMoveEvent *e)
if (m_subject && m_selecting) {
paintOutline();
// move (alt) or resize ellipse
- 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);
// circle?
- 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 {
@@ -169,7 +169,7 @@ void KisToolSelectElliptical::buttonRelease(KisButtonReleaseEvent *e)
if (m_startPos == m_endPos) {
clearSelection();
} else {
- QApplication::setOverrideCursor(KisCursor::waitCursor());
+ TQApplication::setOverrideCursor(KisCursor::waitCursor());
KisImageSP img = m_subject->currentImg();
if (!img)
@@ -199,16 +199,16 @@ void KisToolSelectElliptical::buttonRelease(KisButtonReleaseEvent *e)
if(m_selectAction==SELECTION_SUBTRACT)
dev->selection()->invert();
}
- QRect rc( m_startPos.floorQPoint(), m_endPos.floorQPoint());
+ TQRect rc( m_startPos.floorTQPoint(), m_endPos.floorTQPoint());
rc = rc.normalize();
KisSelectionSP tmpSel = new KisSelection(dev);
- KisAutobrushCircleShape shape(rc.width(),rc.height(), 1, 1);
- Q_UINT8 value;
+ KisAutobrushCircleShape tqshape(rc.width(),rc.height(), 1, 1);
+ TQ_UINT8 value;
for (int y = 0; y <= rc.height(); y++)
for (int x = 0; x <= rc.width(); x++)
{
- value = MAX_SELECTED - shape.valueAt(x,y);
+ value = MAX_SELECTED - tqshape.valueAt(x,y);
tmpSel->setSelected( x+rc.x(), y+rc.y(), value);
}
switch(m_selectAction)
@@ -232,7 +232,7 @@ void KisToolSelectElliptical::buttonRelease(KisButtonReleaseEvent *e)
if (img->undo())
img->undoAdapter()->addCommand(t);
- QApplication::restoreOverrideCursor();
+ TQApplication::restoreOverrideCursor();
}
}
m_selecting = false;
@@ -245,29 +245,29 @@ void KisToolSelectElliptical::paintOutline()
KisCanvasController *controller = m_subject->canvasController();
KisCanvas *canvas = controller->kiscanvas();
KisCanvasPainter gc(canvas);
- QRect rc;
+ TQRect rc;
paintOutline(gc, rc);
}
}
-void KisToolSelectElliptical::paintOutline(KisCanvasPainter& gc, const QRect&)
+void KisToolSelectElliptical::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.drawEllipse(QRect(start, end));
+ gc.drawEllipse(TQRect(start, end));
gc.setRasterOp(op);
gc.setPen(old);
}
@@ -285,9 +285,9 @@ void KisToolSelectElliptical::setup(KActionCollection *collection)
if (m_action == 0) {
m_action = new KRadioAction(i18n("&Elliptical Selection"),
"tool_elliptical_selection" ,
- Qt::Key_J,
+ TQt::Key_J,
this,
- SLOT(activate()),
+ TQT_SLOT(activate()),
collection,
name());
Q_CHECK_PTR(m_action);
@@ -297,21 +297,21 @@ void KisToolSelectElliptical::setup(KActionCollection *collection)
}
}
-QWidget* KisToolSelectElliptical::createOptionWidget(QWidget* parent)
+TQWidget* KisToolSelectElliptical::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("Elliptical 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* KisToolSelectElliptical::optionWidget()
+TQWidget* KisToolSelectElliptical::optionWidget()
{
return m_optWidget;
}