diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-29 00:55:34 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-29 00:55:34 +0000 |
commit | c4189d200e71c7ef82e9a6e34935ad225154d658 (patch) | |
tree | f7f29a1159e0402472ff2ab22617a8113f66263c /kbarcode/mycanvasview.h | |
parent | 2f888b1578e65ec1bc514996eb509fcaf34462d6 (diff) | |
download | kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.tar.gz kbarcode-c4189d200e71c7ef82e9a6e34935ad225154d658.zip |
TQt4 port kbarcode
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/kbarcode@1233956 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'kbarcode/mycanvasview.h')
-rw-r--r-- | kbarcode/mycanvasview.h | 76 |
1 files changed, 39 insertions, 37 deletions
diff --git a/kbarcode/mycanvasview.h b/kbarcode/mycanvasview.h index 0922717..e1bfb67 100644 --- a/kbarcode/mycanvasview.h +++ b/kbarcode/mycanvasview.h @@ -18,29 +18,30 @@ #ifndef MYCANVASVIEW_H #define MYCANVASVIEW_H -#include <qcanvas.h> -#include <qvaluelist.h> +#include <tqcanvas.h> +#include <tqvaluelist.h> #include "documentitem.h" class TCanvasItem; -typedef QValueList<TCanvasItem*> TCanvasItemList; +typedef TQValueList<TCanvasItem*> TCanvasItemList; -class QRect; -class QPainter; -class MyCanvas : public QCanvas { +class TQRect; +class TQPainter; +class MyCanvas : public TQCanvas { Q_OBJECT + TQ_OBJECT public: - MyCanvas( QObject* parent, const char* name = 0 ); + MyCanvas( TQObject* tqparent, const char* name = 0 ); ~MyCanvas(); - void setRect( QRect r ) { + void setRect( TQRect r ) { m_rect = r; } - QRect rect() const { + TQRect rect() const { return m_rect; } @@ -51,24 +52,25 @@ class MyCanvas : public QCanvas { bool grid() const { return m_grid; } protected: - void drawBackground( QPainter & painter, const QRect & clip ); + void drawBackground( TQPainter & painter, const TQRect & clip ); private: - QRect m_rect; + TQRect m_rect; bool m_grid; }; class Definition; -class QColor; -class QLabel; -class QPoint; +class TQColor; +class TQLabel; +class TQPoint; class KCommandHistory; class KMacroCommand; class KRuler; class KStatusBar; -class MyCanvasView : public QCanvasView +class MyCanvasView : public TQCanvasView { Q_OBJECT + TQ_OBJECT enum edges { TopLeft, @@ -85,7 +87,7 @@ class MyCanvasView : public QCanvasView }; public: - MyCanvasView( Definition* d, MyCanvas *c, QWidget* parent=0, const char* name=0, WFlags f=0); + MyCanvasView( Definition* d, MyCanvas *c, TQWidget* tqparent=0, const char* name=0, WFlags f=0); ~MyCanvasView(); /** return a list of all DocumentItems on the canvas @@ -95,15 +97,15 @@ class MyCanvasView : public QCanvasView TCanvasItemList getSelected(); TCanvasItem* getActive(); - void setActive( QCanvasItem* item = 0, bool control = false ); + void setActive( TQCanvasItem* item = 0, bool control = false ); - void setCurrent( QCanvasItem* item ); + void setCurrent( TQCanvasItem* item ); void setHistory( KCommandHistory* hist ) { history = hist; } - QPoint getTranslation() const { + TQPoint getTranslation() const { return translation; } @@ -113,10 +115,10 @@ class MyCanvasView : public QCanvasView statusbar = s; } - static int getLowestZ( QCanvasItemList list ); - static int getHighestZ( QCanvasItemList list ); + static int getLowestZ( TQCanvasItemList list ); + static int getHighestZ( TQCanvasItemList list ); - void snapPoint(QPoint* point, TCanvasItem* item) ; + void snapPoint(TQPoint* point, TCanvasItem* item) ; public slots: void selectAll(); @@ -126,24 +128,24 @@ class MyCanvasView : public QCanvasView void updateGUI() { canvas()->update(); - repaintContents(); + tqrepaintContents(); } protected: - void contentsMousePressEvent(QMouseEvent*); - void contentsMouseMoveEvent(QMouseEvent*); - void contentsMouseReleaseEvent(QMouseEvent *); - void contentsMouseDoubleClickEvent(QMouseEvent*); - void resizeEvent( QResizeEvent * r ); + void contentsMousePressEvent(TQMouseEvent*); + void contentsMouseMoveEvent(TQMouseEvent*); + void contentsMouseReleaseEvent(TQMouseEvent *); + void contentsMouseDoubleClickEvent(TQMouseEvent*); + void resizeEvent( TQResizeEvent * r ); signals: void selectionChanged(); void movedSomething(); void doubleClickedItem( TCanvasItem* ); - void showContextMenu( QPoint ); + void showContextMenu( TQPoint ); private: - void setSelected( QCanvasItem* item = 0, bool control = false ); + void setSelected( TQCanvasItem* item = 0, bool control = false ); KMacroCommand* getMoveCommand(); Definition* def; @@ -158,18 +160,18 @@ class MyCanvasView : public QCanvasView int mouseid; KStatusBar* statusbar; - QPoint moving_start; - QPoint translation; + TQPoint moving_start; + TQPoint translation; - QRect old; + TQRect old; - bool isInside( QPoint p, QCanvasItem* item ); - int isEdge( QPoint p, QCanvasItem* item ); + bool isInside( TQPoint p, TQCanvasItem* item ); + int isEdge( TQPoint p, TQCanvasItem* item ); void reposition(); void updateRuler(); - int updateCursor( QPoint pos, bool pressed = false ); + int updateCursor( TQPoint pos, bool pressed = false ); int m_mode; - QPoint delta_pt ; + TQPoint delta_pt ; }; #endif |