diff options
Diffstat (limited to 'src/canvasmanipulator.cpp')
-rw-r--r-- | src/canvasmanipulator.cpp | 206 |
1 files changed, 103 insertions, 103 deletions
diff --git a/src/canvasmanipulator.cpp b/src/canvasmanipulator.cpp index 7c3ed17..eb4bd90 100644 --- a/src/canvasmanipulator.cpp +++ b/src/canvasmanipulator.cpp @@ -30,12 +30,12 @@ #include <kdebug.h> #include <kglobal.h> -#include <qpainter.h> -#include <qtimer.h> +#include <tqpainter.h> +#include <tqtimer.h> CMManager::CMManager( ItemDocument *itemDocument ) - : QObject() + : TQObject() { b_allowItemScroll = true; p_lastMouseOverResizeHandle = 0l; @@ -45,8 +45,8 @@ CMManager::CMManager( ItemDocument *itemDocument ) p_lastMouseOverItem = 0l; p_lastItemClicked = 0l; m_drawAction = -1; - m_allowItemScrollTmr = new QTimer(this); - connect( m_allowItemScrollTmr, SIGNAL(timeout()), this, SLOT(slotAllowItemScroll()) ); + m_allowItemScrollTmr = new TQTimer(this); + connect( m_allowItemScrollTmr, TQT_SIGNAL(timeout()), this, TQT_SLOT(slotAllowItemScroll()) ); KGlobal::config()->setGroup("General"); slotSetManualRoute( KGlobal::config()->readBoolEntry( "ManualRouting", false ) ); @@ -71,7 +71,7 @@ CMManager::~CMManager() void CMManager::addManipulatorInfo( ManipulatorInfo *eventInfo ) { - if ( eventInfo && !m_manipulatorInfoList.contains(eventInfo) ) { + if ( eventInfo && !m_manipulatorInfoList.tqcontains(eventInfo) ) { m_manipulatorInfoList.prepend(eventInfo); } } @@ -134,7 +134,7 @@ void CMManager::mousePressEvent( EventInfo eventInfo ) { Widget *widget = dynamic_cast<Widget*>(eventInfo.qcanvasItemClickedOn); if (widget) - eventInfo.qcanvasItemClickedOn = widget->parent(); + eventInfo.qcanvasItemClickedOn = widget->tqparent(); } case ItemDocument::RTTI::CNItem: { @@ -197,7 +197,7 @@ void CMManager::mouseDoubleClickEvent( const EventInfo &eventInfo ) Widget *widget = dynamic_cast<Widget*>(eventInfo.qcanvasItemClickedOn); if (widget) { - widget->parent()->mouseDoubleClickEvent(eventInfo); + widget->tqparent()->mouseDoubleClickEvent(eventInfo); return; } } @@ -222,17 +222,17 @@ void CMManager::mouseMoveEvent( const EventInfo &eventInfo ) } //BEGIN - QCanvasItem *qcnItem = p_itemDocument->itemAtTop(eventInfo.pos); + TQCanvasItem *qcnItem = p_itemDocument->itemAtTop(eventInfo.pos); Item *item; Widget *widget = dynamic_cast<Widget*>(qcnItem); if (widget) - item = widget->parent(); + item = widget->tqparent(); else item = dynamic_cast<Item*>(qcnItem); - if ( p_lastMouseOverItem != (QGuardedPtr<Item>)item ) + if ( p_lastMouseOverItem != (TQGuardedPtr<Item>)item ) { - QEvent event(QEvent::Leave); + TQEvent event(TQEvent::Leave); if (p_lastMouseOverItem) p_lastMouseOverItem->leaveEvent(); @@ -260,7 +260,7 @@ void CMManager::mouseMoveEvent( const EventInfo &eventInfo ) void CMManager::updateCurrentResizeHandle( ResizeHandle * resizeHandle ) { - if ( p_lastMouseOverResizeHandle != (QGuardedPtr<ResizeHandle>)resizeHandle ) + if ( p_lastMouseOverResizeHandle != (TQGuardedPtr<ResizeHandle>)resizeHandle ) { if (p_lastMouseOverResizeHandle) p_lastMouseOverResizeHandle->setHover(false); @@ -295,11 +295,11 @@ void CMManager::wheelEvent( const EventInfo &eventInfo ) bool accepted = false; if (b_allowItemScroll) { - QCanvasItem *qcnItem = p_itemDocument->itemAtTop(eventInfo.pos); + TQCanvasItem *qcnItem = p_itemDocument->itemAtTop(eventInfo.pos); Item *item; Widget *widget = dynamic_cast<Widget*>(qcnItem); if (widget) - item = widget->parent(); + item = widget->tqparent(); else item = dynamic_cast<Item*>(qcnItem); @@ -353,7 +353,7 @@ void CMManager::setCMState( CMState type, bool state ) } -void CMManager::setRepeatedAddId( const QString & repeatedId ) +void CMManager::setRepeatedAddId( const TQString & repeatedId ) { m_repeatedItemId = repeatedId; } @@ -501,13 +501,13 @@ ConnectorDraw::~ConnectorDraw() } -QColor ConnectorDraw::validConnectionColor() +TQColor ConnectorDraw::validConnectionColor() { - return QColor( 255, 166, 0 ); + return TQColor( 255, 166, 0 ); } -static double qpoint_distance( const QPoint & p1, const QPoint & p2 ) +static double qpoint_distance( const TQPoint & p1, const TQPoint & p2 ) { double dx = p1.x() - p2.x(); double dy = p1.y() - p2.y(); @@ -516,19 +516,19 @@ static double qpoint_distance( const QPoint & p1, const QPoint & p2 ) } -QPoint ConnectorDraw::toValidPos( const QPoint & clickPos, Connector * clickedConnector ) const +TQPoint ConnectorDraw::toValidPos( const TQPoint & clickPos, Connector * clickedConnector ) const { if ( !clickedConnector ) return clickPos; - const QPointList pointList = clickedConnector->connectorPoints(); + const TQPointList pointList = clickedConnector->connectorPoints(); - QPointList::const_iterator end = pointList.end(); + TQPointList::const_iterator end = pointList.end(); double dl[] = { 0.5, 8.5, 11.5, 18.0, 23.0 }; // various distances rounded up of (0,0) cells, (0,1), etc for ( unsigned i = 0; i < 5; ++i ) { - for ( QPointList::const_iterator it = pointList.begin(); it != end; ++it ) + for ( TQPointList::const_iterator it = pointList.begin(); it != end; ++it ) { if ( qpoint_distance( *it, clickPos ) <= dl[i] ) return *it; @@ -556,7 +556,7 @@ Connector * ConnectorDraw::toConnector( Node * node ) } -void ConnectorDraw::grabEndStuff( QCanvasItem * endItem, const QPoint & pos, bool posIsExact ) +void ConnectorDraw::grabEndStuff( TQCanvasItem * endItem, const TQPoint & pos, bool posIsExact ) { if (!endItem) return; @@ -621,7 +621,7 @@ bool CMAutoConnector::mousePressedInitial( const EventInfo &eventInfo ) if (p_startNode) { - m_eventInfo.pos = m_prevPos = p_icnDocument->gridSnap( QPoint( (int)p_startNode->x(), (int)p_startNode->y() ) ); + m_eventInfo.pos = m_prevPos = p_icnDocument->gridSnap( TQPoint( (int)p_startNode->x(), (int)p_startNode->y() ) ); if (p_startNode->numCon( true, false ) > 2) { p_startConnector = toConnector(p_startNode); @@ -640,8 +640,8 @@ bool CMAutoConnector::mousePressedInitial( const EventInfo &eventInfo ) p_icnDocument->unselectAll(); delete m_connectorLine; - m_connectorLine = new QCanvasLine(p_canvas); - m_connectorLine->setPen( QColor(0,0,0) ); + m_connectorLine = new TQCanvasLine(p_canvas); + m_connectorLine->setPen( TQColor(0,0,0) ); m_connectorLine->setZ( ItemDocument::Z::ConnectorCreateLine ); m_connectorLine->show(); return false; @@ -650,7 +650,7 @@ bool CMAutoConnector::mousePressedInitial( const EventInfo &eventInfo ) bool CMAutoConnector::mouseMoved( const EventInfo &eventInfo ) { - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; int newX = p_icnDocument->gridSnap( pos.x() ); int newY = p_icnDocument->gridSnap( pos.y() ); @@ -673,18 +673,18 @@ bool CMAutoConnector::mouseMoved( const EventInfo &eventInfo ) if (movedFlag) { - QCanvasItem *startItem = 0l; + TQCanvasItem *startItem = 0l; if (p_startNode) startItem = p_startNode; else if (p_startConnector) startItem = p_startConnector; - QCanvasItem *endItem = p_icnDocument->itemAtTop( QPoint( newX, newY ) ); + TQCanvasItem *endItem = p_icnDocument->itemAtTop( TQPoint( newX, newY ) ); if ( endItem && endItem->rtti() == ItemDocument::RTTI::CNItem ) - endItem = (static_cast<CNItem*>(endItem))->getClosestNode( QPoint( newX, newY ) ); + endItem = (static_cast<CNItem*>(endItem))->getClosestNode( TQPoint( newX, newY ) ); bool validLine = p_icnDocument->canConnect( startItem, endItem ); - m_connectorLine->setPen( validLine ? validConnectionColor() : Qt::black ); + m_connectorLine->setPen( validLine ? validConnectionColor() : TQt::black ); } return false; } @@ -692,13 +692,13 @@ bool CMAutoConnector::mouseMoved( const EventInfo &eventInfo ) bool CMAutoConnector::mouseReleased( const EventInfo &eventInfo ) { - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; - QPoint end = m_connectorLine->endPoint(); + TQPoint end = m_connectorLine->endPoint(); delete m_connectorLine; m_connectorLine = 0l; - QCanvasItem *qcanvasItem = p_icnDocument->itemAtTop(end); + TQCanvasItem *qcanvasItem = p_icnDocument->itemAtTop(end); if ( !qcanvasItem ) return true; @@ -782,7 +782,7 @@ bool CMManualConnector::mousePressedInitial( const EventInfo &eventInfo ) p_icnDocument->unselectAll(); - QPoint sp; + TQPoint sp; if ( eventInfo.itemRtti == ItemDocument::RTTI::Node ) { @@ -825,7 +825,7 @@ bool CMManualConnector::mouseMoved( const EventInfo &eventInfo ) if ( !m_manualConnectorDraw ) return true; - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; int newX = p_icnDocument->gridSnap( pos.x() ); int newY = p_icnDocument->gridSnap( pos.y() ); @@ -846,13 +846,13 @@ bool CMManualConnector::mouseMoved( const EventInfo &eventInfo ) if ( movedFlag ) { - QCanvasItem *startItem = 0l; + TQCanvasItem *startItem = 0l; if (p_startNode) startItem = p_startNode; else if (p_startConnector) startItem = p_startConnector; - QCanvasItem * endItem = p_icnDocument->itemAtTop( QPoint( newX, newY ) ); + TQCanvasItem * endItem = p_icnDocument->itemAtTop( TQPoint( newX, newY ) ); // If the endItem is a node, we have to finish exactly on the end. if ( Node * node = dynamic_cast<Node*>(endItem) ) @@ -863,8 +863,8 @@ bool CMManualConnector::mouseMoved( const EventInfo &eventInfo ) bool validLine = p_icnDocument->canConnect( startItem, endItem ); - m_manualConnectorDraw->setColor( validLine ? validConnectionColor() : Qt::black ); - m_manualConnectorDraw->mouseMoved( QPoint( newX, newY ) ); + m_manualConnectorDraw->setColor( validLine ? validConnectionColor() : TQt::black ); + m_manualConnectorDraw->mouseMoved( TQPoint( newX, newY ) ); } return false; @@ -877,7 +877,7 @@ bool CMManualConnector::mouseReleased( const EventInfo &eventInfo ) return true; } - QPoint pos = p_icnDocument->gridSnap(eventInfo.pos); + TQPoint pos = p_icnDocument->gridSnap(eventInfo.pos); grabEndStuff( m_manualConnectorDraw->mouseClicked(pos), pos, true ); @@ -885,7 +885,7 @@ bool CMManualConnector::mouseReleased( const EventInfo &eventInfo ) return false; // Create the points that define the manual route - QPointList list = m_manualConnectorDraw->pointList(); + TQPointList list = m_manualConnectorDraw->pointList(); delete m_manualConnectorDraw; m_manualConnectorDraw = 0l; @@ -961,7 +961,7 @@ bool CMItemMove::mousePressedInitial( const EventInfo &eventInfo ) return true; - if ( !p_selectList->contains(item) ) + if ( !p_selectList->tqcontains(item) ) { if (!eventInfo.ctrlPressed) p_itemDocument->unselectAll(); @@ -1014,7 +1014,7 @@ bool CMItemMove::mousePressedInitial( const EventInfo &eventInfo ) bool CMItemMove::mouseMoved( const EventInfo &eventInfo ) { - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; int x = pos.x(); int y = pos.y(); @@ -1028,7 +1028,7 @@ bool CMItemMove::mouseMoved( const EventInfo &eventInfo ) if ( !*it || !(*it)->isMovable() ) continue; - const QRect oldRect = (*it)->boundingRect(); + const TQRect oldRect = (*it)->boundingRect(); (*it)->setChanged(); if ( CNItem *cnItem = dynamic_cast<CNItem*>((Item*)*it) ) @@ -1042,8 +1042,8 @@ bool CMItemMove::mouseMoved( const EventInfo &eventInfo ) else (*it)->moveBy( eventInfo.pos.x()-m_prevPos.x(), eventInfo.pos.y()-m_prevPos.y() ); - QRect newRect = (*it)->boundingRect(); - QRect merged = oldRect | newRect; + TQRect newRect = (*it)->boundingRect(); + TQRect merged = oldRect | newRect; } if ( (dx != 0) || (dy != 0) ) @@ -1081,7 +1081,7 @@ bool CMItemMove::mouseMoved( const EventInfo &eventInfo ) bool CMItemMove::mouseReleased( const EventInfo &eventInfo ) { - QStringList itemIDs; + TQStringList itemIDs; const ItemList itemList = p_cnItemSelectList->items(); const ItemList::const_iterator ilEnd = itemList.end(); @@ -1091,7 +1091,7 @@ bool CMItemMove::mouseReleased( const EventInfo &eventInfo ) itemIDs.append( (*it)->id() ); } - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; // And make sure all connectors are properly shown const ConnectorList &connectorList = p_icnDocument->connectorList(); @@ -1255,7 +1255,7 @@ bool CMMechItemMove::mousePressedInitial( const EventInfo &eventInfo ) mechItem->setParentItem(0l); } } - else if ( !p_selectList->contains(mechItem) ) + else if ( !p_selectList->tqcontains(mechItem) ) { if (!eventInfo.ctrlPressed) p_mechanicsDocument->unselectAll(); @@ -1285,7 +1285,7 @@ bool CMMechItemMove::mousePressedInitial( const EventInfo &eventInfo ) bool CMMechItemMove::mouseMoved( const EventInfo &eventInfo ) { - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; int x = pos.x(); int y = pos.y(); @@ -1298,7 +1298,7 @@ bool CMMechItemMove::mouseMoved( const EventInfo &eventInfo ) (*it)->moveBy( x - m_prevPos.x(), y - m_prevPos.y() ); } - m_prevPos = QPoint( x, y ); + m_prevPos = TQPoint( x, y ); p_canvas->update(); p_itemDocument->requestEvent( ItemDocument::ItemDocumentEvent::ResizeCanvasToItems ); @@ -1308,7 +1308,7 @@ bool CMMechItemMove::mouseMoved( const EventInfo &eventInfo ) bool CMMechItemMove::mouseReleased( const EventInfo &eventInfo ) { - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; int dx = pos.x() - m_eventInfo.pos.x(); int dy = pos.y() - m_eventInfo.pos.y(); @@ -1337,7 +1337,7 @@ bool CMMechItemMove::mouseReleased( const EventInfo &eventInfo ) mechItem->setSelectionMode(MechanicsItem::sm_resize); } - QStringList itemIDs; + TQStringList itemIDs; ItemList itemList = p_mechItemSelectList->items(); const ItemList::iterator ilEnd = itemList.end(); @@ -1357,19 +1357,19 @@ bool CMMechItemMove::mouseReleased( const EventInfo &eventInfo ) //BEGIN class SelectRectangle -SelectRectangle::SelectRectangle( int x, int y, int w, int h, QCanvas *qcanvas ) +SelectRectangle::SelectRectangle( int x, int y, int w, int h, TQCanvas *qcanvas ) : m_x(x), m_y(y) { - m_topLine = new QCanvasLine(qcanvas); - m_rightLine = new QCanvasLine(qcanvas); - m_bottomLine = new QCanvasLine(qcanvas); - m_leftLine = new QCanvasLine(qcanvas); + m_topLine = new TQCanvasLine(qcanvas); + m_rightLine = new TQCanvasLine(qcanvas); + m_bottomLine = new TQCanvasLine(qcanvas); + m_leftLine = new TQCanvasLine(qcanvas); setSize( w, h ); - QCanvasLine* lines[] = { m_topLine, m_rightLine, m_bottomLine, m_leftLine }; + TQCanvasLine* lines[] = { m_topLine, m_rightLine, m_bottomLine, m_leftLine }; for ( int i=0; i<4; ++ i) { - lines[i]->setPen( QPen( QColor(190,190,190), 1, Qt::DotLine ) ); + lines[i]->setPen( TQPen( TQColor(190,190,190), 1, TQt::DotLine ) ); lines[i]->setZ( ICNDocument::Z::Select ); lines[i]->show(); } @@ -1396,11 +1396,11 @@ void SelectRectangle::setSize( int w, int h ) } -QCanvasItemList SelectRectangle::collisions() +TQCanvasItemList SelectRectangle::collisions() { - QCanvas *canvas = m_topLine->canvas(); + TQCanvas *canvas = m_topLine->canvas(); - return canvas->collisions( QRect( m_x, m_y, m_w, m_h ) ); + return canvas->collisions( TQRect( m_x, m_y, m_w, m_h ) ); } //END class SelectRectangle @@ -1449,7 +1449,7 @@ bool CMSelect::mousePressedInitial( const EventInfo &eventInfo ) bool CMSelect::mouseMoved( const EventInfo &eventInfo ) { - QPoint pos = eventInfo.pos; + TQPoint pos = eventInfo.pos; m_selectRectangle->setSize( pos.x()-m_eventInfo.pos.x(), pos.y()-m_eventInfo.pos.y() ); @@ -1514,7 +1514,7 @@ bool CMItemDrag::mousePressedInitial( const EventInfo &eventInfo ) bool CMItemDrag::mouseMoved( const EventInfo &eventInfo ) { - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; if ( b_dragged || pos.x() > (m_eventInfo.pos.x()+4 ) || @@ -1543,14 +1543,14 @@ bool CMItemDrag::mouseReleased( const EventInfo &/*eventInfo*/ ) //BEGIN class CanvasEllipseDraw -CanvasEllipseDraw::CanvasEllipseDraw( int x, int y, QCanvas * canvas ) - : QCanvasEllipse( 0, 0, canvas ) +CanvasEllipseDraw::CanvasEllipseDraw( int x, int y, TQCanvas * canvas ) + : TQCanvasEllipse( 0, 0, canvas ) { move( x, y ); } -void CanvasEllipseDraw::drawShape( QPainter & p ) +void CanvasEllipseDraw::drawShape( TQPainter & p ) { p.drawEllipse( int(x()-width()/2), int(y()-height()/2), width(), height() ); } @@ -1596,8 +1596,8 @@ bool CMDraw::mousePressedInitial( const EventInfo &eventInfo ) case DrawPart::da_text: case DrawPart::da_rectangle: { - m_pDrawRectangle = new QCanvasRectangle( eventInfo.pos.x(), eventInfo.pos.y(), 0, 0, p_canvas ); - m_pDrawRectangle->setPen( QPen( QColor(0,0,0), 1 ) ); + m_pDrawRectangle = new TQCanvasRectangle( eventInfo.pos.x(), eventInfo.pos.y(), 0, 0, p_canvas ); + m_pDrawRectangle->setPen( TQPen( TQColor(0,0,0), 1 ) ); m_pDrawRectangle->setZ( ICNDocument::Z::Select ); m_pDrawRectangle->show(); break; @@ -1605,7 +1605,7 @@ bool CMDraw::mousePressedInitial( const EventInfo &eventInfo ) case DrawPart::da_ellipse: { m_pDrawEllipse = new CanvasEllipseDraw( eventInfo.pos.x(), eventInfo.pos.y(), p_canvas ); - m_pDrawEllipse->setPen( QPen( QColor(0,0,0), 1 ) ); + m_pDrawEllipse->setPen( TQPen( TQColor(0,0,0), 1 ) ); m_pDrawEllipse->setZ( ICNDocument::Z::Select ); m_pDrawEllipse->show(); break; @@ -1613,9 +1613,9 @@ bool CMDraw::mousePressedInitial( const EventInfo &eventInfo ) case DrawPart::da_line: case DrawPart::da_arrow: { - m_pDrawLine = new QCanvasLine(p_canvas); + m_pDrawLine = new TQCanvasLine(p_canvas); m_pDrawLine->setPoints( eventInfo.pos.x(), eventInfo.pos.y(), eventInfo.pos.x(), eventInfo.pos.y() ); - m_pDrawLine->setPen( QPen( QColor(0,0,0), 1 ) ); + m_pDrawLine->setPen( TQPen( TQColor(0,0,0), 1 ) ); m_pDrawLine->setZ( ICNDocument::Z::Select ); m_pDrawLine->show(); break; @@ -1630,20 +1630,20 @@ bool CMDraw::mousePressedInitial( const EventInfo &eventInfo ) bool CMDraw::mouseMoved( const EventInfo &eventInfo ) { - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; if (m_pDrawRectangle) m_pDrawRectangle->setSize( pos.x()-m_eventInfo.pos.x(), pos.y()-m_eventInfo.pos.y() ); else if (m_pDrawEllipse) { -// QRect r( m_eventInfo.pos.x(), m_eventInfo.pos.y(), pos.x()-m_eventInfo.pos.x(), pos.y()-m_eventInfo.pos.y() ); +// TQRect r( m_eventInfo.pos.x(), m_eventInfo.pos.y(), pos.x()-m_eventInfo.pos.x(), pos.y()-m_eventInfo.pos.y() ); // r = r.normalize(); // // m_pDrawEllipse->setSize( r.width(), r.height() ); // m_pDrawEllipse->move( r.left()+(r.width()/2), r.top()+(r.height()/2) ); - m_pDrawEllipse->setSize( 2*QABS(pos.x()-m_eventInfo.pos.x()), 2*QABS(pos.y()-m_eventInfo.pos.y()) ); + m_pDrawEllipse->setSize( 2*TQABS(pos.x()-m_eventInfo.pos.x()), 2*TQABS(pos.y()-m_eventInfo.pos.y()) ); } else if (m_pDrawLine) @@ -1658,9 +1658,9 @@ bool CMDraw::mouseMoved( const EventInfo &eventInfo ) bool CMDraw::mouseReleased( const EventInfo &eventInfo ) { - const QPoint pos = eventInfo.pos; + const TQPoint pos = eventInfo.pos; - QRect sizeRect; + TQRect sizeRect; if ( m_pDrawRectangle || m_pDrawEllipse ) { @@ -1687,7 +1687,7 @@ bool CMDraw::mouseReleased( const EventInfo &eventInfo ) int h = m_pDrawEllipse->height()+1; int x = int(m_pDrawEllipse->x()-w/2); int y = int(m_pDrawEllipse->y()-h/2); - sizeRect = QRect( x, y, w, h ).normalize(); + sizeRect = TQRect( x, y, w, h ).normalize(); } delete m_pDrawRectangle; @@ -1702,7 +1702,7 @@ bool CMDraw::mouseReleased( const EventInfo &eventInfo ) int ex = m_pDrawLine->endPoint().x(); int ey = m_pDrawLine->endPoint().y(); - sizeRect = QRect( ex, ey, sx-ex, sy-ey ); + sizeRect = TQRect( ex, ey, sx-ex, sy-ey ); delete m_pDrawLine; m_pDrawLine = 0l; @@ -1710,7 +1710,7 @@ bool CMDraw::mouseReleased( const EventInfo &eventInfo ) else return true; - QString id; + TQString id; switch ( (DrawPart::DrawAction) p_cmManager->drawAction() ) { case DrawPart::da_rectangle: @@ -1758,9 +1758,9 @@ bool CMDraw::mouseReleased( const EventInfo &eventInfo ) //BEGIN class ManualConnectorDraw -ManualConnectorDraw::ManualConnectorDraw( ICNDocument *_icnDocument, const QPoint &initialPos ) +ManualConnectorDraw::ManualConnectorDraw( ICNDocument *_icnDocument, const TQPoint &initialPos ) { - m_color = Qt::black; + m_color = TQt::black; icnDocument = _icnDocument; m_currentPos = m_previousPos = m_initialPos = initialPos; @@ -1769,8 +1769,8 @@ ManualConnectorDraw::ManualConnectorDraw( ICNDocument *_icnDocument, const QPoin b_currentVertical = false; b_orientationDefined = false; - m_connectorLines.append( m_previousCon = new QCanvasLine( icnDocument->canvas() ) ); - m_connectorLines.append( m_currentCon = new QCanvasLine( icnDocument->canvas() ) ); + m_connectorLines.append( m_previousCon = new TQCanvasLine( icnDocument->canvas() ) ); + m_connectorLines.append( m_currentCon = new TQCanvasLine( icnDocument->canvas() ) ); m_currentCon->setPoints( initialPos.x(), initialPos.y(), initialPos.x(), initialPos.y() ); m_previousCon->setPoints( initialPos.x(), initialPos.y(), initialPos.x(), initialPos.y() ); @@ -1787,31 +1787,31 @@ ManualConnectorDraw::ManualConnectorDraw( ICNDocument *_icnDocument, const QPoin ManualConnectorDraw::~ManualConnectorDraw() { - const QValueList<QCanvasLine*>::iterator end = m_connectorLines.end(); - for ( QValueList<QCanvasLine*>::iterator it = m_connectorLines.begin(); it != end; ++it ) + const TQValueList<TQCanvasLine*>::iterator end = m_connectorLines.end(); + for ( TQValueList<TQCanvasLine*>::iterator it = m_connectorLines.begin(); it != end; ++it ) delete *it; m_connectorLines.clear(); } -void ManualConnectorDraw::setColor( const QColor & color ) +void ManualConnectorDraw::setColor( const TQColor & color ) { m_color = color; - const QValueList<QCanvasLine*>::iterator end = m_connectorLines.end(); - for ( QValueList<QCanvasLine*>::iterator it = m_connectorLines.begin(); it != end; ++it ) + const TQValueList<TQCanvasLine*>::iterator end = m_connectorLines.end(); + for ( TQValueList<TQCanvasLine*>::iterator it = m_connectorLines.begin(); it != end; ++it ) (*it)->setPen( m_color ); } -void ManualConnectorDraw::mouseMoved( const QPoint &pos ) +void ManualConnectorDraw::mouseMoved( const TQPoint &pos ) { if ( m_currentPos == pos ) return; if (!b_orientationDefined) { - QPoint previousStart = m_previousCon->startPoint(); + TQPoint previousStart = m_previousCon->startPoint(); double distance = std::sqrt( std::pow( (double)(m_currentPos.x()-previousStart.x()), 2. ) + std::pow( (double)(m_currentPos.y()-previousStart.y()), 2. ) ); @@ -1829,7 +1829,7 @@ void ManualConnectorDraw::mouseMoved( const QPoint &pos ) } -QCanvasItem* ManualConnectorDraw::mouseClicked( const QPoint &pos ) +TQCanvasItem* ManualConnectorDraw::mouseClicked( const TQPoint &pos ) { if (b_orientationDefined) b_currentVertical = !b_currentVertical; @@ -1841,14 +1841,14 @@ QCanvasItem* ManualConnectorDraw::mouseClicked( const QPoint &pos ) m_currentPos = pos; - QCanvasItem * qcanvasItem = icnDocument->itemAtTop(pos); + TQCanvasItem * qcanvasItem = icnDocument->itemAtTop(pos); if ( qcanvasItem && pos != m_initialPos && qcanvasItem != p_initialItem ) return qcanvasItem; m_previousCon = m_currentCon; - m_connectorLines.append( m_currentCon = new QCanvasLine( icnDocument->canvas() ) ); + m_connectorLines.append( m_currentCon = new TQCanvasLine( icnDocument->canvas() ) ); m_currentCon->setPoints( pos.x(), pos.y(), pos.x(), pos.y() ); m_currentCon->setPen( m_color ); updateConnectorEnds(); @@ -1860,8 +1860,8 @@ QCanvasItem* ManualConnectorDraw::mouseClicked( const QPoint &pos ) void ManualConnectorDraw::updateConnectorEnds() { - QPoint pivot = m_currentPos; - QPoint previousStart = m_previousCon->startPoint(); + TQPoint pivot = m_currentPos; + TQPoint previousStart = m_previousCon->startPoint(); if (b_currentVertical) { @@ -1878,13 +1878,13 @@ void ManualConnectorDraw::updateConnectorEnds() } -QPointList ManualConnectorDraw::pointList() +TQPointList ManualConnectorDraw::pointList() { - QPointList list; + TQPointList list; list.append(m_initialPos); - const QValueList<QCanvasLine*>::iterator end = m_connectorLines.end(); - for ( QValueList<QCanvasLine*>::iterator it = m_connectorLines.begin(); it != end; ++it ) + const TQValueList<TQCanvasLine*>::iterator end = m_connectorLines.end(); + for ( TQValueList<TQCanvasLine*>::iterator it = m_connectorLines.begin(); it != end; ++it ) { list.append( (*it)->endPoint() ); } |