diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
commit | 11f31c37e5fa4889d9989f10272f44845449cb7b (patch) | |
tree | 4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/general/RosegardenCanvasView.cpp | |
parent | 832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff) | |
download | rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.tar.gz rosegarden-11f31c37e5fa4889d9989f10272f44845449cb7b.zip |
Initial TQt conversion
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/general/RosegardenCanvasView.cpp')
-rw-r--r-- | src/gui/general/RosegardenCanvasView.cpp | 84 |
1 files changed, 42 insertions, 42 deletions
diff --git a/src/gui/general/RosegardenCanvasView.cpp b/src/gui/general/RosegardenCanvasView.cpp index a829aac..4893147 100644 --- a/src/gui/general/RosegardenCanvasView.cpp +++ b/src/gui/general/RosegardenCanvasView.cpp @@ -27,24 +27,24 @@ #include "misc/Debug.h" #include "gui/general/CanvasItemGC.h" -#include <qcanvas.h> -#include <qcursor.h> -#include <qpoint.h> -#include <qrect.h> -#include <qscrollbar.h> -#include <qsize.h> -#include <qsizepolicy.h> -#include <qtimer.h> -#include <qwidget.h> +#include <tqcanvas.h> +#include <tqcursor.h> +#include <tqpoint.h> +#include <tqrect.h> +#include <tqscrollbar.h> +#include <tqsize.h> +#include <tqsizepolicy.h> +#include <tqtimer.h> +#include <tqwidget.h> namespace Rosegarden { -RosegardenCanvasView::RosegardenCanvasView(QCanvas* canvas, - QWidget* parent, +RosegardenCanvasView::RosegardenCanvasView(TQCanvas* canvas, + TQWidget* parent, const char* name, WFlags f) - : QCanvasView(canvas, parent, name, f), + : TQCanvasView(canvas, parent, name, f), m_bottomWidget(0), m_currentBottomWidgetHeight( -1), m_leftWidget(0), @@ -60,33 +60,33 @@ RosegardenCanvasView::RosegardenCanvasView(QCanvas* canvas, m_autoScrolling(false) { setDragAutoScroll(true); - connect( &m_autoScrollTimer, SIGNAL( timeout() ), - this, SLOT( doAutoScroll() ) ); + connect( &m_autoScrollTimer, TQT_SIGNAL( timeout() ), + this, TQT_SLOT( doAutoScroll() ) ); } void RosegardenCanvasView::fitWidthToContents() { - QRect allItemsBoundingRect; + TQRect allItemsBoundingRect; - QCanvasItemList items = canvas()->allItems(); + TQCanvasItemList items = canvas()->allItems(); - QCanvasItemList::Iterator it; + TQCanvasItemList::Iterator it; for (it = items.begin(); it != items.end(); ++it) { allItemsBoundingRect |= (*it)->boundingRect(); } - QSize currentSize = canvas()->size(); + TQSize currentSize = canvas()->size(); resizeContents(allItemsBoundingRect.width(), currentSize.height()); } -void RosegardenCanvasView::setBottomFixedWidget(QWidget* w) +void RosegardenCanvasView::setBottomFixedWidget(TQWidget* w) { m_bottomWidget = w; if (m_bottomWidget) { int lww = m_leftWidget ? m_leftWidget->sizeHint().width() : 0; - m_bottomWidget->reparent(this, 0, QPoint(0, 0)); - m_bottomWidget->setSizePolicy(QSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed)); + m_bottomWidget->reparent(this, 0, TQPoint(0, 0)); + m_bottomWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::Preferred, TQSizePolicy::Fixed)); setMargins(lww, 0, 0, m_bottomWidget->sizeHint().height()); } } @@ -119,7 +119,7 @@ void RosegardenCanvasView::startAutoScroll() m_autoScrollTimer.start( m_autoScrollTime ); } - QPoint autoScrollStartPoint = viewport()->mapFromGlobal( QCursor::pos() ); + TQPoint autoScrollStartPoint = viewport()->mapFromGlobal( TQCursor::pos() ); m_autoScrollYMargin = autoScrollStartPoint.y() / 10; m_autoScrollXMargin = autoScrollStartPoint.x() / 10; @@ -147,8 +147,8 @@ void RosegardenCanvasView::doAutoScroll() { // RG_DEBUG << "RosegardenCanvasView::doAutoScroll()\n"; - QPoint p = viewport()->mapFromGlobal( QCursor::pos() ); - QPoint dp = p - m_previousP; + TQPoint p = viewport()->mapFromGlobal( TQCursor::pos() ); + TQPoint dp = p - m_previousP; m_previousP = p; m_autoScrollTimer.start( m_autoScrollTime ); @@ -243,7 +243,7 @@ bool RosegardenCanvasView::isTimeForSmoothScroll() void RosegardenCanvasView::slotScrollHoriz(int hpos) { - QScrollBar* hbar = getMainHorizontalScrollBar(); + TQScrollBar* hbar = getMainHorizontalScrollBar(); int currentContentYPos = contentsY(); /* Lots of performance hitting debug @@ -285,7 +285,7 @@ void RosegardenCanvasView::slotScrollHoriz(int hpos) void RosegardenCanvasView::slotScrollHorizSmallSteps(int hpos) { - QScrollBar* hbar = getMainHorizontalScrollBar(); + TQScrollBar* hbar = getMainHorizontalScrollBar(); int currentContentYPos = contentsY(); int diff = 0; @@ -324,7 +324,7 @@ void RosegardenCanvasView::slotScrollHorizSmallSteps(int hpos) void RosegardenCanvasView::slotScrollVertSmallSteps(int vpos) { - QScrollBar* vbar = verticalScrollBar(); + TQScrollBar* vbar = verticalScrollBar(); // RG_DEBUG << "RosegardenCanvasView::slotScrollVertSmallSteps: vpos is " << vpos << ", contentsY is " << contentsY() << ", visibleHeight is " << visibleHeight() << endl; @@ -367,30 +367,30 @@ void RosegardenCanvasView::slotScrollVertSmallSteps(int vpos) void RosegardenCanvasView::slotScrollVertToTop(int vpos) { - QScrollBar* vbar = verticalScrollBar(); + TQScrollBar* vbar = verticalScrollBar(); if (vpos < visibleHeight() / 3) vbar->setValue(0); else vbar->setValue(vpos - visibleHeight() / 5); } -void RosegardenCanvasView::slotSetScrollPos(const QPoint &pos) +void RosegardenCanvasView::slotSetScrollPos(const TQPoint &pos) { getMainHorizontalScrollBar()->setValue(pos.x()); verticalScrollBar()->setValue(pos.y()); } -void RosegardenCanvasView::resizeEvent(QResizeEvent* e) +void RosegardenCanvasView::resizeEvent(TQResizeEvent* e) { - QCanvasView::resizeEvent(e); + TQCanvasView::resizeEvent(e); if (!horizontalScrollBar()->isVisible()) updateBottomWidgetGeometry(); updateLeftWidgetGeometry(); } -void RosegardenCanvasView::setHBarGeometry(QScrollBar &hbar, int x, int y, int w, int h) +void RosegardenCanvasView::setHBarGeometry(TQScrollBar &hbar, int x, int y, int w, int h) { - QCanvasView::setHBarGeometry(hbar, x, y, w, h); + TQCanvasView::setHBarGeometry(hbar, x, y, w, h); updateBottomWidgetGeometry(); } @@ -403,14 +403,14 @@ void RosegardenCanvasView::updateBottomWidgetGeometry() int leftWidgetWidth = 0; if (m_leftWidget && m_leftWidget->isVisible()) { - QScrollView * qsv = dynamic_cast<QScrollView *>(m_leftWidget); + TQScrollView * qsv = dynamic_cast<TQScrollView *>(m_leftWidget); leftWidgetWidth = qsv->contentsWidth()+2; qsv->setFixedWidth(leftWidgetWidth); } setMargins(leftWidgetWidth, 0, 0, bottomWidgetHeight); - QRect r = frameRect(); + TQRect r = frameRect(); int hScrollBarHeight = 0; if (horizontalScrollBar()->isVisible()) hScrollBarHeight = horizontalScrollBar()->height() + 2; @@ -431,7 +431,7 @@ void RosegardenCanvasView::updateBottomWidgetGeometry() } } -void RosegardenCanvasView::wheelEvent(QWheelEvent *e) +void RosegardenCanvasView::wheelEvent(TQWheelEvent *e) { if (e->state() & ControlButton) { if (e->delta() > 0) @@ -440,16 +440,16 @@ void RosegardenCanvasView::wheelEvent(QWheelEvent *e) emit zoomOut(); return ; } - QCanvasView::wheelEvent(e); + TQCanvasView::wheelEvent(e); } -void RosegardenCanvasView::setLeftFixedWidget(QWidget* w) +void RosegardenCanvasView::setLeftFixedWidget(TQWidget* w) { m_leftWidget = w; if (m_leftWidget) { int bwh = m_bottomWidget ? m_bottomWidget->sizeHint().height() : 0; - m_leftWidget->reparent(this, 0, QPoint(0, 0)); - m_leftWidget->setSizePolicy(QSizePolicy(QSizePolicy::Fixed, QSizePolicy::Preferred)); + m_leftWidget->reparent(this, 0, TQPoint(0, 0)); + m_leftWidget->setSizePolicy(TQSizePolicy(TQSizePolicy::Fixed, TQSizePolicy::Preferred)); setMargins(m_leftWidget->sizeHint().width(), 0, 0, bwh); } } @@ -461,7 +461,7 @@ void RosegardenCanvasView::updateLeftWidgetGeometry() int leftWidgetWidth = 0; if (m_leftWidget->isVisible()) { - QScrollView * qsv = dynamic_cast<QScrollView *>(m_leftWidget); + TQScrollView * qsv = dynamic_cast<TQScrollView *>(m_leftWidget); leftWidgetWidth = qsv->contentsWidth() + 2; } m_leftWidget->setFixedWidth(leftWidgetWidth); @@ -471,7 +471,7 @@ void RosegardenCanvasView::updateLeftWidgetGeometry() setMargins(leftWidgetWidth, 0, 0, bottomWidgetHeight); - QRect r = frameRect(); + TQRect r = frameRect(); int hScrollBarHeight = 0; if (horizontalScrollBar()->isVisible()) hScrollBarHeight = horizontalScrollBar()->height() + 2; |