diff options
Diffstat (limited to 'kivio/plugins')
31 files changed, 530 insertions, 515 deletions
diff --git a/kivio/plugins/kivioconnectortool/plugin.cpp b/kivio/plugins/kivioconnectortool/plugin.cpp index 2b4c6e41..848579c9 100644 --- a/kivio/plugins/kivioconnectortool/plugin.cpp +++ b/kivio/plugins/kivioconnectortool/plugin.cpp @@ -31,8 +31,8 @@ K_EXPORT_COMPONENT_FACTORY( libkivioconnectortool, ConnectorToolFactory ) KInstance* ConnectorToolFactory::s_global = 0; -ConnectorToolFactory::ConnectorToolFactory( QObject* parent, const char* name ) -: KLibFactory( parent, name ) +ConnectorToolFactory::ConnectorToolFactory( TQObject* tqparent, const char* name ) +: KLibFactory( tqparent, name ) { s_global = new KInstance("kivio"); } @@ -42,12 +42,12 @@ ConnectorToolFactory::~ConnectorToolFactory() delete s_global; } -QObject* ConnectorToolFactory::createObject( QObject* parent, const char*, const char*, const QStringList& ) +TQObject* ConnectorToolFactory::createObject( TQObject* tqparent, const char*, const char*, const TQStringList& ) { - if ( !parent->inherits("KivioView") ) + if ( !tqparent->inherits("KivioView") ) return 0; - QObject *obj = new ConnectorTool( (KivioView*)parent ); + TQObject *obj = new ConnectorTool( (KivioView*)tqparent ); return obj; } diff --git a/kivio/plugins/kivioconnectortool/plugin.h b/kivio/plugins/kivioconnectortool/plugin.h index 0fbb5a9a..e8d9803b 100644 --- a/kivio/plugins/kivioconnectortool/plugin.h +++ b/kivio/plugins/kivioconnectortool/plugin.h @@ -19,8 +19,8 @@ #ifndef CONNECTOR_PLUGIN_H #define CONNECTOR_PLUGIN_H -#include <qstringlist.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <klibloader.h> @@ -28,12 +28,13 @@ class KInstance; class ConnectorToolFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - ConnectorToolFactory( QObject* parent = 0, const char* name = 0 ); + ConnectorToolFactory( TQObject* tqparent = 0, const char* name = 0 ); ~ConnectorToolFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* tqparent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList() ); static KInstance* global(); diff --git a/kivio/plugins/kivioconnectortool/straight_connector/straight_connector.cpp b/kivio/plugins/kivioconnectortool/straight_connector/straight_connector.cpp index 233c7ab8..199e78d6 100644 --- a/kivio/plugins/kivioconnectortool/straight_connector/straight_connector.cpp +++ b/kivio/plugins/kivioconnectortool/straight_connector/straight_connector.cpp @@ -33,23 +33,23 @@ #include "kivio_text_style.h" #include "tkmath.h" -#include <qcolor.h> -#include <qpixmap.h> +#include <tqcolor.h> +#include <tqpixmap.h> #include <kdebug.h> #include <KoZoomHandler.h> #include "straight_connector.xpm" -static QPixmap *pIcon = NULL; +static TQPixmap *pIcon = NULL; static KivioStencilSpawnerInfo sinfo = KivioStencilSpawnerInfo("Dave Marotti", "Straight Connector", "Dave Marotti - Straight Connector", "Basic Straight Connector", "0.1", "http://localhost/", "", "off"); #include <kgenericfactory.h> K_EXPORT_COMPONENT_FACTORY( straight_connector, KGenericFactory<KivioConnectorFactory>( "KivioConnectorFactory" ) ) -KivioConnectorFactory::KivioConnectorFactory(QObject *parent, const char* name, const QStringList& args) : - KivioStencilFactory(parent, name, args) +KivioConnectorFactory::KivioConnectorFactory(TQObject *tqparent, const char* name, const TQStringList& args) : + KivioStencilFactory(tqparent, name, args) { kdDebug(43000) << "new straight line connector factory: " << endl; } @@ -59,18 +59,18 @@ KivioStencil *KivioConnectorFactory::NewStencil() return new KivioStraightConnector(); } -KivioStencil *KivioConnectorFactory::NewStencil(const QString&) +KivioStencil *KivioConnectorFactory::NewStencil(const TQString&) { return new KivioStraightConnector(); } //FIXME: Is this a memory leak? -QPixmap *KivioConnectorFactory::GetIcon() +TQPixmap *KivioConnectorFactory::GetIcon() { if( pIcon ) return pIcon; - pIcon = new QPixmap( (const char **)straight_connector_xpm ); + pIcon = new TQPixmap( (const char **)straight_connector_xpm ); return pIcon; } @@ -299,17 +299,17 @@ void KivioStraightConnector::paintOutline( KivioIntraStencilData *pData ) drawText(pData); } -bool KivioStraightConnector::saveCustom( QDomElement &e, QDomDocument &doc ) +bool KivioStraightConnector::saveCustom( TQDomElement &e, TQDomDocument &doc ) { e.appendChild( saveArrowHeads(doc) ); return true; } -bool KivioStraightConnector::loadCustom( const QDomElement &e ) +bool KivioStraightConnector::loadCustom( const TQDomElement &e ) { - QDomNode node; - QString name; + TQDomNode node; + TQString name; node = e.firstChild(); while( !node.isNull() ) @@ -328,9 +328,9 @@ bool KivioStraightConnector::loadCustom( const QDomElement &e ) return true; } -QDomElement KivioStraightConnector::saveArrowHeads( QDomDocument &doc ) +TQDomElement KivioStraightConnector::saveArrowHeads( TQDomDocument &doc ) { - QDomElement e = doc.createElement("KivioArrowHeads"); + TQDomElement e = doc.createElement("KivioArrowHeads"); e.appendChild( m_startAH->saveXML(doc) ); e.appendChild( m_endAH->saveXML(doc) ); @@ -338,11 +338,11 @@ QDomElement KivioStraightConnector::saveArrowHeads( QDomDocument &doc ) return e; } -bool KivioStraightConnector::loadArrowHeads( const QDomElement &e ) +bool KivioStraightConnector::loadArrowHeads( const TQDomElement &e ) { - QDomNode node; - QString nodeName; - QDomElement arrowE; + TQDomNode node; + TQString nodeName; + TQDomElement arrowE; bool first=true; node = e.firstChild(); diff --git a/kivio/plugins/kivioconnectortool/straight_connector/straight_connector.h b/kivio/plugins/kivioconnectortool/straight_connector/straight_connector.h index 9cc602a5..e0ea7476 100644 --- a/kivio/plugins/kivioconnectortool/straight_connector/straight_connector.h +++ b/kivio/plugins/kivioconnectortool/straight_connector/straight_connector.h @@ -30,8 +30,8 @@ class KivioPage; -#include <qcolor.h> -#include <qdom.h> +#include <tqcolor.h> +#include <tqdom.h> #include "kivio_1d_stencil.h" @@ -42,8 +42,8 @@ class KivioStraightConnector : public Kivio1DStencil KivioArrowHead *m_startAH; KivioArrowHead *m_endAH; - bool loadArrowHeads( const QDomElement & ); - QDomElement saveArrowHeads( QDomDocument & ); + bool loadArrowHeads( const TQDomElement & ); + TQDomElement saveArrowHeads( TQDomDocument & ); public: KivioStraightConnector(); @@ -59,8 +59,8 @@ class KivioStraightConnector : public Kivio1DStencil virtual void paint( KivioIntraStencilData * ); virtual void paintOutline( KivioIntraStencilData * ); - virtual bool loadCustom( const QDomElement & ); - virtual bool saveCustom( QDomElement &, QDomDocument & ); + virtual bool loadCustom( const TQDomElement & ); + virtual bool saveCustom( TQDomElement &, TQDomDocument & ); virtual void setStartAHType( int i ) { m_startAH->setType(i); } @@ -83,11 +83,12 @@ class KivioStraightConnector : public Kivio1DStencil class KIVIOPLUGINS_EXPORT KivioConnectorFactory : public KivioStencilFactory { Q_OBJECT + TQ_OBJECT public: - KivioConnectorFactory(QObject *parent=0, const char* name=0, const QStringList& args = QStringList()); - KivioStencil *NewStencil(const QString& name); + KivioConnectorFactory(TQObject *tqparent=0, const char* name=0, const TQStringList& args = TQStringList()); + KivioStencil *NewStencil(const TQString& name); KivioStencil *NewStencil(); - QPixmap *GetIcon(); + TQPixmap *GetIcon(); KivioStencilSpawnerInfo *GetSpawnerInfo(); }; diff --git a/kivio/plugins/kivioconnectortool/tool_connector.cpp b/kivio/plugins/kivioconnectortool/tool_connector.cpp index 87ec4729..43596240 100644 --- a/kivio/plugins/kivioconnectortool/tool_connector.cpp +++ b/kivio/plugins/kivioconnectortool/tool_connector.cpp @@ -19,7 +19,7 @@ */ #include "tool_connector.h" -#include <qcursor.h> +#include <tqcursor.h> #include <kdebug.h> #include <kiconloader.h> #include <kstandarddirs.h> @@ -47,20 +47,20 @@ #include "polylineconnectorspawner.h" #include "mousetoolaction.h" -ConnectorTool::ConnectorTool( KivioView* parent ) : Kivio::MouseTool(parent, "Connector Mouse Tool") +ConnectorTool::ConnectorTool( KivioView* tqparent ) : Kivio::MouseTool(tqparent, "Connector Mouse Tool") { m_connectorAction = new Kivio::MouseToolAction(i18n("Straight Connector"), "kivio_connector", 0, actionCollection(), "connector"); - connect(m_connectorAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); - connect(m_connectorAction, SIGNAL(activated()), this, SLOT(activateStraight())); - connect(m_connectorAction, SIGNAL(doubleClicked()), this, SLOT(makePermanent())); + connect(m_connectorAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); + connect(m_connectorAction, TQT_SIGNAL(activated()), this, TQT_SLOT(activateStraight())); + connect(m_connectorAction, TQT_SIGNAL(doubleClicked()), this, TQT_SLOT(makePermanent())); m_connectorAction->setExclusiveGroup("ConnectorTool"); m_polyLineAction = new Kivio::MouseToolAction(i18n("Polyline Connector"), "kivio_connector", 0, actionCollection(), "polyLineConnector"); - connect(m_polyLineAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); - connect(m_polyLineAction, SIGNAL(activated()), this, SLOT(activatePolyline())); - connect(m_connectorAction, SIGNAL(doubleClicked()), this, SLOT(makePermanent())); + connect(m_polyLineAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); + connect(m_polyLineAction, TQT_SIGNAL(activated()), this, TQT_SLOT(activatePolyline())); + connect(m_connectorAction, TQT_SIGNAL(doubleClicked()), this, TQT_SLOT(makePermanent())); m_polyLineAction->setExclusiveGroup("ConnectorTool"); m_permanent = false; @@ -69,8 +69,8 @@ ConnectorTool::ConnectorTool( KivioView* parent ) : Kivio::MouseTool(parent, "Co m_mode = stmNone; m_pDragData = 0; - m_pConnectorCursor1 = new QCursor(BarIcon("kivio_connector_cursor1",KivioFactory::global()),2,2); - m_pConnectorCursor2 = new QCursor(BarIcon("kivio_connector_cursor2",KivioFactory::global()),2,2); + m_pConnectorCursor1 = new TQCursor(BarIcon("kivio_connector_cursor1",KivioFactory::global()),2,2); + m_pConnectorCursor2 = new TQCursor(BarIcon("kivio_connector_cursor2",KivioFactory::global()),2,2); } ConnectorTool::~ConnectorTool() @@ -88,22 +88,22 @@ ConnectorTool::~ConnectorTool() * @param e The event to be identified and processed * */ -bool ConnectorTool::processEvent(QEvent* e) +bool ConnectorTool::processEvent(TQEvent* e) { switch (e->type()) { - case QEvent::MouseButtonPress: - mousePress( static_cast<QMouseEvent*>(e) ); + case TQEvent::MouseButtonPress: + mousePress( TQT_TQMOUSEEVENT(e) ); return true; break; - case QEvent::MouseButtonRelease: - mouseRelease( static_cast<QMouseEvent*>(e) ); + case TQEvent::MouseButtonRelease: + mouseRelease( TQT_TQMOUSEEVENT(e) ); return true; break; - case QEvent::MouseMove: - mouseMove( static_cast<QMouseEvent*>(e) ); + case TQEvent::MouseMove: + mouseMove( TQT_TQMOUSEEVENT(e) ); return true; break; @@ -122,7 +122,7 @@ void ConnectorTool::setActivated(bool a) m_pStencil = 0; m_pDragData = 0; view()->canvasWidget()->setShowConnectorTargets(true); - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); emit activated(this); } else { if(m_pStencil && (m_mode == stmDrawRubber) && (m_type == PolyLineConnector)) { @@ -138,7 +138,7 @@ void ConnectorTool::setActivated(bool a) polyconnector = 0; } - view()->canvasWidget()->guideLines().repaintAfterSnapping(); + view()->canvasWidget()->guideLines().tqrepaintAfterSnapping(); } m_pStencil = 0; @@ -150,11 +150,11 @@ void ConnectorTool::setActivated(bool a) m_permanent = false; view()->setStatusBarInfo(""); view()->canvasWidget()->setShowConnectorTargets(false); - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); } } -void ConnectorTool::connector(QRect) +void ConnectorTool::connector(TQRect) { if (!m_pStencil) return; @@ -169,9 +169,9 @@ void ConnectorTool::connector(QRect) doc->updateView(page); } -void ConnectorTool::mousePress( QMouseEvent *e ) +void ConnectorTool::mousePress( TQMouseEvent *e ) { - if(e->button() == LeftButton) { + if(e->button() == Qt::LeftButton) { bool ok = true; if(!m_pStencil || (m_type == StraightConnector)) { ok = startRubberBanding(e); @@ -200,7 +200,7 @@ void ConnectorTool::mousePress( QMouseEvent *e ) } else { m_mode = stmNone; } - } else if(e->button() == RightButton) { + } else if(e->button() == Qt::RightButton) { if(m_type == PolyLineConnector) { if(m_mode == stmDrawRubber) { endRubberBanding(e); @@ -216,12 +216,12 @@ void ConnectorTool::mousePress( QMouseEvent *e ) /** * Tests if we should start rubber banding (always returns true). */ -bool ConnectorTool::startRubberBanding( QMouseEvent *e ) +bool ConnectorTool::startRubberBanding( TQMouseEvent *e ) { KivioCanvas* canvas = view()->canvasWidget(); KivioDoc* doc = view()->doc(); KivioPage* pPage = canvas->activePage(); - QString spawnerId; + TQString spawnerId; if(m_type == StraightConnector) { spawnerId = "Dave Marotti - Straight Connector"; @@ -278,12 +278,12 @@ bool ConnectorTool::startRubberBanding( QMouseEvent *e ) m_pStencil->customDrag(m_pDragData); - canvas->repaint(); + canvas->tqrepaint(); canvas->setCursor(*m_pConnectorCursor2); return true; } -void ConnectorTool::mouseMove( QMouseEvent * e ) +void ConnectorTool::mouseMove( TQMouseEvent * e ) { switch( m_mode ) { @@ -296,7 +296,7 @@ void ConnectorTool::mouseMove( QMouseEvent * e ) } } -void ConnectorTool::continueRubberBanding( QMouseEvent *e ) +void ConnectorTool::continueRubberBanding( TQMouseEvent *e ) { KivioCanvas* canvas = view()->canvasWidget(); KivioPage* pPage = view()->activePage(); @@ -322,10 +322,10 @@ void ConnectorTool::continueRubberBanding( QMouseEvent *e ) m_pStencil->customDrag(m_pDragData); m_pStencil->updateGeometry(); - canvas->repaint(); + canvas->tqrepaint(); } -void ConnectorTool::mouseRelease( QMouseEvent *e ) +void ConnectorTool::mouseRelease( TQMouseEvent *e ) { if(m_type == StraightConnector) { switch( m_mode ) @@ -340,12 +340,12 @@ void ConnectorTool::mouseRelease( QMouseEvent *e ) } } -void ConnectorTool::endRubberBanding(QMouseEvent *) +void ConnectorTool::endRubberBanding(TQMouseEvent *) { connector(view()->canvasWidget()->rect()); m_pStencil = 0; m_mode = stmNone; - view()->canvasWidget()->guideLines().repaintAfterSnapping(); + view()->canvasWidget()->guideLines().tqrepaintAfterSnapping(); if(!m_permanent) { view()->pluginManager()->activateDefaultTool(); diff --git a/kivio/plugins/kivioconnectortool/tool_connector.h b/kivio/plugins/kivioconnectortool/tool_connector.h index d0bb8b01..7dd1462b 100644 --- a/kivio/plugins/kivioconnectortool/tool_connector.h +++ b/kivio/plugins/kivioconnectortool/tool_connector.h @@ -23,8 +23,8 @@ #include "kivio_mousetool.h" #include <KoPoint.h> -class QMouseEvent; -class QCursor; +class TQMouseEvent; +class TQCursor; namespace Kivio { class MouseToolAction; @@ -38,13 +38,14 @@ class KivioCustomDragData; class ConnectorTool : public Kivio::MouseTool { Q_OBJECT + TQ_OBJECT public: - ConnectorTool( KivioView* parent ); + ConnectorTool( KivioView* tqparent ); ~ConnectorTool(); - virtual bool processEvent(QEvent* e); + virtual bool processEvent(TQEvent* e); - void connector(QRect); + void connector(TQRect); public slots: void setActivated(bool a); @@ -59,15 +60,15 @@ class ConnectorTool : public Kivio::MouseTool void operationDone(); protected: - void mousePress(QMouseEvent *); - void mouseMove(QMouseEvent *); - void mouseRelease(QMouseEvent *); + void mousePress(TQMouseEvent *); + void mouseMove(TQMouseEvent *); + void mouseRelease(TQMouseEvent *); - bool startRubberBanding(QMouseEvent*); - void continueRubberBanding(QMouseEvent *); - void endRubberBanding(QMouseEvent *); + bool startRubberBanding(TQMouseEvent*); + void continueRubberBanding(TQMouseEvent *); + void endRubberBanding(TQMouseEvent *); - QPoint m_startPoint, m_releasePoint; + TQPoint m_startPoint, m_releasePoint; // Connector Tool Mode enum @@ -84,8 +85,8 @@ class ConnectorTool : public Kivio::MouseTool private: int m_mode; // Flag to indicate that we are drawing a rubber band int m_type; // Type of connector - QCursor* m_pConnectorCursor1; - QCursor* m_pConnectorCursor2; + TQCursor* m_pConnectorCursor1; + TQCursor* m_pConnectorCursor2; Kivio1DStencil* m_pStencil; KoPoint startPoint; KivioCustomDragData* m_pDragData; diff --git a/kivio/plugins/kivioselecttool/plugin.cpp b/kivio/plugins/kivioselecttool/plugin.cpp index 49e68cac..c6d22e64 100644 --- a/kivio/plugins/kivioselecttool/plugin.cpp +++ b/kivio/plugins/kivioselecttool/plugin.cpp @@ -31,8 +31,8 @@ K_EXPORT_COMPONENT_FACTORY( libkivioselecttool, SelectToolFactory ) KInstance* SelectToolFactory::s_global = 0; -SelectToolFactory::SelectToolFactory( QObject* parent, const char* name ) -: KLibFactory( parent, name ) +SelectToolFactory::SelectToolFactory( TQObject* tqparent, const char* name ) +: KLibFactory( tqparent, name ) { s_global = new KInstance("kivio"); } @@ -42,12 +42,12 @@ SelectToolFactory::~SelectToolFactory() delete s_global; } -QObject* SelectToolFactory::createObject( QObject* parent, const char*, const char*, const QStringList& ) +TQObject* SelectToolFactory::createObject( TQObject* tqparent, const char*, const char*, const TQStringList& ) { - if ( !parent->inherits("KivioView") ) + if ( !tqparent->inherits("KivioView") ) return 0; - QObject *obj = new SelectTool( (KivioView*)parent ); + TQObject *obj = new SelectTool( (KivioView*)tqparent ); return obj; } diff --git a/kivio/plugins/kivioselecttool/plugin.h b/kivio/plugins/kivioselecttool/plugin.h index 4fbb6f20..dffe4161 100644 --- a/kivio/plugins/kivioselecttool/plugin.h +++ b/kivio/plugins/kivioselecttool/plugin.h @@ -19,8 +19,8 @@ #ifndef SELECT_PLUGIN_H #define SELECT_PLUGIN_H -#include <qstringlist.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <klibloader.h> @@ -28,12 +28,13 @@ class KInstance; class SelectToolFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - SelectToolFactory( QObject* parent = 0, const char* name = 0 ); + SelectToolFactory( TQObject* tqparent = 0, const char* name = 0 ); ~SelectToolFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* tqparent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList() ); static KInstance* global(); diff --git a/kivio/plugins/kivioselecttool/tool_select.cpp b/kivio/plugins/kivioselecttool/tool_select.cpp index 333416f9..898a3508 100644 --- a/kivio/plugins/kivioselecttool/tool_select.cpp +++ b/kivio/plugins/kivioselecttool/tool_select.cpp @@ -44,24 +44,24 @@ #include <KoGuides.h> #include "kivio_command.h" -#include <qwmatrix.h> +#include <tqwmatrix.h> #include "kivio_pluginmanager.h" -SelectTool::SelectTool( KivioView* parent ) : Kivio::MouseTool(parent, "Selection Mouse Tool") +SelectTool::SelectTool( KivioView* tqparent ) : Kivio::MouseTool(tqparent, "Selection Mouse Tool") { view()->pluginManager()->setDefaultTool(this); KShortcut selectShortCut(Key_Space); - selectShortCut.setSeq(1, QKeySequence(Key_Escape)); + selectShortCut.setSeq(1, TQKeySequence(Key_Escape)); m_selectAction = new KRadioAction(i18n("&Select"), "select", selectShortCut, actionCollection(), "select"); - connect(m_selectAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); + connect(m_selectAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); m_textEditAction = new KAction(i18n("&Edit Text..."), "text", Key_F2, - this, SLOT(editStencilText()), actionCollection(), "editText"); - (void) new KAction(i18n("Format &Stencils && Connectors..."), 0, 0, view(), SLOT(stencilFormat()), + this, TQT_SLOT(editStencilText()), actionCollection(), "editText"); + (void) new KAction(i18n("Format &Stencils && Connectors..."), 0, 0, TQT_TQOBJECT(view()), TQT_SLOT(stencilFormat()), actionCollection(), "formatStencil"); - m_arrowHeadAction = new KAction(i18n("Format &Arrowheads..."), 0, 0, view(), SLOT(arrowHeadFormat()), + m_arrowHeadAction = new KAction(i18n("Format &Arrowheads..."), 0, 0, TQT_TQOBJECT(view()), TQT_SLOT(arrowHeadFormat()), actionCollection(), "formatConnector"); m_mode = stmNone; @@ -84,17 +84,17 @@ SelectTool::~SelectTool() * @param e The event to be identified and processed * */ -bool SelectTool::processEvent(QEvent* e) +bool SelectTool::processEvent(TQEvent* e) { KivioCanvas* canvas = view()->canvasWidget(); - QMouseEvent *m; + TQMouseEvent *m; switch (e->type()) { - case QEvent::MouseButtonDblClick: - m = (QMouseEvent *)e; + case TQEvent::MouseButtonDblClick: + m = (TQMouseEvent *)e; - if( m->button() == LeftButton ) { + if( m->button() == Qt::LeftButton ) { leftDoubleClick(m->pos()); } @@ -102,12 +102,12 @@ bool SelectTool::processEvent(QEvent* e) return true; break; - case QEvent::MouseButtonPress: - m = (QMouseEvent *)e; + case TQEvent::MouseButtonPress: + m = (TQMouseEvent *)e; - if( m->button() == RightButton ) { + if( m->button() == Qt::RightButton ) { showPopupMenu(m->globalPos()); - } else if( m->button() == LeftButton ) { + } else if( m->button() == Qt::LeftButton ) { if(m->state() & ControlButton) { m_controlKey = true; } else { @@ -121,20 +121,20 @@ bool SelectTool::processEvent(QEvent* e) return true; break; - case QEvent::MouseButtonRelease: - mouseRelease( ((QMouseEvent *)e)->pos() ); + case TQEvent::MouseButtonRelease: + mouseRelease( ((TQMouseEvent *)e)->pos() ); canvas->setFocus(); return true; break; - case QEvent::MouseMove: - mouseMove( static_cast<QMouseEvent*>(e)); + case TQEvent::MouseMove: + mouseMove( TQT_TQMOUSEEVENT(e)); return true; break; - case QEvent::KeyPress: - if((static_cast<QKeyEvent*>(e)->key() >= Key_Left) && (static_cast<QKeyEvent*>(e)->key() <= Key_Down)) { - keyPress(static_cast<QKeyEvent*>(e)); + case TQEvent::KeyPress: + if((TQT_TQKEYEVENT(e)->key() >= Key_Left) && (TQT_TQKEYEVENT(e)->key() <= Key_Down)) { + keyPress(TQT_TQKEYEVENT(e)); return true; } break; @@ -162,11 +162,11 @@ void SelectTool::setActivated(bool a) /** * Selects all stencils inside a given rect */ -void SelectTool::select(const QRect &r) +void SelectTool::select(const TQRect &r) { // Calculate the start and end clicks in terms of page coordinates - KoPoint startPoint = view()->canvasWidget()->mapFromScreen( QPoint( r.x(), r.y() ) ); - KoPoint releasePoint = view()->canvasWidget()->mapFromScreen( QPoint( r.x() + r.width(), r.y() + r.height() ) ); + KoPoint startPoint = view()->canvasWidget()->mapFromScreen( TQPoint( r.x(), r.y() ) ); + KoPoint releasePoint = view()->canvasWidget()->mapFromScreen( TQPoint( r.x() + r.width(), r.y() + r.height() ) ); double x, y, w, h; @@ -192,7 +192,7 @@ void SelectTool::select(const QRect &r) view()->activePage()->selectStencils( x, y, w, h ); } -void SelectTool::mousePress(const QPoint &pos) +void SelectTool::mousePress(const TQPoint &pos) { // Last point is used for undrawing at the last position and calculating the distance the mouse has moved m_lastPoint = view()->canvasWidget()->mapFromScreen(pos); @@ -239,7 +239,7 @@ void SelectTool::mousePress(const QPoint &pos) /** * Tests if we should start rubber banding (always returns true). */ -bool SelectTool::startRubberBanding(const QPoint &pos) +bool SelectTool::startRubberBanding(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); // We didn't find a stencil, so unselect everything if we aren't holding the control key down @@ -247,7 +247,7 @@ bool SelectTool::startRubberBanding(const QPoint &pos) canvas->activePage()->unselectAllStencils(); canvas->startRectDraw( pos, KivioCanvas::Rubber ); - canvas->repaint(); + canvas->tqrepaint(); return true; } @@ -256,7 +256,7 @@ bool SelectTool::startRubberBanding(const QPoint &pos) /** * Tests if we can start dragging a stencil. */ -bool SelectTool::startDragging(const QPoint &pos, bool onlySelected) +bool SelectTool::startDragging(const TQPoint &pos, bool onlySelected) { KivioCanvas* canvas = view()->canvasWidget(); KivioPage *pPage = canvas->activePage(); @@ -299,7 +299,7 @@ bool SelectTool::startDragging(const QPoint &pos, bool onlySelected) // Create a new painter object canvas->beginUnclippedSpawnerPainter(); - // Build the list of old geometry + // Build the list of old tqgeometry KivioSelectDragData *pData; m_lstOldGeometry.clear(); pStencil = canvas->activePage()->selectedStencils()->first(); @@ -322,7 +322,7 @@ bool SelectTool::startDragging(const QPoint &pos, bool onlySelected) return true; } -bool SelectTool::startCustomDragging(const QPoint &pos, bool selectedOnly ) +bool SelectTool::startCustomDragging(const TQPoint &pos, bool selectedOnly ) { KivioCanvas* canvas = view()->canvasWidget(); KivioPage *pPage = canvas->activePage(); @@ -365,7 +365,7 @@ bool SelectTool::startCustomDragging(const QPoint &pos, bool selectedOnly ) m_customDragOrigPoint = pStencil->customIDPoint(m_customDragID); view()->canvasWidget()->setShowConnectorTargets(true); - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); // Create a new painter object canvas->beginUnclippedSpawnerPainter(); @@ -377,7 +377,7 @@ bool SelectTool::startCustomDragging(const QPoint &pos, bool selectedOnly ) /** * Tests if we can start resizing a stencil */ -bool SelectTool::startResizing(const QPoint &pos) +bool SelectTool::startResizing(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen(pos); @@ -450,9 +450,9 @@ bool SelectTool::startResizing(const QPoint &pos) -void SelectTool::mouseMove(QMouseEvent* e) +void SelectTool::mouseMove(TQMouseEvent* e) { - QPoint pos = e->pos(); + TQPoint pos = e->pos(); bool ignoreGridGuides = e->state() & ShiftButton; switch( m_mode ) @@ -481,7 +481,7 @@ void SelectTool::mouseMove(QMouseEvent* e) m_lastPoint = view()->canvasWidget()->mapFromScreen(pos); } -void SelectTool::continueRubberBanding(const QPoint &pos) +void SelectTool::continueRubberBanding(const TQPoint &pos) { view()->canvasWidget()->continueRectDraw( pos, KivioCanvas::Rubber ); } @@ -491,10 +491,10 @@ void SelectTool::continueRubberBanding(const QPoint &pos) * Continues the dragging process of a stencil (moving) * * How does this work? Initially we create a list of all the original - * geometry of all the selected stencils. We use that to calculate delta + * tqgeometry of all the selected stencils. We use that to calculate delta * movements and snap them to the grid. */ -void SelectTool::continueDragging(const QPoint &pos, bool ignoreGridGuides) +void SelectTool::continueDragging(const TQPoint &pos, bool ignoreGridGuides) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen( pos ); @@ -512,7 +512,7 @@ void SelectTool::continueDragging(const QPoint &pos, bool ignoreGridGuides) canvas->drawSelectedStencilsXOR(); } else { canvas->activePage()->setPaintSelected(false); - canvas->repaint(); + canvas->tqrepaint(); m_firstTime = false; } @@ -598,7 +598,7 @@ void SelectTool::continueDragging(const QPoint &pos, bool ignoreGridGuides) view()->updateToolBars(); } -void SelectTool::continueCustomDragging(const QPoint &pos) +void SelectTool::continueCustomDragging(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen(pos); @@ -628,7 +628,7 @@ void SelectTool::continueCustomDragging(const QPoint &pos) canvas->drawStencilXOR(m_pCustomDraggingStencil); } else { m_pCustomDraggingStencil->setHidden(true); - canvas->repaint(); + canvas->tqrepaint(); m_firstTime = false; } } @@ -641,14 +641,14 @@ void SelectTool::continueCustomDragging(const QPoint &pos) if(m_pCustomDraggingStencil->type() != kstConnector){ canvas->drawStencilXOR(m_pCustomDraggingStencil); } else { - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); } view()->updateToolBars(); } -void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) +void SelectTool::continueResizing(const TQPoint &pos, bool ignoreGridGuides) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen(pos); @@ -659,7 +659,7 @@ void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) KivioSelectDragData *pData = m_lstOldGeometry.first(); -/* QWMatrix m; +/* TQWMatrix m; double w2 = m_pResizingStencil->w() / 2.0; double h2 = m_pResizingStencil->h() / 2.0; m.translate(m_pResizingStencil->x(), m_pResizingStencil->y()); @@ -674,7 +674,7 @@ void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) if( !pData ) { - kdDebug(43000) << "SelectTool::continueResizing() - Original geometry not found" << endl; + kdDebug(43000) << "SelectTool::continueResizing() - Original tqgeometry not found" << endl; return; } @@ -687,7 +687,7 @@ void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) canvas->drawStencilXOR( m_pResizingStencil ); } else { m_pResizingStencil->setHidden(true); - canvas->repaint(); + canvas->tqrepaint(); m_firstTime = false; } @@ -814,7 +814,7 @@ void SelectTool::continueResizing(const QPoint &pos, bool ignoreGridGuides) /** * Change the mouse cursor based on what it is over. */ -void SelectTool::changeMouseCursor(const QPoint &pos) +void SelectTool::changeMouseCursor(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint pagePoint = canvas->mapFromScreen(pos); @@ -897,7 +897,7 @@ int SelectTool::isOverResizeHandle( KivioStencil *pStencil, const double x, cons int available; - QWMatrix m; + TQWMatrix m; double w = pStencil->w(); double h = pStencil->h(); double w2 = pStencil->w() / 2.0; @@ -969,7 +969,7 @@ int SelectTool::isOverResizeHandle( KivioStencil *pStencil, const double x, cons } -void SelectTool::mouseRelease(const QPoint &pos) +void SelectTool::mouseRelease(const TQPoint &pos) { m_releasePoint = pos; @@ -994,11 +994,11 @@ void SelectTool::mouseRelease(const QPoint &pos) m_mode = stmNone; - view()->canvasWidget()->guideLines().repaintAfterSnapping(); + view()->canvasWidget()->guideLines().tqrepaintAfterSnapping(); view()->doc()->updateView(view()->activePage()); } -void SelectTool::endRubberBanding(const QPoint &pos) +void SelectTool::endRubberBanding(const TQPoint &pos) { KivioCanvas* canvas = view()->canvasWidget(); // End the rubber-band drawing @@ -1015,7 +1015,7 @@ void SelectTool::endRubberBanding(const QPoint &pos) view()->updateToolBars(); } -void SelectTool::endDragging(const QPoint&) +void SelectTool::endDragging(const TQPoint&) { KivioCanvas* canvas = view()->canvasWidget(); canvas->activePage()->setPaintSelected(true); @@ -1050,11 +1050,11 @@ void SelectTool::endDragging(const QPoint&) canvas->drawSelectedStencilsXOR(); canvas->endUnclippedSpawnerPainter(); - // Clear the list of old geometry + // Clear the list of old tqgeometry m_lstOldGeometry.clear(); } -void SelectTool::endCustomDragging(const QPoint&) +void SelectTool::endCustomDragging(const TQPoint&) { KivioCanvas* canvas = view()->canvasWidget(); m_pCustomDraggingStencil->setHidden(false); @@ -1077,10 +1077,10 @@ void SelectTool::endCustomDragging(const QPoint&) canvas->endUnclippedSpawnerPainter(); canvas->setShowConnectorTargets(false); - canvas->repaint(); + canvas->tqrepaint(); } -void SelectTool::endResizing(const QPoint&) +void SelectTool::endResizing(const TQPoint&) { KivioCanvas* canvas = view()->canvasWidget(); m_pResizingStencil->setHidden(false); @@ -1105,7 +1105,7 @@ void SelectTool::endResizing(const QPoint&) /** * Shows the popupmenu at a given point. */ -void SelectTool::showPopupMenu( const QPoint &pos ) +void SelectTool::showPopupMenu( const TQPoint &pos ) { KPopupMenu* menu = 0; @@ -1138,7 +1138,7 @@ void SelectTool::showPopupMenu( const QPoint &pos ) * it launches the text tool on the selected stencils and switches back * to this tool when it's done. */ -void SelectTool::leftDoubleClick(const QPoint& pos) +void SelectTool::leftDoubleClick(const TQPoint& pos) { if( view()->activePage()->selectedStencils()->count() <= 0 ) return; @@ -1164,7 +1164,7 @@ void SelectTool::leftDoubleClick(const QPoint& pos) } } -void SelectTool::editText(QPtrList<KivioStencil>* stencils) +void SelectTool::editText(TQPtrList<KivioStencil>* stencils) { // Locate the text tool. If not found, bail with an error Kivio::Plugin *p = view()->pluginManager()->findPlugin("Text Mouse Tool"); @@ -1191,7 +1191,7 @@ void SelectTool::editStencilText() editText(view()->activePage()->selectedStencils()); } -void SelectTool::keyPress(QKeyEvent* e) +void SelectTool::keyPress(TQKeyEvent* e) { KivioCanvas* canvas = view()->canvasWidget(); @@ -1200,7 +1200,7 @@ void SelectTool::keyPress(QKeyEvent* e) // Create a new painter object canvas->beginUnclippedSpawnerPainter(); - // Build the list of old geometry + // Build the list of old tqgeometry KivioSelectDragData *pData; m_lstOldGeometry.clear(); KivioStencil* pStencil = canvas->activePage()->selectedStencils()->first(); @@ -1253,8 +1253,8 @@ void SelectTool::keyPress(QKeyEvent* e) break; } - endDragging(QPoint()); - canvas->guideLines().repaintAfterSnapping(); + endDragging(TQPoint()); + canvas->guideLines().tqrepaintAfterSnapping(); canvas->setFocus(); } diff --git a/kivio/plugins/kivioselecttool/tool_select.h b/kivio/plugins/kivioselecttool/tool_select.h index 6a6bd9b5..6e476b99 100644 --- a/kivio/plugins/kivioselecttool/tool_select.h +++ b/kivio/plugins/kivioselecttool/tool_select.h @@ -20,15 +20,15 @@ #ifndef TOOL_SELECT_H #define TOOL_SELECT_H -#include <qptrlist.h> +#include <tqptrlist.h> #include <KoPoint.h> #include <KoRect.h> #include "kivio_mousetool.h" class KivioView; class KivioPage; -class QMouseEvent; -class QKeyEvent; +class TQMouseEvent; +class TQKeyEvent; class KPopupMenu; class KRadioAction; class KAction; @@ -54,13 +54,14 @@ enum { class SelectTool : public Kivio::MouseTool { Q_OBJECT + TQ_OBJECT public: - SelectTool( KivioView* parent ); + SelectTool( KivioView* tqparent ); ~SelectTool(); - virtual bool processEvent(QEvent* e); + virtual bool processEvent(TQEvent* e); - void select(const QRect&); + void select(const TQRect&); public slots: void setActivated(bool a); @@ -69,39 +70,39 @@ class SelectTool : public Kivio::MouseTool void operationDone(); protected slots: - void editText(QPtrList<KivioStencil>* stencils); + void editText(TQPtrList<KivioStencil>* stencils); void showProperties(); void editStencilText(); protected: - void mousePress(const QPoint&); - void mouseMove(QMouseEvent*); - void mouseRelease(const QPoint&); - void leftDoubleClick(const QPoint&); + void mousePress(const TQPoint&); + void mouseMove(TQMouseEvent*); + void mouseRelease(const TQPoint&); + void leftDoubleClick(const TQPoint&); - bool startResizing(const QPoint&); - bool startDragging(const QPoint&, bool); - bool startCustomDragging(const QPoint&, bool); - bool startRubberBanding(const QPoint&); + bool startResizing(const TQPoint&); + bool startDragging(const TQPoint&, bool); + bool startCustomDragging(const TQPoint&, bool); + bool startRubberBanding(const TQPoint&); - void continueDragging(const QPoint&, bool ignoreGridGuides = false); - void continueCustomDragging(const QPoint&); - void continueResizing(const QPoint&, bool ignoreGridGuides = false); - void continueRubberBanding(const QPoint&); + void continueDragging(const TQPoint&, bool ignoreGridGuides = false); + void continueCustomDragging(const TQPoint&); + void continueResizing(const TQPoint&, bool ignoreGridGuides = false); + void continueRubberBanding(const TQPoint&); - void endResizing(const QPoint&); - void endDragging(const QPoint&); - void endCustomDragging(const QPoint&); - void endRubberBanding(const QPoint&); + void endResizing(const TQPoint&); + void endDragging(const TQPoint&); + void endCustomDragging(const TQPoint&); + void endRubberBanding(const TQPoint&); - void showPopupMenu(const QPoint&); + void showPopupMenu(const TQPoint&); - void changeMouseCursor(const QPoint&); + void changeMouseCursor(const TQPoint&); int isOverResizeHandle( KivioStencil *pStencil, const double x, const double y ); - void keyPress(QKeyEvent* e); + void keyPress(TQKeyEvent* e); - QPoint m_startPoint, m_releasePoint; + TQPoint m_startPoint, m_releasePoint; KoPoint m_lastPoint; KoPoint m_origPoint; @@ -121,7 +122,7 @@ class SelectTool : public Kivio::MouseTool int m_resizeHandle; bool m_controlKey; int m_customDragID; - QPtrList <KivioSelectDragData> m_lstOldGeometry; + TQPtrList <KivioSelectDragData> m_lstOldGeometry; KoRect m_selectedRect; KoPoint m_customDragOrigPoint; diff --git a/kivio/plugins/kiviosmlconnector/plugin.cpp b/kivio/plugins/kiviosmlconnector/plugin.cpp index ee12cf17..a622f6e3 100644 --- a/kivio/plugins/kiviosmlconnector/plugin.cpp +++ b/kivio/plugins/kiviosmlconnector/plugin.cpp @@ -31,8 +31,8 @@ K_EXPORT_COMPONENT_FACTORY( libkiviosmlconnector, SMLConnectorFactory ) KInstance* SMLConnectorFactory::s_global = 0; -SMLConnectorFactory::SMLConnectorFactory( QObject* parent, const char* name ) -: KLibFactory( parent, name ) +SMLConnectorFactory::SMLConnectorFactory( TQObject* tqparent, const char* name ) +: KLibFactory( tqparent, name ) { s_global = new KInstance("kivio"); } @@ -42,12 +42,12 @@ SMLConnectorFactory::~SMLConnectorFactory() delete s_global; } -QObject* SMLConnectorFactory::createObject( QObject* parent, const char*, const char*, const QStringList& ) +TQObject* SMLConnectorFactory::createObject( TQObject* tqparent, const char*, const char*, const TQStringList& ) { - if ( !parent->inherits("KivioView") ) + if ( !tqparent->inherits("KivioView") ) return 0; - QObject *obj = new SMLConnector( (KivioView*)parent ); + TQObject *obj = new SMLConnector( (KivioView*)tqparent ); return obj; } diff --git a/kivio/plugins/kiviosmlconnector/plugin.h b/kivio/plugins/kiviosmlconnector/plugin.h index 530d8de8..9868fcc0 100644 --- a/kivio/plugins/kiviosmlconnector/plugin.h +++ b/kivio/plugins/kiviosmlconnector/plugin.h @@ -19,8 +19,8 @@ #ifndef SML_CONNECTOR_PLUGIN_H #define SML_CONNECTOR_PLUGIN_H -#include <qstringlist.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <klibloader.h> @@ -28,12 +28,13 @@ class KInstance; class SMLConnectorFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - SMLConnectorFactory( QObject* parent = 0, const char* name = 0 ); + SMLConnectorFactory( TQObject* tqparent = 0, const char* name = 0 ); ~SMLConnectorFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* tqparent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList() ); static KInstance* global(); diff --git a/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp b/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp index b6770700..3ab38fa4 100644 --- a/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp +++ b/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.cpp @@ -32,13 +32,13 @@ #include "kivio_stencil_spawner_set.h" #include "kivio_text_style.h" #include "kivio_shape.h" -#include "kivio_shape_data.h" +#include "kivio_tqshape_data.h" #include "kivio_point.h" #include "tkmath.h" -#include <qcolor.h> -#include <qpixmap.h> +#include <tqcolor.h> +#include <tqpixmap.h> #include <kdebug.h> #include <KoZoomHandler.h> #include <kiconloader.h> @@ -48,13 +48,13 @@ static KivioStencilSpawnerInfo sinfo = KivioStencilSpawnerInfo( "Ian Reinhart Ge K_EXPORT_COMPONENT_FACTORY( sml_connector, KGenericFactory<KivioSMLConnectorFactory>( "KivioSMLConnectorFactory" ) ) -KivioSMLConnectorFactory::KivioSMLConnectorFactory( QObject *parent, const char* name, const QStringList& args ) : - KivioStencilFactory( parent, name, args ) +KivioSMLConnectorFactory::KivioSMLConnectorFactory( TQObject *tqparent, const char* name, const TQStringList& args ) : + KivioStencilFactory( tqparent, name, args ) { kdDebug(43000) << "new sml stencil factory: " << endl; } -KivioStencil *KivioSMLConnectorFactory::NewStencil( const QString& name ) +KivioStencil *KivioSMLConnectorFactory::NewStencil( const TQString& name ) { return new KivioSMLConnector( name ); } @@ -65,7 +65,7 @@ KivioStencil *KivioSMLConnectorFactory::NewStencil() } -QPixmap *KivioSMLConnectorFactory::GetIcon() +TQPixmap *KivioSMLConnectorFactory::GetIcon() { return & BarIcon( "SML_conn" ); } @@ -75,7 +75,7 @@ KivioStencilSpawnerInfo *KivioSMLConnectorFactory::GetSpawnerInfo() return & sinfo; } -KivioSMLConnector::KivioSMLConnector( const QString &name ) +KivioSMLConnector::KivioSMLConnector( const TQString &name ) : Kivio1DStencil(), m_name( name ) { @@ -96,9 +96,9 @@ KivioSMLConnector::KivioSMLConnector( const QString &name ) // This is a stencil of type connector setType( kstConnector ); - // We only have one shape, an open path. - //m_shape = new KivioShape(); - //m_shape->shapeData() ->setShapeType( KivioShapeData::kstOpenPath ); + // We only have one tqshape, an open path. + //m_tqshape = new KivioShape(); + //m_tqshape->tqshapeData() ->setShapeType( KivioShapeData::kstOpenPath ); loadPath( name ); } @@ -196,11 +196,11 @@ KivioStencil *KivioSMLConnector::duplicate() void KivioSMLConnector::drawOpenPath( KivioShape *pShape, KivioIntraStencilData *pData ) { KivioPainter * painter; - KivioShapeData *pShapeData = pShape->shapeData(); + KivioShapeData *pShapeData = pShape->tqshapeData(); KivioPoint *pPoint, *pNewPoint; - QPtrList <KivioPoint> *pPointList = pShapeData->pointList(); + TQPtrList <KivioPoint> *pPointList = pShapeData->pointList(); - QPtrList <KivioPoint> *pNewPoints = new QPtrList<KivioPoint>; + TQPtrList <KivioPoint> *pNewPoints = new TQPtrList<KivioPoint>; pNewPoints->setAutoDelete( true ); pPoint = pPointList->first(); @@ -262,10 +262,10 @@ void KivioSMLConnector::paint( KivioIntraStencilData *pData ) } - // Build shape up from m_pConnectorPoints + // Build tqshape up from m_pConnectorPoints - QPtrList <KivioPoint> *pNewPoints = new QPtrList<KivioPoint>; + TQPtrList <KivioPoint> *pNewPoints = new TQPtrList<KivioPoint>; pNewPoints->setAutoDelete( true ); pNewPoints->append(new KivioPoint( zoomHandler->zoomItX( m_pStart->x() ), @@ -309,27 +309,27 @@ void KivioSMLConnector::paintOutline( KivioIntraStencilData *pData ) paint( pData ); } -bool KivioSMLConnector::saveCustom( QDomElement &e, QDomDocument &doc ) +bool KivioSMLConnector::saveCustom( TQDomElement &e, TQDomDocument &doc ) { kdDebug(43000) << "Save custom " << endl; e.appendChild( saveArrowHeads( doc ) ); - //QDomElement type = m_shape->saveXML(doc); + //TQDomElement type = m_tqshape->saveXML(doc); KivioConnectorPoint *p = m_PointList.first(); while ( p ) { - QDomElement pt = p->saveXML( doc ); + TQDomElement pt = p->saveXML( doc ); e.appendChild( pt ); p = m_PointList.next(); } return true; } -bool KivioSMLConnector::loadCustom( const QDomElement &e ) +bool KivioSMLConnector::loadCustom( const TQDomElement &e ) { kdDebug(43000) << "Load custom " << endl; - QDomNode node; - QString name; + TQDomNode node; + TQString name; node = e.firstChild(); while ( !node.isNull() ) @@ -341,8 +341,8 @@ bool KivioSMLConnector::loadCustom( const QDomElement &e ) } else if ( name == "KivioShape" ) { - //m_shape->loadXML(node.toElement()); - QDomNode pts = node.firstChild(); + //m_tqshape->loadXML(node.toElement()); + TQDomNode pts = node.firstChild(); while ( !pts.isNull() ) { KivioConnectorPoint * pt = new KivioConnectorPoint(); @@ -360,9 +360,9 @@ bool KivioSMLConnector::loadCustom( const QDomElement &e ) return true; } -QDomElement KivioSMLConnector::saveArrowHeads( QDomDocument &doc ) +TQDomElement KivioSMLConnector::saveArrowHeads( TQDomDocument &doc ) { - QDomElement e = doc.createElement( "KivioArrowHeads" ); + TQDomElement e = doc.createElement( "KivioArrowHeads" ); e.appendChild( m_startAH->saveXML( doc ) ); e.appendChild( m_endAH->saveXML( doc ) ); @@ -370,11 +370,11 @@ QDomElement KivioSMLConnector::saveArrowHeads( QDomDocument &doc ) return e; } -bool KivioSMLConnector::loadArrowHeads( const QDomElement &e ) +bool KivioSMLConnector::loadArrowHeads( const TQDomElement &e ) { - QDomNode node; - QString nodeName; - QDomElement arrowE; + TQDomNode node; + TQString nodeName; + TQDomElement arrowE; bool first = true; node = e.firstChild(); @@ -404,7 +404,7 @@ bool KivioSMLConnector::loadArrowHeads( const QDomElement &e ) } -bool KivioSMLConnector::loadPath( const QString &file ) +bool KivioSMLConnector::loadPath( const TQString &file ) { kdDebug(43000) << "Loading :" << file << endl; diff --git a/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h b/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h index 4371ff8a..0be46d46 100644 --- a/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h +++ b/kivio/plugins/kiviosmlconnector/sml_connector/sml_connector.h @@ -31,9 +31,9 @@ class KivioPage; class KivioShape; -#include <qstringlist.h> -#include <qcolor.h> -#include <qdom.h> +#include <tqstringlist.h> +#include <tqcolor.h> +#include <tqdom.h> #include "kivio_1d_stencil.h" @@ -41,24 +41,24 @@ class KivioShape; class KivioSMLConnector : public Kivio1DStencil { private: - bool loadPath(const QString &file); + bool loadPath(const TQString &file); //void drawOpenPath( KivioShape *, KivioIntraStencilData * ); - KivioShape *m_shape; - QPtrList<KivioConnectorPoint> m_PointList; + KivioShape *m_tqshape; + TQPtrList<KivioConnectorPoint> m_PointList; - QString m_name; + TQString m_name; protected: KivioArrowHead *m_startAH; KivioArrowHead *m_endAH; - bool loadArrowHeads( const QDomElement & ); - QDomElement saveArrowHeads( QDomDocument & ); - virtual bool loadCustom( const QDomElement & ); - virtual bool saveCustom( QDomElement &, QDomDocument & ); + bool loadArrowHeads( const TQDomElement & ); + TQDomElement saveArrowHeads( TQDomDocument & ); + virtual bool loadCustom( const TQDomElement & ); + virtual bool saveCustom( TQDomElement &, TQDomDocument & ); public: - KivioSMLConnector(const QString& name); + KivioSMLConnector(const TQString& name); virtual ~KivioSMLConnector(); virtual void setStartPoint( double, double ); @@ -93,11 +93,12 @@ public: class KivioSMLConnectorFactory : public KivioStencilFactory { Q_OBJECT + TQ_OBJECT public: - KivioSMLConnectorFactory(QObject *parent=0, const char* name=0, const QStringList& args = QStringList()); - KivioStencil *NewStencil(const QString& name); + KivioSMLConnectorFactory(TQObject *tqparent=0, const char* name=0, const TQStringList& args = TQStringList()); + KivioStencil *NewStencil(const TQString& name); KivioStencil *NewStencil(); - QPixmap *GetIcon(); + TQPixmap *GetIcon(); KivioStencilSpawnerInfo *GetSpawnerInfo(); }; #endif diff --git a/kivio/plugins/kiviosmlconnector/tool_connector.cpp b/kivio/plugins/kiviosmlconnector/tool_connector.cpp index ded38f13..4578f0a7 100644 --- a/kivio/plugins/kiviosmlconnector/tool_connector.cpp +++ b/kivio/plugins/kiviosmlconnector/tool_connector.cpp @@ -18,7 +18,7 @@ */ #include "tool_connector.h" -#include <qcursor.h> +#include <tqcursor.h> #include <kdebug.h> #include <kiconloader.h> #include <kstandarddirs.h> @@ -46,12 +46,12 @@ SMLConnector::SMLConnector( KivioView* view ) { m_connectorAction = new KToggleAction(i18n("Polyline Connector"), "", 0, actionCollection(), "sml_connector"); - connect(m_connectorAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); + connect(m_connectorAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); m_mode = stmNone; - m_pConnectorCursor1 = new QCursor(BarIcon("kivio_connector_cursor1",KivioFactory::global()),2,2); - m_pConnectorCursor2 = new QCursor(BarIcon("kivio_connector_cursor2",KivioFactory::global()),2,2); + m_pConnectorCursor1 = new TQCursor(BarIcon("kivio_connector_cursor1",KivioFactory::global()),2,2); + m_pConnectorCursor2 = new TQCursor(BarIcon("kivio_connector_cursor2",KivioFactory::global()),2,2); } SMLConnector::~SMLConnector() @@ -67,22 +67,22 @@ SMLConnector::~SMLConnector() * @param e The event to be identified and processed * */ -bool SMLConnector::processEvent( QEvent* e ) +bool SMLConnector::processEvent( TQEvent* e ) { switch (e->type()) { - case QEvent::MouseButtonPress: - mousePress( (QMouseEvent*)e ); + case TQEvent::MouseButtonPress: + mousePress( (TQMouseEvent*)e ); return true; break; - case QEvent::MouseButtonRelease: - mouseRelease( (QMouseEvent*)e ); + case TQEvent::MouseButtonRelease: + mouseRelease( (TQMouseEvent*)e ); return true; break; - case QEvent::MouseMove: - mouseMove( (QMouseEvent*)e ); + case TQEvent::MouseMove: + mouseMove( (TQMouseEvent*)e ); return true; break; @@ -111,7 +111,7 @@ void SMLConnector::setActivated(bool a) } } -void SMLConnector::connector(QRect) +void SMLConnector::connector(TQRect) { if (!m_pStencil) return; @@ -135,7 +135,7 @@ void SMLConnector::connector(QRect) doc->updateView(page); } -void SMLConnector::mousePress( QMouseEvent *e ) +void SMLConnector::mousePress( TQMouseEvent *e ) { if(e->button() == RightButton) { @@ -151,7 +151,7 @@ void SMLConnector::mousePress( QMouseEvent *e ) /** * Tests if we should start rubber banding (always returns true). */ -bool SMLConnector::startRubberBanding( QMouseEvent *e ) +bool SMLConnector::startRubberBanding( TQMouseEvent *e ) { KivioDoc* doc = view()->doc(); KivioPage* pPage = view()->activePage(); @@ -190,12 +190,12 @@ bool SMLConnector::startRubberBanding( QMouseEvent *e ) m_pStencil->customDrag(m_pDragData); - canvas->repaint(); + canvas->tqrepaint(); canvas->setCursor(*m_pConnectorCursor2); return true; } -void SMLConnector::mouseMove( QMouseEvent * e ) +void SMLConnector::mouseMove( TQMouseEvent * e ) { switch( m_mode ) { @@ -208,7 +208,7 @@ void SMLConnector::mouseMove( QMouseEvent * e ) } } -void SMLConnector::continueRubberBanding( QMouseEvent *e ) +void SMLConnector::continueRubberBanding( TQMouseEvent *e ) { KivioCanvas* canvas = view()->canvasWidget(); KoPoint endPoint = canvas->mapFromScreen( e->pos() ); @@ -223,10 +223,10 @@ void SMLConnector::continueRubberBanding( QMouseEvent *e ) m_pStencil->customDrag(m_pDragData); m_pStencil->updateGeometry(); - canvas->repaint(); + canvas->tqrepaint(); } -void SMLConnector::mouseRelease( QMouseEvent *e ) +void SMLConnector::mouseRelease( TQMouseEvent *e ) { switch( m_mode ) { @@ -239,7 +239,7 @@ void SMLConnector::mouseRelease( QMouseEvent *e ) m_mode = stmNone; } -void SMLConnector::endRubberBanding(QMouseEvent *) +void SMLConnector::endRubberBanding(TQMouseEvent *) { connector(view()->canvasWidget()->rect()); m_pStencil = 0; diff --git a/kivio/plugins/kiviosmlconnector/tool_connector.h b/kivio/plugins/kiviosmlconnector/tool_connector.h index aecb26db..788192f6 100644 --- a/kivio/plugins/kiviosmlconnector/tool_connector.h +++ b/kivio/plugins/kiviosmlconnector/tool_connector.h @@ -22,8 +22,8 @@ #include "kivio_mousetool.h" #include <KoPoint.h> -class QMouseEvent; -class QCursor; +class TQMouseEvent; +class TQCursor; class KToggleAction; @@ -34,13 +34,14 @@ class KivioCustomDragData; class SMLConnector : public Kivio::MouseTool { Q_OBJECT + TQ_OBJECT public: SMLConnector( KivioView* view ); ~SMLConnector(); - virtual bool processEvent( QEvent* ); + virtual bool processEvent( TQEvent* ); - void connector(QRect); + void connector(TQRect); public slots: virtual void setActivated(bool a); @@ -49,17 +50,17 @@ signals: void operationDone(); protected: - void mousePress(QMouseEvent *); - void mouseMove(QMouseEvent *); - void mouseRelease(QMouseEvent *); + void mousePress(TQMouseEvent *); + void mouseMove(TQMouseEvent *); + void mouseRelease(TQMouseEvent *); - bool startRubberBanding(QMouseEvent*); - void continueRubberBanding(QMouseEvent *); - void endRubberBanding(QMouseEvent *); + bool startRubberBanding(TQMouseEvent*); + void continueRubberBanding(TQMouseEvent *); + void endRubberBanding(TQMouseEvent *); - QPoint m_startPoint, m_releasePoint; + TQPoint m_startPoint, m_releasePoint; // Connector Tool Mode enum @@ -71,8 +72,8 @@ protected: private: // Flag to indicate that we are drawing a rubber band int m_mode; - QCursor* m_pConnectorCursor1; - QCursor* m_pConnectorCursor2; + TQCursor* m_pConnectorCursor1; + TQCursor* m_pConnectorCursor2; KivioSMLConnector* m_pStencil; KoPoint startPoint; KivioCustomDragData* m_pDragData; diff --git a/kivio/plugins/kiviotargettool/kiviotargettool.cpp b/kivio/plugins/kiviotargettool/kiviotargettool.cpp index 95958d2a..672c0a43 100644 --- a/kivio/plugins/kiviotargettool/kiviotargettool.cpp +++ b/kivio/plugins/kiviotargettool/kiviotargettool.cpp @@ -18,7 +18,7 @@ */ #include "kiviotargettool.h" -#include <qcursor.h> +#include <tqcursor.h> #include <klocale.h> @@ -32,12 +32,12 @@ #include "kivio_command.h" namespace Kivio { - TargetTool::TargetTool(KivioView* parent) : MouseTool(parent, "Add Target Mouse Tool") + TargetTool::TargetTool(KivioView* tqparent) : MouseTool(tqparent, "Add Target Mouse Tool") { m_targetAction = new Kivio::MouseToolAction(i18n("Add Connector Target"), "add_target", 0, actionCollection(), "addTargetTool"); - connect(m_targetAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); - connect(m_targetAction, SIGNAL(doubleClicked()), this, SLOT(makePermanent())); + connect(m_targetAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); + connect(m_targetAction, TQT_SIGNAL(doubleClicked()), this, TQT_SLOT(makePermanent())); m_permanent = false; } @@ -46,13 +46,13 @@ namespace Kivio { { } - bool TargetTool::processEvent(QEvent* e) + bool TargetTool::processEvent(TQEvent* e) { - if(e->type() == QEvent::MouseButtonPress) { - mousePress(static_cast<QMouseEvent*>(e)); + if(e->type() == TQEvent::MouseButtonPress) { + mousePress(TQT_TQMOUSEEVENT(e)); return true; - } else if(e->type() == QEvent::MouseMove) { - mouseMove(static_cast<QMouseEvent*>(e)); + } else if(e->type() == TQEvent::MouseMove) { + mouseMove(TQT_TQMOUSEEVENT(e)); return true; } @@ -77,7 +77,7 @@ namespace Kivio { view()->doc()->addCommand(command); } - void TargetTool::mousePress(QMouseEvent* e) + void TargetTool::mousePress(TQMouseEvent* e) { KoPoint p = view()->canvasWidget()->mapFromScreen(e->pos()); int colType; @@ -92,15 +92,15 @@ namespace Kivio { } } - void TargetTool::mouseMove(QMouseEvent* e) + void TargetTool::mouseMove(TQMouseEvent* e) { KoPoint p = view()->canvasWidget()->mapFromScreen(e->pos()); int colType; if(view()->canvasWidget()->activePage()->checkForStencil(&p, &colType, 0, false)) { - view()->canvasWidget()->setCursor(Qt::CrossCursor); + view()->canvasWidget()->setCursor(TQt::CrossCursor); } else { - view()->canvasWidget()->setCursor(Qt::ForbiddenCursor); + view()->canvasWidget()->setCursor(TQt::ForbiddenCursor); } } diff --git a/kivio/plugins/kiviotargettool/kiviotargettool.h b/kivio/plugins/kiviotargettool/kiviotargettool.h index 5a1fb787..52286f82 100644 --- a/kivio/plugins/kiviotargettool/kiviotargettool.h +++ b/kivio/plugins/kiviotargettool/kiviotargettool.h @@ -23,7 +23,7 @@ #include "kivio_mousetool.h" -class QMouseEvent; +class TQMouseEvent; namespace Kivio { class MouseToolAction; @@ -36,11 +36,12 @@ namespace Kivio { class TargetTool : public MouseTool { Q_OBJECT + TQ_OBJECT public: - TargetTool(KivioView* parent); + TargetTool(KivioView* tqparent); ~TargetTool(); - virtual bool processEvent(QEvent* e); + virtual bool processEvent(TQEvent* e); public slots: virtual void setActivated(bool); @@ -50,8 +51,8 @@ namespace Kivio { void makePermanent(); protected: - void mousePress(QMouseEvent* e); - void mouseMove(QMouseEvent* e); + void mousePress(TQMouseEvent* e); + void mouseMove(TQMouseEvent* e); private: Kivio::MouseToolAction* m_targetAction; diff --git a/kivio/plugins/kiviotargettool/kiviotargettoolfactory.cpp b/kivio/plugins/kiviotargettool/kiviotargettoolfactory.cpp index b80e9734..599c3a01 100644 --- a/kivio/plugins/kiviotargettool/kiviotargettoolfactory.cpp +++ b/kivio/plugins/kiviotargettool/kiviotargettoolfactory.cpp @@ -24,8 +24,8 @@ K_EXPORT_COMPONENT_FACTORY( libkiviotargettool, KivioTargetToolFactory ) KInstance* KivioTargetToolFactory::s_global = 0; -KivioTargetToolFactory::KivioTargetToolFactory(QObject *parent, const char *name) - : KLibFactory(parent, name) +KivioTargetToolFactory::KivioTargetToolFactory(TQObject *tqparent, const char *name) + : KLibFactory(tqparent, name) { s_global = new KInstance("kivio"); } @@ -35,12 +35,12 @@ KivioTargetToolFactory::~KivioTargetToolFactory() delete s_global; } -QObject* KivioTargetToolFactory::createObject( QObject* parent, const char*, const char*, const QStringList& ) +TQObject* KivioTargetToolFactory::createObject( TQObject* tqparent, const char*, const char*, const TQStringList& ) { - if ( !parent->inherits("KivioView") ) + if ( !tqparent->inherits("KivioView") ) return 0; - QObject *obj = new Kivio::TargetTool(static_cast<KivioView*>(parent)); + TQObject *obj = new Kivio::TargetTool(static_cast<KivioView*>(TQT_TQWIDGET(tqparent))); return obj; } diff --git a/kivio/plugins/kiviotargettool/kiviotargettoolfactory.h b/kivio/plugins/kiviotargettool/kiviotargettoolfactory.h index abe028ea..e1ba4521 100644 --- a/kivio/plugins/kiviotargettool/kiviotargettoolfactory.h +++ b/kivio/plugins/kiviotargettool/kiviotargettoolfactory.h @@ -19,8 +19,8 @@ #ifndef KIVIOTARGETTOOLFACTORY_H #define KIVIOTARGETTOOLFACTORY_H -#include <qstringlist.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <klibloader.h> @@ -29,12 +29,13 @@ class KInstance; class KivioTargetToolFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - KivioTargetToolFactory(QObject *parent = 0, const char *name = 0); + KivioTargetToolFactory(TQObject *tqparent = 0, const char *name = 0); ~KivioTargetToolFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* tqparent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList() ); static KInstance* global(); diff --git a/kivio/plugins/kiviotexttool/kivio_stenciltexteditorui.ui b/kivio/plugins/kiviotexttool/kivio_stenciltexteditorui.ui index 8a6f9ce6..1042746f 100644 --- a/kivio/plugins/kiviotexttool/kivio_stenciltexteditorui.ui +++ b/kivio/plugins/kiviotexttool/kivio_stenciltexteditorui.ui @@ -8,7 +8,7 @@ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public You should have received a copy of the GNU General Public License along with this program; if not, write to the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA. </comment> <author>Copyright (C) 2005 Peter Simonsson</author> -<widget class="QWidget"> +<widget class="TQWidget"> <property name="name"> <cstring>Kivio::StencilTextEditorUI</cstring> </property> @@ -30,7 +30,7 @@ You should have received a copy of the GNU General Public License along with thi <property name="margin"> <number>0</number> </property> - <widget class="QToolButton" row="0" column="2"> + <widget class="TQToolButton" row="0" column="2"> <property name="name"> <cstring>m_boldButton</cstring> </property> @@ -147,7 +147,7 @@ You should have received a copy of the GNU General Public License along with thi <cstring>m_fontCombo</cstring> </property> </widget> - <widget class="QToolButton" row="0" column="3"> + <widget class="TQToolButton" row="0" column="3"> <property name="name"> <cstring>m_italicsButton</cstring> </property> @@ -161,7 +161,7 @@ You should have received a copy of the GNU General Public License along with thi <string>Italics</string> </property> </widget> - <widget class="QToolButton" row="0" column="4"> + <widget class="TQToolButton" row="0" column="4"> <property name="name"> <cstring>m_underLineButton</cstring> </property> @@ -185,7 +185,7 @@ You should have received a copy of the GNU General Public License along with thi <property name="sizeType"> <enum>Expanding</enum> </property> - <property name="sizeHint"> + <property name="tqsizeHint"> <size> <width>110</width> <height>20</height> @@ -200,7 +200,7 @@ You should have received a copy of the GNU General Public License along with thi <string></string> </property> </widget> - <widget class="QToolButton" row="0" column="5"> + <widget class="TQToolButton" row="0" column="5"> <property name="name"> <cstring>m_hAlignButton</cstring> </property> @@ -214,7 +214,7 @@ You should have received a copy of the GNU General Public License along with thi <string>Horizontal Alignment</string> </property> </widget> - <widget class="QToolButton" row="0" column="6"> + <widget class="TQToolButton" row="0" column="6"> <property name="name"> <cstring>m_vAlignButton</cstring> </property> @@ -243,8 +243,8 @@ You should have received a copy of the GNU General Public License along with thi <tabstop>m_fontSizeCombo</tabstop> <tabstop>m_textColorButton</tabstop> </tabstops> -<layoutdefaults spacing="6" margin="11"/> -<layoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> +<tqlayoutdefaults spacing="6" margin="11"/> +<tqlayoutfunctions spacing="KDialog::spacingHint" margin="KDialog::marginHint"/> <includehints> <includehint>kcombobox.h</includehint> <includehint>klineedit.h</includehint> diff --git a/kivio/plugins/kiviotexttool/plugin.cpp b/kivio/plugins/kiviotexttool/plugin.cpp index 456805a4..cd9a43ec 100644 --- a/kivio/plugins/kiviotexttool/plugin.cpp +++ b/kivio/plugins/kiviotexttool/plugin.cpp @@ -31,8 +31,8 @@ K_EXPORT_COMPONENT_FACTORY( libkiviotexttool, TextToolFactory ) KInstance* TextToolFactory::s_global = 0; -TextToolFactory::TextToolFactory( QObject* parent, const char* name ) -: KLibFactory( parent, name ) +TextToolFactory::TextToolFactory( TQObject* tqparent, const char* name ) +: KLibFactory( tqparent, name ) { s_global = new KInstance("kivio"); } @@ -42,12 +42,12 @@ TextToolFactory::~TextToolFactory() delete s_global; } -QObject* TextToolFactory::createObject( QObject* parent, const char*, const char*, const QStringList& ) +TQObject* TextToolFactory::createObject( TQObject* tqparent, const char*, const char*, const TQStringList& ) { - if ( !parent->inherits("KivioView") ) + if ( !tqparent->inherits("KivioView") ) return 0; - QObject *obj = new TextTool( (KivioView*)parent ); + TQObject *obj = new TextTool( (KivioView*)tqparent ); return obj; } diff --git a/kivio/plugins/kiviotexttool/plugin.h b/kivio/plugins/kiviotexttool/plugin.h index 18d4f41f..1e30ddb0 100644 --- a/kivio/plugins/kiviotexttool/plugin.h +++ b/kivio/plugins/kiviotexttool/plugin.h @@ -19,8 +19,8 @@ #ifndef TEXT_PLUGIN_H #define TEXT_PLUGIN_H -#include <qstringlist.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <klibloader.h> @@ -28,12 +28,13 @@ class KInstance; class TextToolFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - TextToolFactory( QObject* parent = 0, const char* name = 0 ); + TextToolFactory( TQObject* tqparent = 0, const char* name = 0 ); ~TextToolFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* tqparent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList() ); static KInstance* global(); diff --git a/kivio/plugins/kiviotexttool/stenciltexteditor.cpp b/kivio/plugins/kiviotexttool/stenciltexteditor.cpp index 9cf3a7e5..a68b9548 100644 --- a/kivio/plugins/kiviotexttool/stenciltexteditor.cpp +++ b/kivio/plugins/kiviotexttool/stenciltexteditor.cpp @@ -18,10 +18,10 @@ */ #include "stenciltexteditor.h" -#include <qtoolbutton.h> -#include <qfont.h> -#include <qcolor.h> -#include <qpopupmenu.h> +#include <tqtoolbutton.h> +#include <tqfont.h> +#include <tqcolor.h> +#include <tqpopupmenu.h> #include <kiconloader.h> #include <ktextedit.h> @@ -35,8 +35,8 @@ namespace Kivio { -StencilTextEditor::StencilTextEditor(const QString& caption, QWidget *parent, const char *name) - : KDialogBase(parent, name, true, caption, KDialogBase::Ok|KDialogBase::Cancel) +StencilTextEditor::StencilTextEditor(const TQString& caption, TQWidget *tqparent, const char *name) + : KDialogBase(tqparent, name, true, caption, KDialogBase::Ok|KDialogBase::Cancel) { m_hAlign = -1; m_vAlign = -1; @@ -47,30 +47,30 @@ StencilTextEditor::StencilTextEditor(const QString& caption, QWidget *parent, co m_mainWidget->m_italicsButton->setIconSet(SmallIconSet("text_italic", 16)); m_mainWidget->m_underLineButton->setIconSet(SmallIconSet("text_under", 16)); - QPopupMenu* menu = new QPopupMenu(m_mainWidget->m_hAlignButton, "hAlignMenu"); + TQPopupMenu* menu = new TQPopupMenu(m_mainWidget->m_hAlignButton, "hAlignMenu"); menu->setCheckable(true); - menu->insertItem(SmallIconSet("text_left", 16), i18n("Align Left"), Qt::AlignLeft); - menu->insertItem(SmallIconSet("text_center", 16), i18n("Align Center"), Qt::AlignHCenter); - menu->insertItem(SmallIconSet("text_right", 16), i18n("Align Right"), Qt::AlignRight); + menu->insertItem(SmallIconSet("text_left", 16), i18n("Align Left"), TQt::AlignLeft); + menu->insertItem(SmallIconSet("text_center", 16), i18n("Align Center"), TQt::AlignHCenter); + menu->insertItem(SmallIconSet("text_right", 16), i18n("Align Right"), TQt::AlignRight); m_mainWidget->m_hAlignButton->setPopup(menu); - connect(menu, SIGNAL(activated(int)), this, SLOT(setHorizontalAlign(int))); - connect(m_mainWidget->m_hAlignButton, SIGNAL(clicked()), this, SLOT(showHAlignPopup())); + connect(menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setHorizontalAlign(int))); + connect(m_mainWidget->m_hAlignButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(showHAlignPopup())); - menu = new QPopupMenu(m_mainWidget->m_vAlignButton, "hAlignMenu"); + menu = new TQPopupMenu(m_mainWidget->m_vAlignButton, "hAlignMenu"); menu->setCheckable(true); - menu->insertItem(SmallIconSet("align_top", 16), i18n("Align Top"), Qt::AlignTop); - menu->insertItem(SmallIconSet("align_vcenter", 16), i18n("Align Vertical Center"), Qt::AlignVCenter); - menu->insertItem(SmallIconSet("align_bottom", 16), i18n("Align Bottom"), Qt::AlignBottom); + menu->insertItem(SmallIconSet("align_top", 16), i18n("Align Top"), TQt::AlignTop); + menu->insertItem(SmallIconSet("align_vcenter", 16), i18n("AlignQt::Vertical Center"), TQt::AlignVCenter); + menu->insertItem(SmallIconSet("align_bottom", 16), i18n("Align Bottom"), TQt::AlignBottom); m_mainWidget->m_vAlignButton->setPopup(menu); - connect(menu, SIGNAL(activated(int)), this, SLOT(setVerticalAlign(int))); - connect(m_mainWidget->m_vAlignButton, SIGNAL(clicked()), this, SLOT(showVAlignPopup())); + connect(menu, TQT_SIGNAL(activated(int)), this, TQT_SLOT(setVerticalAlign(int))); + connect(m_mainWidget->m_vAlignButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(showVAlignPopup())); - connect(m_mainWidget->m_fontCombo, SIGNAL(activated(int)), this, SLOT(updateFormating())); - connect(m_mainWidget->m_fontSizeCombo, SIGNAL(activated(int)), this, SLOT(updateFormating())); - connect(m_mainWidget->m_boldButton, SIGNAL(clicked()), this, SLOT(updateFormating())); - connect(m_mainWidget->m_italicsButton, SIGNAL(clicked()), this, SLOT(updateFormating())); - connect(m_mainWidget->m_underLineButton, SIGNAL(clicked()), this, SLOT(updateFormating())); - connect(m_mainWidget->m_textColorButton, SIGNAL(clicked()), this, SLOT(updateFormating())); + connect(m_mainWidget->m_fontCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateFormating())); + connect(m_mainWidget->m_fontSizeCombo, TQT_SIGNAL(activated(int)), this, TQT_SLOT(updateFormating())); + connect(m_mainWidget->m_boldButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateFormating())); + connect(m_mainWidget->m_italicsButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateFormating())); + connect(m_mainWidget->m_underLineButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateFormating())); + connect(m_mainWidget->m_textColorButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(updateFormating())); m_mainWidget->m_textArea->setFocus(); } @@ -79,23 +79,23 @@ StencilTextEditor::~StencilTextEditor() { } -void StencilTextEditor::setFont(const QFont& font) +void StencilTextEditor::setFont(const TQFont& font) { m_mainWidget->m_textArea->setFont(font); m_mainWidget->m_fontCombo->setCurrentFont(font.family()); - m_mainWidget->m_fontSizeCombo->setCurrentText(QString::number(font.pointSize())); + m_mainWidget->m_fontSizeCombo->setCurrentText(TQString::number(font.pointSize())); m_mainWidget->m_boldButton->setOn(font.bold()); m_mainWidget->m_italicsButton->setOn(font.italic()); m_mainWidget->m_underLineButton->setOn(font.underline()); } -void StencilTextEditor::setFontColor(const QColor& color) +void StencilTextEditor::setFontColor(const TQColor& color) { m_mainWidget->m_textArea->setPaletteForegroundColor(color); m_mainWidget->m_textColorButton->setColor(color); } -void StencilTextEditor::setBackgroundColor(const QColor& color) +void StencilTextEditor::setBackgroundColor(const TQColor& color) { m_mainWidget->m_textArea->setPaletteBackgroundColor(color); } @@ -108,7 +108,7 @@ void StencilTextEditor::setHorizontalAlign(int flag) m_mainWidget->m_hAlignButton->popup()->setItemChecked(flag, true); m_mainWidget->m_hAlignButton->setIconSet(*(m_mainWidget->m_hAlignButton->popup()->iconSet(flag))); - m_mainWidget->m_textArea->setAlignment(flag|verticalAlignment()); + m_mainWidget->m_textArea->tqsetAlignment(flag|verticalAlignment()); m_hAlign = flag; } @@ -120,13 +120,13 @@ void StencilTextEditor::setVerticalAlign(int flag) m_mainWidget->m_vAlignButton->popup()->setItemChecked(flag, true); m_mainWidget->m_vAlignButton->setIconSet(*(m_mainWidget->m_vAlignButton->popup()->iconSet(flag))); - m_mainWidget->m_textArea->setAlignment(flag|horizontalAlignment()); + m_mainWidget->m_textArea->tqsetAlignment(flag|horizontalAlignment()); m_vAlign = flag; } -QFont StencilTextEditor::font() const +TQFont StencilTextEditor::font() const { - QFont font; + TQFont font; font.setFamily(m_mainWidget->m_fontCombo->currentFont()); font.setPointSize(m_mainWidget->m_fontSizeCombo->currentText().toInt()); font.setBold(m_mainWidget->m_boldButton->isOn()); @@ -136,27 +136,27 @@ QFont StencilTextEditor::font() const return font; } -QColor StencilTextEditor::fontColor() const +TQColor StencilTextEditor::fontColor() const { return m_mainWidget->m_textColorButton->color(); } -Qt::AlignmentFlags StencilTextEditor::horizontalAlignment() const +TQt::AlignmentFlags StencilTextEditor::horizontalAlignment() const { - return static_cast<Qt::AlignmentFlags>(m_hAlign); + return static_cast<TQt::AlignmentFlags>(m_hAlign); } -Qt::AlignmentFlags StencilTextEditor::verticalAlignment() const +TQt::AlignmentFlags StencilTextEditor::verticalAlignment() const { - return static_cast<Qt::AlignmentFlags>(m_vAlign); + return static_cast<TQt::AlignmentFlags>(m_vAlign); } -void StencilTextEditor::setText(const QString& text) +void StencilTextEditor::setText(const TQString& text) { m_mainWidget->m_textArea->setText(text); } -QString StencilTextEditor::text() const +TQString StencilTextEditor::text() const { return m_mainWidget->m_textArea->text(); } @@ -169,7 +169,7 @@ void StencilTextEditor::updateFormating() m_mainWidget->m_textArea->selectAll(true); - m_mainWidget->m_textArea->setAlignment(horizontalAlignment()|verticalAlignment()); + m_mainWidget->m_textArea->tqsetAlignment(horizontalAlignment()|verticalAlignment()); m_mainWidget->m_textArea->selectAll(false); m_mainWidget->m_textArea->setFocus(); diff --git a/kivio/plugins/kiviotexttool/stenciltexteditor.h b/kivio/plugins/kiviotexttool/stenciltexteditor.h index 0c2a3b1a..d57cb9dd 100644 --- a/kivio/plugins/kiviotexttool/stenciltexteditor.h +++ b/kivio/plugins/kiviotexttool/stenciltexteditor.h @@ -21,8 +21,8 @@ #include <kdialogbase.h> -class QFont; -class QColor; +class TQFont; +class TQColor; namespace Kivio { @@ -34,21 +34,22 @@ class StencilTextEditorUI; class StencilTextEditor : public KDialogBase { Q_OBJECT + TQ_OBJECT public: - StencilTextEditor(const QString& caption, QWidget *parent = 0, const char *name = 0); + StencilTextEditor(const TQString& caption, TQWidget *tqparent = 0, const char *name = 0); ~StencilTextEditor(); - void setFont(const QFont& font); - void setFontColor(const QColor& color); - void setBackgroundColor(const QColor& color); + void setFont(const TQFont& font); + void setFontColor(const TQColor& color); + void setBackgroundColor(const TQColor& color); - QFont font() const; - QColor fontColor() const; - Qt::AlignmentFlags horizontalAlignment() const; - Qt::AlignmentFlags verticalAlignment() const; + TQFont font() const; + TQColor fontColor() const; + TQt::AlignmentFlags horizontalAlignment() const; + TQt::AlignmentFlags verticalAlignment() const; - void setText(const QString& text); - QString text() const; + void setText(const TQString& text); + TQString text() const; public slots: void setHorizontalAlign(int flag); diff --git a/kivio/plugins/kiviotexttool/tool_text.cpp b/kivio/plugins/kiviotexttool/tool_text.cpp index 8b7e52e7..645a79a4 100644 --- a/kivio/plugins/kiviotexttool/tool_text.cpp +++ b/kivio/plugins/kiviotexttool/tool_text.cpp @@ -19,7 +19,7 @@ */ #include "tool_text.h" -#include <qcursor.h> +#include <tqcursor.h> #include <kiconloader.h> #include <kstandarddirs.h> #include <kdebug.h> @@ -46,17 +46,17 @@ #include "stenciltexteditor.h" -TextTool::TextTool( KivioView* parent ) : Kivio::MouseTool(parent, "Text Mouse Tool") +TextTool::TextTool( KivioView* tqparent ) : Kivio::MouseTool(tqparent, "Text Mouse Tool") { m_textAction = new Kivio::MouseToolAction( i18n("Text Tool"), "text", Key_F2, actionCollection(), "text" ); - connect(m_textAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); - connect(m_textAction, SIGNAL(doubleClicked()), this, SLOT(makePermanent())); + connect(m_textAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); + connect(m_textAction, TQT_SIGNAL(doubleClicked()), this, TQT_SLOT(makePermanent())); m_permanent = false; m_mode = stmNone; - QPixmap pix = BarIcon("kivio_text_cursor",KivioFactory::global()); - m_pTextCursor = new QCursor(pix,2,2); + TQPixmap pix = BarIcon("kivio_text_cursor",KivioFactory::global()); + m_pTextCursor = new TQCursor(pix,2,2); } TextTool::~TextTool() @@ -71,22 +71,22 @@ TextTool::~TextTool() * @param e The event to be identified and processed * */ -bool TextTool::processEvent(QEvent* e) +bool TextTool::processEvent(TQEvent* e) { switch (e->type()) { - case QEvent::MouseButtonPress: - mousePress( (QMouseEvent*)e ); + case TQEvent::MouseButtonPress: + mousePress( (TQMouseEvent*)e ); return true; break; - case QEvent::MouseButtonRelease: - mouseRelease( (QMouseEvent*)e ); + case TQEvent::MouseButtonRelease: + mouseRelease( (TQMouseEvent*)e ); return true; break; - case QEvent::MouseMove: - mouseMove( (QMouseEvent*)e ); + case TQEvent::MouseMove: + mouseMove( (TQMouseEvent*)e ); return true; break; @@ -110,11 +110,11 @@ void TextTool::setActivated(bool a) } } -void TextTool::text(QRect r) +void TextTool::text(TQRect r) { // Calculate the start and end clicks in terms of page coordinates - KoPoint startPoint = view()->canvasWidget()->mapFromScreen( QPoint( r.x(), r.y() ) ); - KoPoint releasePoint = view()->canvasWidget()->mapFromScreen( QPoint( r.x() + r.width(), r.y() + r.height() ) ); + KoPoint startPoint = view()->canvasWidget()->mapFromScreen( TQPoint( r.x(), r.y() ) ); + KoPoint releasePoint = view()->canvasWidget()->mapFromScreen( TQPoint( r.x() + r.width(), r.y() + r.height() ) ); // Calculate the x,y position of the textion box float x = startPoint.x() < releasePoint.x() ? startPoint.x() : releasePoint.x(); @@ -162,9 +162,9 @@ void TextTool::text(QRect r) } } -void TextTool::mousePress( QMouseEvent *e ) +void TextTool::mousePress( TQMouseEvent *e ) { - if(e->button() == LeftButton) { + if(e->button() == Qt::LeftButton) { KoPoint pagePoint = view()->canvasWidget()->mapFromScreen(e->pos()); int colType; KivioPage *page = view()->activePage(); @@ -182,16 +182,16 @@ void TextTool::mousePress( QMouseEvent *e ) /** * Tests if we should start rubber banding (always returns true). */ -bool TextTool::startRubberBanding( QMouseEvent *e ) +bool TextTool::startRubberBanding( TQMouseEvent *e ) { view()->canvasWidget()->startRectDraw( e->pos(), KivioCanvas::Rubber ); - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); m_startPoint = e->pos(); return true; } -void TextTool::mouseMove( QMouseEvent * e ) +void TextTool::mouseMove( TQMouseEvent * e ) { switch( m_mode ) { @@ -204,12 +204,12 @@ void TextTool::mouseMove( QMouseEvent * e ) } } -void TextTool::continueRubberBanding( QMouseEvent *e ) +void TextTool::continueRubberBanding( TQMouseEvent *e ) { view()->canvasWidget()->continueRectDraw( e->pos(), KivioCanvas::Rubber ); } -void TextTool::mouseRelease( QMouseEvent *e ) +void TextTool::mouseRelease( TQMouseEvent *e ) { m_releasePoint = e->pos(); @@ -222,14 +222,14 @@ void TextTool::mouseRelease( QMouseEvent *e ) m_mode = stmNone; - view()->canvasWidget()->repaint(); + view()->canvasWidget()->tqrepaint(); } -void TextTool::endRubberBanding(QMouseEvent */*e*/) +void TextTool::endRubberBanding(TQMouseEvent */*e*/) { // End the rubber-band drawing view()->canvasWidget()->endRectDraw(); - QRect rect; + TQRect rect; if( m_startPoint != m_releasePoint ) { rect = view()->canvasWidget()->rect(); @@ -246,7 +246,7 @@ void TextTool::endRubberBanding(QMouseEvent */*e*/) } } -void TextTool::applyToolAction(QPtrList<KivioStencil>* stencils) +void TextTool::applyToolAction(TQPtrList<KivioStencil>* stencils) { if(stencils->isEmpty()) { return; @@ -273,21 +273,21 @@ void TextTool::applyToolAction(QPtrList<KivioStencil>* stencils) editor.setFontColor(stencil->textColor()); editor.setBackgroundColor(stencil->bgColor()); editor.setText(stencil->text()); - editor.setHorizontalAlign(static_cast<Qt::AlignmentFlags>(stencil->hTextAlign())); - editor.setVerticalAlign(static_cast<Qt::AlignmentFlags>(stencil->vTextAlign())); + editor.setHorizontalAlign(static_cast<TQt::AlignmentFlags>(stencil->hTextAlign())); + editor.setVerticalAlign(static_cast<TQt::AlignmentFlags>(stencil->vTextAlign())); - if(editor.exec() == QDialog::Accepted) { + if(editor.exec() == TQDialog::Accepted) { KMacroCommand* macroCmd = new KMacroCommand(i18n("Change Stencil Text and Formatting")); bool changed = false; - QString text = editor.text(); - QFont font = editor.font(); - QColor textColor = editor.fontColor(); - int halignment = editor.horizontalAlignment(); - int valignment = editor.verticalAlignment(); + TQString text = editor.text(); + TQFont font = editor.font(); + TQColor textColor = editor.fontColor(); + int htqalignment = editor.horizontalAlignment(); + int vtqalignment = editor.verticalAlignment(); bool changeFont = (stencil->textFont() != font); bool changeTextColor = (stencil->textColor() != textColor); - bool changeHAlignment = (stencil->hTextAlign() != halignment); - bool changeVAlignment = (stencil->vTextAlign() != valignment); + bool changeHAlignment = (stencil->hTextAlign() != htqalignment); + bool changeVAlignment = (stencil->vTextAlign() != vtqalignment); while( stencil ) @@ -317,18 +317,18 @@ void TextTool::applyToolAction(QPtrList<KivioStencil>* stencils) changed = true; } - if(changeHAlignment && (stencil->hTextAlign() != halignment)) { + if(changeHAlignment && (stencil->hTextAlign() != htqalignment)) { KivioChangeStencilHAlignmentCommand* cmd = new KivioChangeStencilHAlignmentCommand( - i18n("Change Stencil Horizontal Alignment"), view()->activePage(), stencil, stencil->hTextAlign(), halignment); - stencil->setHTextAlign(halignment); + i18n("Change StencilQt::Horizontal Alignment"), view()->activePage(), stencil, stencil->hTextAlign(), htqalignment); + stencil->setHTextAlign(htqalignment); macroCmd->addCommand(cmd); changed = true; } - if(changeVAlignment && (stencil->vTextAlign() != valignment)) { + if(changeVAlignment && (stencil->vTextAlign() != vtqalignment)) { KivioChangeStencilVAlignmentCommand* cmd = new KivioChangeStencilVAlignmentCommand( - i18n("Change Stencil Vertical Alignment"), view()->activePage(), stencil, stencil->vTextAlign(), valignment); - stencil->setVTextAlign(valignment); + i18n("Change StencilQt::Vertical Alignment"), view()->activePage(), stencil, stencil->vTextAlign(), vtqalignment); + stencil->setVTextAlign(vtqalignment); macroCmd->addCommand(cmd); changed = true; } @@ -351,7 +351,7 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) return; } - QString name = stencil->getTextBoxName(pos); + TQString name = stencil->getTextBoxName(pos); if(name.isEmpty()) { return; @@ -362,13 +362,13 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) editor.setFontColor(stencil->textColor(name)); editor.setBackgroundColor(stencil->bgColor()); editor.setText(stencil->text(name)); - editor.setHorizontalAlign(static_cast<Qt::AlignmentFlags>(stencil->hTextAlign(name))); - editor.setVerticalAlign(static_cast<Qt::AlignmentFlags>(stencil->vTextAlign(name))); + editor.setHorizontalAlign(static_cast<TQt::AlignmentFlags>(stencil->hTextAlign(name))); + editor.setVerticalAlign(static_cast<TQt::AlignmentFlags>(stencil->vTextAlign(name))); - if(editor.exec() == QDialog::Accepted) { + if(editor.exec() == TQDialog::Accepted) { KMacroCommand* macroCmd = new KMacroCommand(i18n("Change Stencil Text and Formatting")); bool changed = false; - QString text = editor.text(); + TQString text = editor.text(); if(stencil->text(name) != text) { @@ -379,7 +379,7 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) changed = true; } - QFont font = editor.font(); + TQFont font = editor.font(); if(stencil->textFont(name) != font) { KivioChangeStencilFontCommand* cmd = new KivioChangeStencilFontCommand(i18n("Change Stencil Font"), @@ -389,7 +389,7 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) changed = true; } - QColor textColor = editor.fontColor(); + TQColor textColor = editor.fontColor(); if(stencil->textColor(name) != textColor) { KivioChangeStencilColorCommand* cmd = new KivioChangeStencilColorCommand(i18n("Change Stencil Text Color"), @@ -400,24 +400,24 @@ void TextTool::applyToolAction(KivioStencil* stencil, const KoPoint& pos) changed = true; } - int halignment = editor.horizontalAlignment(); + int htqalignment = editor.horizontalAlignment(); - if(stencil->hTextAlign(name) != halignment) { + if(stencil->hTextAlign(name) != htqalignment) { KivioChangeStencilHAlignmentCommand* cmd = new KivioChangeStencilHAlignmentCommand( - i18n("Change Stencil Horizontal Alignment"), view()->activePage(), stencil, - stencil->hTextAlign(name), halignment, name); - stencil->setHTextAlign(name, halignment); + i18n("Change StencilQt::Horizontal Alignment"), view()->activePage(), stencil, + stencil->hTextAlign(name), htqalignment, name); + stencil->setHTextAlign(name, htqalignment); macroCmd->addCommand(cmd); changed = true; } - int valignment = editor.verticalAlignment(); + int vtqalignment = editor.verticalAlignment(); - if(stencil->vTextAlign(name) != valignment) { + if(stencil->vTextAlign(name) != vtqalignment) { KivioChangeStencilVAlignmentCommand* cmd = new KivioChangeStencilVAlignmentCommand( - i18n("Change Stencil Vertical Alignment"), view()->activePage(), stencil, - stencil->vTextAlign(name), valignment, name); - stencil->setVTextAlign(name, valignment); + i18n("Change StencilQt::Vertical Alignment"), view()->activePage(), stencil, + stencil->vTextAlign(name), vtqalignment, name); + stencil->setVTextAlign(name, vtqalignment); macroCmd->addCommand(cmd); changed = true; } diff --git a/kivio/plugins/kiviotexttool/tool_text.h b/kivio/plugins/kiviotexttool/tool_text.h index f5b0bb7b..1bc43bb9 100644 --- a/kivio/plugins/kiviotexttool/tool_text.h +++ b/kivio/plugins/kiviotexttool/tool_text.h @@ -22,8 +22,8 @@ #include "kivio_mousetool.h" #include <koffice_export.h> -class QMouseEvent; -class QCursor; +class TQMouseEvent; +class TQCursor; namespace Kivio { class MouseToolAction; @@ -36,17 +36,18 @@ class KoPoint; class KIVIO_EXPORT TextTool : public Kivio::MouseTool { Q_OBJECT + TQ_OBJECT public: - TextTool( KivioView* parent ); + TextTool( KivioView* tqparent ); ~TextTool(); - virtual bool processEvent(QEvent* e); + virtual bool processEvent(TQEvent* e); - void text(QRect); + void text(TQRect); public slots: virtual void setActivated(bool a); - virtual void applyToolAction(QPtrList<KivioStencil>* stencils); + virtual void applyToolAction(TQPtrList<KivioStencil>* stencils); virtual void applyToolAction(KivioStencil* stencil, const KoPoint& pos); protected slots: @@ -56,17 +57,17 @@ class KIVIO_EXPORT TextTool : public Kivio::MouseTool void operationDone(); protected: - void mousePress(QMouseEvent *); - void mouseMove(QMouseEvent *); - void mouseRelease(QMouseEvent *); + void mousePress(TQMouseEvent *); + void mouseMove(TQMouseEvent *); + void mouseRelease(TQMouseEvent *); - bool startRubberBanding(QMouseEvent*); - void continueRubberBanding(QMouseEvent *); - void endRubberBanding(QMouseEvent *); + bool startRubberBanding(TQMouseEvent*); + void continueRubberBanding(TQMouseEvent *); + void endRubberBanding(TQMouseEvent *); - QPoint m_startPoint, m_releasePoint; + TQPoint m_startPoint, m_releasePoint; // Text Tool Mode enum @@ -78,7 +79,7 @@ class KIVIO_EXPORT TextTool : public Kivio::MouseTool private: // Flag to indicate that we are drawing a rubber band int m_mode; - QCursor* m_pTextCursor; + TQCursor* m_pTextCursor; Kivio::MouseToolAction* m_textAction; bool m_permanent; }; diff --git a/kivio/plugins/kiviozoomtool/plugin.cpp b/kivio/plugins/kiviozoomtool/plugin.cpp index af26c8da..6248e432 100644 --- a/kivio/plugins/kiviozoomtool/plugin.cpp +++ b/kivio/plugins/kiviozoomtool/plugin.cpp @@ -31,8 +31,8 @@ K_EXPORT_COMPONENT_FACTORY( libkiviozoomtool, ZoomToolFactory ) KInstance* ZoomToolFactory::s_global = 0; -ZoomToolFactory::ZoomToolFactory( QObject* parent, const char* name ) -: KLibFactory( parent, name ) +ZoomToolFactory::ZoomToolFactory( TQObject* tqparent, const char* name ) +: KLibFactory( tqparent, name ) { s_global = new KInstance("kivio"); } @@ -42,12 +42,12 @@ ZoomToolFactory::~ZoomToolFactory() delete s_global; } -QObject* ZoomToolFactory::createObject( QObject* parent, const char*, const char*, const QStringList& ) +TQObject* ZoomToolFactory::createObject( TQObject* tqparent, const char*, const char*, const TQStringList& ) { - if ( !parent->inherits("KivioView") ) + if ( !tqparent->inherits("KivioView") ) return 0; - QObject* obj = new ZoomTool( (KivioView*)parent ); + TQObject* obj = new ZoomTool( (KivioView*)tqparent ); return obj; } diff --git a/kivio/plugins/kiviozoomtool/plugin.h b/kivio/plugins/kiviozoomtool/plugin.h index e24fd094..42ceb091 100644 --- a/kivio/plugins/kiviozoomtool/plugin.h +++ b/kivio/plugins/kiviozoomtool/plugin.h @@ -19,8 +19,8 @@ #ifndef ZOOM_PLUGIN_H #define ZOOM_PLUGIN_H -#include <qstringlist.h> -#include <qobject.h> +#include <tqstringlist.h> +#include <tqobject.h> #include <klibloader.h> @@ -28,12 +28,13 @@ class KInstance; class ZoomToolFactory : public KLibFactory { Q_OBJECT + TQ_OBJECT public: - ZoomToolFactory( QObject* parent = 0, const char* name = 0 ); + ZoomToolFactory( TQObject* tqparent = 0, const char* name = 0 ); ~ZoomToolFactory(); - virtual QObject* createObject( QObject* parent = 0, const char* name = 0, - const char* classname = "QObject", const QStringList &args = QStringList() ); + virtual TQObject* createObject( TQObject* tqparent = 0, const char* name = 0, + const char* classname = TQOBJECT_OBJECT_NAME_STRING, const TQStringList &args = TQStringList() ); static KInstance* global(); private: diff --git a/kivio/plugins/kiviozoomtool/tool_zoom.cpp b/kivio/plugins/kiviozoomtool/tool_zoom.cpp index aa3e8a2d..f690c9f3 100644 --- a/kivio/plugins/kiviozoomtool/tool_zoom.cpp +++ b/kivio/plugins/kiviozoomtool/tool_zoom.cpp @@ -35,10 +35,10 @@ #include <kstdaction.h> #include <KoZoomAction.h> -#include <qapplication.h> -#include <qcursor.h> +#include <tqapplication.h> +#include <tqcursor.h> -ZoomTool::ZoomTool(KivioView* parent) : Kivio::MouseTool(parent, "Zoom Mouse Tool") +ZoomTool::ZoomTool(KivioView* tqparent) : Kivio::MouseTool(tqparent, "Zoom Mouse Tool") { m_zoomAction = new KRadioAction(i18n("&Zoom"), "viewmag", CTRL + ALT + Key_Z, actionCollection(), "zoom"); m_zoomAction->setWhatsThis(i18n("By pressing this button you can zoom in on a specific area.")); @@ -46,52 +46,52 @@ ZoomTool::ZoomTool(KivioView* parent) : Kivio::MouseTool(parent, "Zoom Mouse Too m_panAction->setWhatsThis(i18n("You can drag the document by using the mouse.")); m_zoomAction->setExclusiveGroup("zoomAction"); m_panAction->setExclusiveGroup("zoomAction"); - connect(m_zoomAction,SIGNAL(activated()),SLOT(zoomActivated())); - connect(m_panAction,SIGNAL(activated()),SLOT(handActivated())); - connect(m_zoomAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); - connect(m_panAction, SIGNAL(toggled(bool)), this, SLOT(setActivated(bool))); + connect(m_zoomAction,TQT_SIGNAL(activated()),TQT_SLOT(zoomActivated())); + connect(m_panAction,TQT_SIGNAL(activated()),TQT_SLOT(handActivated())); + connect(m_zoomAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); + connect(m_panAction, TQT_SIGNAL(toggled(bool)), this, TQT_SLOT(setActivated(bool))); KoZoomAction* viewZoom = new KoZoomAction(i18n("Zoom &Level"), "viewmag", 0, actionCollection(), "viewZoom" ); viewZoom->setWhatsThis(i18n("This allows you to zoom in or out of a document. You can either choose one of the predefined zoomfactors or enter a new zoomfactor (in percent).")); - connect(viewZoom, SIGNAL(zoomChanged(const QString&)), parent, SLOT(viewZoom(const QString&))); - connect(parent, SIGNAL(zoomChanged(int)), viewZoom, SLOT(setZoom(int))); + connect(viewZoom, TQT_SIGNAL(zoomChanged(const TQString&)), tqparent, TQT_SLOT(viewZoom(const TQString&))); + connect(tqparent, TQT_SIGNAL(zoomChanged(int)), viewZoom, TQT_SLOT(setZoom(int))); - m_pPlus = KStdAction::zoomIn(this, SLOT(zoomPlus()), actionCollection(), "zoomPlus"); + m_pPlus = KStdAction::zoomIn(this, TQT_SLOT(zoomPlus()), actionCollection(), "zoomPlus"); m_pPlus->setWhatsThis(i18n("You can zoom in on the document by pressing this button.")); - m_pMinus = KStdAction::zoomOut(this, SLOT(zoomMinus()), actionCollection(), "zoomMinus"); + m_pMinus = KStdAction::zoomOut(this, TQT_SLOT(zoomMinus()), actionCollection(), "zoomMinus"); m_pMinus->setWhatsThis(i18n("By pressing this button you can zoom out of the document.")); m_pZoomWidth = new KAction( i18n("Zoom Width"), "kivio_zoom_width", SHIFT+Key_F4, actionCollection(), "zoomWidth" ); m_pZoomWidth->setWhatsThis(i18n("You can zoom the document that it fits into the window width.")); - connect(m_pZoomWidth,SIGNAL(activated()),SLOT(zoomWidth())); + connect(m_pZoomWidth,TQT_SIGNAL(activated()),TQT_SLOT(zoomWidth())); m_pZoomHeight = new KAction( i18n("Zoom Height"), "kivio_zoom_height", SHIFT+Key_F5, actionCollection(), "zoomHeight" ); m_pZoomHeight->setWhatsThis(i18n("You can zoom the document that it fits into the window height.")); - connect(m_pZoomHeight,SIGNAL(activated()),SLOT(zoomHeight())); + connect(m_pZoomHeight,TQT_SIGNAL(activated()),TQT_SLOT(zoomHeight())); m_pZoomPage = new KAction( i18n("Zoom Page"), "kivio_zoom_page", SHIFT+Key_F6, actionCollection(), "zoomPage" ); m_pZoomPage->setWhatsThis(i18n("The Zoom Page button shows the entire page.")); - connect(m_pZoomPage,SIGNAL(activated()),SLOT(zoomPage())); + connect(m_pZoomPage,TQT_SIGNAL(activated()),TQT_SLOT(zoomPage())); m_pZoomSelected = new KAction( i18n("Zoom Selected"), "kivio_zoom_selected", CTRL+Key_Y, actionCollection(), "zoomSelected" ); m_pZoomSelected->setWhatsThis(i18n("By pressing this button you zoom in on the document, so that all <b>selected</b> objects are visible.")); - connect(m_pZoomSelected,SIGNAL(activated()),SLOT(zoomSelected())); + connect(m_pZoomSelected,TQT_SIGNAL(activated()),TQT_SLOT(zoomSelected())); m_pZoomAllObjects = new KAction( i18n("Zoom All Objects"), "kivio_zoom_allobject", 0, actionCollection(), "zoomAllObjects" ); m_pZoomAllObjects->setWhatsThis(i18n("You are able to zoom in on the document, so that all objects are visible by pressing this button.")); - connect(m_pZoomAllObjects,SIGNAL(activated()),SLOT(zoomAllobjects())); + connect(m_pZoomAllObjects,TQT_SIGNAL(activated()),TQT_SLOT(zoomAllobjects())); - QPixmap pix; + TQPixmap pix; pix = BarIcon("kivio_zoom_plus",KivioFactory::global()); - m_pPlusCursor = new QCursor(pix,pix.width()/2,pix.height()/2); + m_pPlusCursor = new TQCursor(pix,pix.width()/2,pix.height()/2); pix = BarIcon("kivio_zoom_minus",KivioFactory::global()); - m_pMinusCursor = new QCursor(pix,pix.width()/2,pix.height()/2); + m_pMinusCursor = new TQCursor(pix,pix.width()/2,pix.height()/2); pix = BarIcon("kivio_zoom_hand",KivioFactory::global()); - m_handCursor = new QCursor(pix,pix.width()/2,pix.height()/2); + m_handCursor = new TQCursor(pix,pix.width()/2,pix.height()/2); m_pMenu = 0; } @@ -103,31 +103,31 @@ ZoomTool::~ZoomTool() delete m_handCursor; } -bool ZoomTool::processEvent(QEvent* e) +bool ZoomTool::processEvent(TQEvent* e) { KivioCanvas* canvas = view()->canvasWidget(); if(!m_bHandMode) { switch(e->type()) { - case QEvent::KeyPress: - if (!m_bLockKeyboard && (static_cast<QKeyEvent*>(e)->key() == Key_Shift)) { + case TQEvent::KeyPress: + if (!m_bLockKeyboard && (TQT_TQKEYEVENT(e)->key() == Key_Shift)) { m_pCurrent = m_pMinus; canvas->setCursor(*m_pMinusCursor); return true; } break; - case QEvent::KeyRelease: - if (!m_bLockKeyboard && (static_cast<QKeyEvent*>(e)->key() == Key_Shift)) { + case TQEvent::KeyRelease: + if (!m_bLockKeyboard && (TQT_TQKEYEVENT(e)->key() == Key_Shift)) { m_pCurrent = m_pPlus; canvas->setCursor(*m_pPlusCursor); return true; } break; - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: { - QMouseEvent* me = static_cast<QMouseEvent*>(e); + TQMouseEvent* me = TQT_TQMOUSEEVENT(e); - if(me->button() == LeftButton) { + if(me->button() == Qt::LeftButton) { if(m_pCurrent == m_pMinus) { m_pCurrent->activate(); } else { @@ -142,7 +142,7 @@ bool ZoomTool::processEvent(QEvent* e) return true; break; } - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: if(m_pCurrent == m_pPlus && m_bDrawRubber) { canvas->endRectDraw(); m_bDrawRubber = false; @@ -151,9 +151,9 @@ bool ZoomTool::processEvent(QEvent* e) return true; } break; - case QEvent::MouseMove: + case TQEvent::MouseMove: if (m_bDrawRubber) { - canvas->continueRectDraw(static_cast<QMouseEvent*>(e)->pos(), KivioCanvas::Rubber); + canvas->continueRectDraw(TQT_TQMOUSEEVENT(e)->pos(), KivioCanvas::Rubber); return true; } break; @@ -162,19 +162,19 @@ bool ZoomTool::processEvent(QEvent* e) } } else { switch(e->type()) { - case QEvent::MouseButtonPress: + case TQEvent::MouseButtonPress: isHandMousePressed = true; - mousePos = static_cast<QMouseEvent*>(e)->pos(); + mousePos = TQT_TQMOUSEEVENT(e)->pos(); return true; break; - case QEvent::MouseButtonRelease: + case TQEvent::MouseButtonRelease: isHandMousePressed = false; return true; break; - case QEvent::MouseMove: + case TQEvent::MouseMove: if (isHandMousePressed) { canvas->setUpdatesEnabled(false); - QPoint newPos = static_cast<QMouseEvent*>(e)->pos(); + TQPoint newPos = TQT_TQMOUSEEVENT(e)->pos(); mousePos -= newPos; canvas->scrollDx(-mousePos.x()); canvas->scrollDy(-mousePos.y()); @@ -234,7 +234,7 @@ void ZoomTool::handActivated() void ZoomTool::zoomPlus() { KivioCanvas* canvas = view()->canvasWidget(); - canvas->zoomIn(QPoint(canvas->width()/2, canvas->height()/2)); + canvas->zoomIn(TQPoint(canvas->width()/2, canvas->height()/2)); if(view()->zoomHandler()->zoom() >= 2000) { m_pPlus->setEnabled(false); @@ -250,7 +250,7 @@ void ZoomTool::zoomPlus() void ZoomTool::zoomMinus() { KivioCanvas* canvas = view()->canvasWidget(); - canvas->zoomOut(QPoint(canvas->width()/2, canvas->height()/2)); + canvas->zoomOut(TQPoint(canvas->width()/2, canvas->height()/2)); if(view()->zoomHandler()->zoom() <= 25) { m_pMinus->setEnabled(false); @@ -269,13 +269,13 @@ void ZoomTool::zoomWidth() KoZoomHandler zoom; zoom.setZoomAndResolution(100, KoGlobal::dpiX(), KoGlobal::dpiY()); - int cw = QMAX(10,canvas->width()-20); + int cw = TQMAX(10,canvas->width()-20); KoPageLayout pl = canvas->activePage()->paperLayout(); float w = zoom.zoomItX(pl.ptWidth); float z = cw/w; canvas->setUpdatesEnabled(false); - view()->viewZoom(qRound(z * 100)); + view()->viewZoom(tqRound(z * 100)); canvas->setUpdatesEnabled(true); } @@ -285,13 +285,13 @@ void ZoomTool::zoomHeight() KoZoomHandler zoom; zoom.setZoomAndResolution(100, KoGlobal::dpiX(), KoGlobal::dpiY()); - int ch = QMAX(10,canvas->height()-20); + int ch = TQMAX(10,canvas->height()-20); KoPageLayout pl = canvas->activePage()->paperLayout(); float h = zoom.zoomItY(pl.ptHeight); float zh = ch/h; canvas->setUpdatesEnabled(false); - view()->viewZoom(qRound(zh * 100)); + view()->viewZoom(tqRound(zh * 100)); canvas->setUpdatesEnabled(true); } @@ -301,21 +301,21 @@ void ZoomTool::zoomPage() KoZoomHandler zoom; zoom.setZoomAndResolution(100, KoGlobal::dpiX(), KoGlobal::dpiY()); - int cw = QMAX(10,canvas->width()-20); - int ch = QMAX(10,canvas->height()-20); + int cw = TQMAX(10,canvas->width()-20); + int ch = TQMAX(10,canvas->height()-20); KoPageLayout pl = canvas->activePage()->paperLayout(); float w = zoom.zoomItX(pl.ptWidth); float h = zoom.zoomItY(pl.ptHeight); - float z = QMIN(cw/w,ch/h); + float z = TQMIN(cw/w,ch/h); canvas->setUpdatesEnabled(false); - view()->viewZoom(qRound(z * 100)); + view()->viewZoom(tqRound(z * 100)); canvas->setUpdatesEnabled(true); } -void ZoomTool::showPopupMenu(const QPoint& p ) +void ZoomTool::showPopupMenu(const TQPoint& p ) { if(!m_pMenu) { m_pMenu = static_cast<KPopupMenu*>(factory()->container("ZoomPopup", this)); @@ -348,7 +348,7 @@ void ZoomTool::zoomAllobjects() } } -void ZoomTool::zoomRect(QRect r) +void ZoomTool::zoomRect(TQRect r) { KivioCanvas* canvas = view()->canvasWidget(); diff --git a/kivio/plugins/kiviozoomtool/tool_zoom.h b/kivio/plugins/kiviozoomtool/tool_zoom.h index 97c6ebcd..15700f75 100644 --- a/kivio/plugins/kiviozoomtool/tool_zoom.h +++ b/kivio/plugins/kiviozoomtool/tool_zoom.h @@ -29,18 +29,19 @@ class KPopupMenu; class KRadioAction; class KAction; -class QCursor; +class TQCursor; class ZoomTool : public Kivio::MouseTool { Q_OBJECT + TQ_OBJECT public: - ZoomTool(KivioView* parent); + ZoomTool(KivioView* tqparent); virtual ~ZoomTool(); - virtual bool processEvent(QEvent* e); + virtual bool processEvent(TQEvent* e); - void zoomRect(QRect); + void zoomRect(TQRect); public slots: void zoomActivated(); @@ -57,7 +58,7 @@ class ZoomTool : public Kivio::MouseTool virtual void setActivated(bool a); protected: - void showPopupMenu(const QPoint&); + void showPopupMenu(const TQPoint&); signals: void operationDone(); @@ -78,15 +79,15 @@ class ZoomTool : public Kivio::MouseTool KAction* m_pCurrent; - QCursor* m_pPlusCursor; - QCursor* m_pMinusCursor; - QCursor* m_handCursor; + TQCursor* m_pPlusCursor; + TQCursor* m_pMinusCursor; + TQCursor* m_handCursor; bool m_bDrawRubber; bool m_bHandMode; bool isHandMousePressed; bool m_bLockKeyboard; - QPoint mousePos; + TQPoint mousePos; }; #endif |