summaryrefslogtreecommitdiffstats
path: root/src/gui/general/RosegardenScrollView.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
commit11f31c37e5fa4889d9989f10272f44845449cb7b (patch)
tree4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/general/RosegardenScrollView.cpp
parent832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff)
downloadrosegarden-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/RosegardenScrollView.cpp')
-rw-r--r--src/gui/general/RosegardenScrollView.cpp66
1 files changed, 33 insertions, 33 deletions
diff --git a/src/gui/general/RosegardenScrollView.cpp b/src/gui/general/RosegardenScrollView.cpp
index fbcaf79..c3184da 100644
--- a/src/gui/general/RosegardenScrollView.cpp
+++ b/src/gui/general/RosegardenScrollView.cpp
@@ -26,15 +26,15 @@
#include "RosegardenScrollView.h"
#include "misc/Debug.h"
-#include <qapplication.h>
-#include <qcursor.h>
-#include <qpoint.h>
-#include <qrect.h>
-#include <qscrollbar.h>
-#include <qscrollview.h>
-#include <qsizepolicy.h>
-#include <qtimer.h>
-#include <qwidget.h>
+#include <tqapplication.h>
+#include <tqcursor.h>
+#include <tqpoint.h>
+#include <tqrect.h>
+#include <tqscrollbar.h>
+#include <tqscrollview.h>
+#include <tqsizepolicy.h>
+#include <tqtimer.h>
+#include <tqwidget.h>
namespace Rosegarden
@@ -49,9 +49,9 @@ const int RosegardenScrollView::InitialScrollAccel = 5;
const int RosegardenScrollView::MaxScrollDelta = 100; // max a.scroll speed
const double RosegardenScrollView::ScrollAccelValue = 1.04;// acceleration rate
-RosegardenScrollView::RosegardenScrollView(QWidget* parent,
+RosegardenScrollView::RosegardenScrollView(TQWidget* parent,
const char* name, WFlags f)
- : QScrollView(parent, name, f),
+ : TQScrollView(parent, name, f),
m_bottomWidget(0),
m_currentBottomWidgetHeight( -1),
m_smoothScroll(true),
@@ -66,16 +66,16 @@ RosegardenScrollView::RosegardenScrollView(QWidget* parent,
m_autoScrolling(false)
{
setDragAutoScroll(true);
- connect( &m_autoScrollTimer, SIGNAL( timeout() ),
- this, SLOT( doAutoScroll() ) );
+ connect( &m_autoScrollTimer, TQT_SIGNAL( timeout() ),
+ this, TQT_SLOT( doAutoScroll() ) );
}
-void RosegardenScrollView::setBottomFixedWidget(QWidget* w)
+void RosegardenScrollView::setBottomFixedWidget(TQWidget* w)
{
m_bottomWidget = w;
if (m_bottomWidget) {
- 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(0, 0, 0, m_bottomWidget->sizeHint().height());
}
}
@@ -90,7 +90,7 @@ void RosegardenScrollView::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;
@@ -118,8 +118,8 @@ void RosegardenScrollView::doAutoScroll()
{
// RG_DEBUG << "RosegardenScrollView::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 );
@@ -184,8 +184,8 @@ const double RosegardenScrollView::DefaultMinDeltaScroll = 1.2;
bool RosegardenScrollView::isTimeForSmoothScroll()
{
- static int desktopWidth = QApplication::desktop()->width(),
- desktopHeight = QApplication::desktop()->height();
+ static int desktopWidth = TQApplication::desktop()->width(),
+ desktopHeight = TQApplication::desktop()->height();
if (m_smoothScroll) {
int ta = m_scrollAccelerationTimer.elapsed();
@@ -220,7 +220,7 @@ bool RosegardenScrollView::isTimeForSmoothScroll()
void RosegardenScrollView::slotScrollHoriz(int hpos)
{
- QScrollBar* hbar = getMainHorizontalScrollBar();
+ TQScrollBar* hbar = getMainHorizontalScrollBar();
int currentContentYPos = contentsY();
/* Lots of performance hitting debug
@@ -262,7 +262,7 @@ void RosegardenScrollView::slotScrollHoriz(int hpos)
void RosegardenScrollView::slotScrollHorizSmallSteps(int hpos)
{
- QScrollBar* hbar = getMainHorizontalScrollBar();
+ TQScrollBar* hbar = getMainHorizontalScrollBar();
int currentContentYPos = contentsY();
int diff = 0;
@@ -301,7 +301,7 @@ void RosegardenScrollView::slotScrollHorizSmallSteps(int hpos)
void RosegardenScrollView::slotScrollVertSmallSteps(int vpos)
{
- QScrollBar* vbar = verticalScrollBar();
+ TQScrollBar* vbar = verticalScrollBar();
// RG_DEBUG << "RosegardenCanvasView::slotScrollVertSmallSteps: vpos is " << vpos << ", contentsY is " << contentsY() << ", visibleHeight is " << visibleHeight() << endl;
@@ -344,30 +344,30 @@ void RosegardenScrollView::slotScrollVertSmallSteps(int vpos)
void RosegardenScrollView::slotScrollVertToTop(int vpos)
{
- QScrollBar* vbar = verticalScrollBar();
+ TQScrollBar* vbar = verticalScrollBar();
if (vpos < visibleHeight() / 3)
vbar->setValue(0);
else
vbar->setValue(vpos - visibleHeight() / 5);
}
-void RosegardenScrollView::slotSetScrollPos(const QPoint &pos)
+void RosegardenScrollView::slotSetScrollPos(const TQPoint &pos)
{
horizontalScrollBar()->setValue(pos.x());
verticalScrollBar()->setValue(pos.y());
}
-void RosegardenScrollView::resizeEvent(QResizeEvent* e)
+void RosegardenScrollView::resizeEvent(TQResizeEvent* e)
{
- QScrollView::resizeEvent(e);
+ TQScrollView::resizeEvent(e);
if (!horizontalScrollBar()->isVisible())
updateBottomWidgetGeometry();
}
-void RosegardenScrollView::setHBarGeometry(QScrollBar &hbar, int x, int y, int w, int h)
+void RosegardenScrollView::setHBarGeometry(TQScrollBar &hbar, int x, int y, int w, int h)
{
- QScrollView::setHBarGeometry(hbar, x, y, w, h);
+ TQScrollView::setHBarGeometry(hbar, x, y, w, h);
updateBottomWidgetGeometry();
}
@@ -379,7 +379,7 @@ void RosegardenScrollView::updateBottomWidgetGeometry()
int bottomWidgetHeight = m_bottomWidget->sizeHint().height();
setMargins(0, 0, 0, bottomWidgetHeight);
- QRect r = frameRect();
+ TQRect r = frameRect();
int hScrollBarHeight = 0;
if (horizontalScrollBar()->isVisible())
hScrollBarHeight = horizontalScrollBar()->height() + 2; // + 2 offset needed to preserve border shadow
@@ -400,7 +400,7 @@ void RosegardenScrollView::updateBottomWidgetGeometry()
}
-void RosegardenScrollView::wheelEvent(QWheelEvent *e)
+void RosegardenScrollView::wheelEvent(TQWheelEvent *e)
{
if (e->state() & ControlButton) {
if (e->delta() > 0)
@@ -409,7 +409,7 @@ void RosegardenScrollView::wheelEvent(QWheelEvent *e)
emit zoomOut();
return ;
}
- QScrollView::wheelEvent(e);
+ TQScrollView::wheelEvent(e);
}
}