From f008adb5a77e094eaf6abf3fc0f36958e66896a5 Mon Sep 17 00:00:00 2001 From: tpearson Date: Sat, 25 Jun 2011 05:28:35 +0000 Subject: 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 --- kexi/formeditor/resizehandle.cpp | 72 ++++++++++++++++++++-------------------- 1 file changed, 36 insertions(+), 36 deletions(-) (limited to 'kexi/formeditor/resizehandle.cpp') diff --git a/kexi/formeditor/resizehandle.cpp b/kexi/formeditor/resizehandle.cpp index 0731926f..ac1cb4cb 100644 --- a/kexi/formeditor/resizehandle.cpp +++ b/kexi/formeditor/resizehandle.cpp @@ -20,8 +20,8 @@ #include #include -#include -#include +#include +#include #include "form.h" #include "formmanager.h" @@ -36,9 +36,9 @@ using namespace KFormDesigner; ResizeHandle::ResizeHandle(ResizeHandleSet *set, HandlePos pos, bool editing) - : QWidget(set->m_widget->parentWidget()), m_set(set) + : TQWidget(set->m_widget->tqparentWidget()), m_set(set) { -// setBackgroundMode(Qt::NoBackground); +// setBackgroundMode(TQt::NoBackground); m_dragging = false; //m_editing = editing; setEditingMode(editing); @@ -72,53 +72,53 @@ void ResizeHandle::updatePos() { case TopLeft: move(m_set->m_widget->x() - 3, m_set->m_widget->y() - 3); - setCursor(QCursor(SizeFDiagCursor)); + setCursor(TQCursor(SizeFDiagCursor)); break; case TopCenter: move(m_set->m_widget->x() + m_set->m_widget->width()/2 - 3, m_set->m_widget->y() - 3); - setCursor(QCursor(SizeVerCursor)); + setCursor(TQCursor(SizeVerCursor)); break; case TopRight: move(m_set->m_widget->x() + m_set->m_widget->width() - 3, m_set->m_widget->y() - 3); - setCursor(QCursor(SizeBDiagCursor)); + setCursor(TQCursor(SizeBDiagCursor)); break; case LeftCenter: move(m_set->m_widget->x() - 3, m_set->m_widget->y() + m_set->m_widget->height()/2 - 3); - setCursor(QCursor(SizeHorCursor)); + setCursor(TQCursor(SizeHorCursor)); break; case RightCenter: move(m_set->m_widget->x() + m_set->m_widget->width() - 3, m_set->m_widget->y() + m_set->m_widget->height()/2 - 3); - setCursor(QCursor(SizeHorCursor)); + setCursor(TQCursor(SizeHorCursor)); break; case BottomLeft: move(m_set->m_widget->x() - 3, m_set->m_widget->y() + m_set->m_widget->height() - 3); - setCursor(QCursor(SizeBDiagCursor)); + setCursor(TQCursor(SizeBDiagCursor)); break; case BottomCenter: move(m_set->m_widget->x() + m_set->m_widget->width()/2 - 3, m_set->m_widget->y() + m_set->m_widget->height() - 3); - setCursor(QCursor(SizeVerCursor)); + setCursor(TQCursor(SizeVerCursor)); break; case BottomRight: move(m_set->m_widget->x() + m_set->m_widget->width() - 3, m_set->m_widget->y() + m_set->m_widget->height() - 3); - setCursor(QCursor(SizeFDiagCursor)); + setCursor(TQCursor(SizeFDiagCursor)); break; } } -bool ResizeHandle::eventFilter(QObject *o, QEvent *ev) +bool ResizeHandle::eventFilter(TQObject *o, TQEvent *ev) { - if (((ev->type() == QEvent::Move) || (ev->type() == QEvent::Resize)) && o == m_set->m_widget) + if (((ev->type() == TQEvent::Move) || (ev->type() == TQEvent::Resize)) && o == m_set->m_widget) { - //QTimer::singleShot(0,this,SLOT(updatePos())); + //TQTimer::singleShot(0,this,TQT_SLOT(updatePos())); updatePos(); } -/* else if (ev->type() == QEvent::Paint && o == this) { - QPainter p; +/* else if (ev->type() == TQEvent::Paint && o == this) { + TQPainter p; p.begin(m_set->m_widget, true); const bool unclipped = testWFlags( WPaintUnclipped ); setWFlags( WPaintUnclipped ); - p.setPen(QPen(white, 10)); + p.setPen(TQPen(white, 10)); p.setRasterOp(XorROP); p.drawRect( 20, 20, 100, 100 );//m_set->m_widget->x(), m_set->m_widget->y(), 150, 150 ); p.drawRect( m_set->m_widget->x(), m_set->m_widget->y(), 150, 150 ); @@ -131,7 +131,7 @@ bool ResizeHandle::eventFilter(QObject *o, QEvent *ev) return false; } -void ResizeHandle::mousePressEvent(QMouseEvent *ev) +void ResizeHandle::mousePressEvent(TQMouseEvent *ev) { const bool startDragging = !m_dragging; m_dragging = true; @@ -145,7 +145,7 @@ void ResizeHandle::mousePressEvent(QMouseEvent *ev) } } -void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) +void ResizeHandle::mouseMoveEvent(TQMouseEvent *ev) { int gridX = m_set->m_form->gridSize(); int gridY = m_set->m_form->gridSize(); @@ -161,7 +161,7 @@ void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) int dummyx = ev->x() - m_x; int dummyy = ev->y() - m_y; - if(FormManager::self()->snapWidgetsToGrid() && (ev->state() != (LeftButton|ControlButton|AltButton))) + if(FormManager::self()->snapWidgetsToGrid() && (ev->state() != (Qt::LeftButton|ControlButton|AltButton))) { dummyy = (int) ( ((float)dummyy) / ((float)gridY) + 0.5 ); dummyy *= gridY; @@ -220,22 +220,22 @@ void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) tmph = MINIMUM_HEIGHT; } - // Do not resize a widget outside of parent boundaries + // Do not resize a widget outside of tqparent boundaries if(tmpx < 0) { tmpw += tmpx; tmpx = 0; } - else if(tmpx + tmpw > m_set->m_widget->parentWidget()->width()) - tmpw = m_set->m_widget->parentWidget()->width() - tmpx; + else if(tmpx + tmpw > m_set->m_widget->tqparentWidget()->width()) + tmpw = m_set->m_widget->tqparentWidget()->width() - tmpx; if(tmpy < 0) { tmph += tmpy; tmpy = 0; } - else if(tmpy + tmph > m_set->m_widget->parentWidget()->height()) - tmph = m_set->m_widget->parentWidget()->height() - tmpy; + else if(tmpy + tmph > m_set->m_widget->tqparentWidget()->height()) + tmph = m_set->m_widget->tqparentWidget()->height() - tmpy; const bool shouldBeMoved = (tmpx != m_set->m_widget->x()) || (tmpy != m_set->m_widget->y()); const bool shouldBeResized = (tmpw != m_set->m_widget->width()) || (tmph != m_set->m_widget->height()); @@ -246,7 +246,7 @@ void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) // Resize it if (shouldBeResized) { - // Keep a QSize(10, 10) minimum size + // Keep a TQSize(10, 10) minimum size tmpw = (tmpw < MINIMUM_WIDTH) ? MINIMUM_WIDTH : tmpw; tmph = (tmph < MINIMUM_HEIGHT) ? MINIMUM_HEIGHT : tmph; m_set->m_widget->resize(tmpw,tmph); @@ -260,28 +260,28 @@ void ResizeHandle::mouseMoveEvent(QMouseEvent *ev) m_set->m_widget->show(); } -void ResizeHandle::mouseReleaseEvent(QMouseEvent *) +void ResizeHandle::mouseReleaseEvent(TQMouseEvent *) { m_dragging = false; } -void ResizeHandle::paintEvent( QPaintEvent * ) +void ResizeHandle::paintEvent( TQPaintEvent * ) { //draw XORed background - /*QPainter p(this); + /*TQPainter p(this); p.setRasterOp(XorROP); - p.fillRect(QRect(0, 0, 6, 6),white); - bitBlt( this, QPoint(0,0), parentWidget(), rect(), XorROP);*/ + p.fillRect(TQRect(0, 0, 6, 6),white); + bitBlt( this, TQPoint(0,0), tqparentWidget(), rect(), XorROP);*/ } /////////////// ResizeHandleSet ////////////////// -ResizeHandleSet::ResizeHandleSet(QWidget *modify, Form *form, bool editing) -: QObject(modify->parentWidget()), /*m_widget(modify),*/ m_form(form) +ResizeHandleSet::ResizeHandleSet(TQWidget *modify, Form *form, bool editing) +: TQObject(modify->tqparentWidget()), /*m_widget(modify),*/ m_form(form) { m_widget = 0; - /*QWidget *parent = modify->parentWidget(); + /*TQWidget *tqparent = modify->tqparentWidget(); handles[0] = new ResizeHandle( modify, ResizeHandle::TopLeft, editing); handles[1] = new ResizeHandle( modify, ResizeHandle::TopCenter, editing); @@ -301,7 +301,7 @@ ResizeHandleSet::~ResizeHandleSet() } void -ResizeHandleSet::setWidget(QWidget *modify, bool editing) +ResizeHandleSet::setWidget(TQWidget *modify, bool editing) { if(modify == m_widget) return; -- cgit v1.2.1