summaryrefslogtreecommitdiffstats
path: root/src/gui/editors/notation/NotationCanvasView.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/editors/notation/NotationCanvasView.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/editors/notation/NotationCanvasView.cpp')
-rw-r--r--src/gui/editors/notation/NotationCanvasView.cpp88
1 files changed, 44 insertions, 44 deletions
diff --git a/src/gui/editors/notation/NotationCanvasView.cpp b/src/gui/editors/notation/NotationCanvasView.cpp
index 55e63ac..fb7d2d9 100644
--- a/src/gui/editors/notation/NotationCanvasView.cpp
+++ b/src/gui/editors/notation/NotationCanvasView.cpp
@@ -34,22 +34,22 @@
#include "NotationElement.h"
#include "NotationProperties.h"
#include "NotationStaff.h"
-#include <qcanvas.h>
-#include <qcolor.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qpoint.h>
-#include <qrect.h>
-#include <qsize.h>
-#include <qstring.h>
-#include <qwidget.h>
+#include <tqcanvas.h>
+#include <tqcolor.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqpoint.h>
+#include <tqrect.h>
+#include <tqsize.h>
+#include <tqstring.h>
+#include <tqwidget.h>
namespace Rosegarden
{
NotationCanvasView::NotationCanvasView(const LinedStaffManager &staffmgr,
- QCanvas *viewing, QWidget *parent,
+ TQCanvas *viewing, TQWidget *parent,
const char *name, WFlags f) :
RosegardenCanvasView(viewing, parent, name, f),
m_linedStaffManager(staffmgr),
@@ -74,11 +74,11 @@ NotationCanvasView::NotationCanvasView(const LinedStaffManager &staffmgr,
m_vert1 = new QCanvasLineGroupable(viewing, m_heightMarker);
m_vert1->setPoints(0, 0, 0, 8);
- m_vert1->setPen(QPen(QColor(64, 64, 64), 1));
+ m_vert1->setPen(TQPen(TQColor(64, 64, 64), 1));
m_vert2 = new QCanvasLineGroupable(viewing, m_heightMarker);
m_vert2->setPoints(17, 0, 17, 8);
- m_vert2->setPen(QPen(QColor(64, 64, 64), 1));
+ m_vert2->setPen(TQPen(TQColor(64, 64, 64), 1));
m_heightMarker->hide();
}
@@ -99,13 +99,13 @@ NotationCanvasView::setHeightTracking(bool t)
}
void
-NotationCanvasView::contentsMouseReleaseEvent(QMouseEvent *e)
+NotationCanvasView::contentsMouseReleaseEvent(TQMouseEvent *e)
{
emit mouseReleased(e);
}
void
-NotationCanvasView::contentsMouseMoveEvent(QMouseEvent *e)
+NotationCanvasView::contentsMouseMoveEvent(TQMouseEvent *e)
{
NotationStaff *prevStaff = m_currentStaff;
int prevHeight = m_currentHeight;
@@ -115,7 +115,7 @@ NotationCanvasView::contentsMouseMoveEvent(QMouseEvent *e)
if (!m_currentStaff) {
- emit hoveredOverNoteChanged(QString::null);
+ emit hoveredOverNoteChanged(TQString::null);
if (prevStaff) {
m_heightMarker->hide();
canvas()->update();
@@ -156,13 +156,13 @@ NotationCanvasView::contentsMouseMoveEvent(QMouseEvent *e)
emit mouseMoved(e);
}
-void NotationCanvasView::contentsMousePressEvent(QMouseEvent *e)
+void NotationCanvasView::contentsMousePressEvent(TQMouseEvent *e)
{
NOTATION_DEBUG << "NotationCanvasView::contentsMousePressEvent() - btn : "
<< e->button() << " - state : " << e->state()
<< endl;
- QCanvasItemList itemList = canvas()->collisions(e->pos());
+ TQCanvasItemList itemList = canvas()->collisions(e->pos());
// We don't want to use m_currentStaff/Height, because we want
// to make sure the event happens at the point we clicked at
@@ -172,7 +172,7 @@ void NotationCanvasView::contentsMousePressEvent(QMouseEvent *e)
NotationStaff *staff = dynamic_cast<NotationStaff *>
(m_linedStaffManager.getStaffForCanvasCoords(e->x(), e->y()));
- QCanvasItemList::Iterator it;
+ TQCanvasItemList::Iterator it;
NotationElement *clickedNote = 0;
NotationElement *clickedVagueNote = 0;
NotationElement *clickedNonNote = 0;
@@ -197,7 +197,7 @@ void NotationCanvasView::contentsMousePressEvent(QMouseEvent *e)
if (dynamic_cast<QCanvasNonElementSprite *>(*it)) {
emit nonNotationItemPressed(e, *it);
return ;
- } else if (dynamic_cast<QCanvasText *>(*it)) {
+ } else if (dynamic_cast<TQCanvasText *>(*it)) {
emit textItemPressed(e, *it);
return ;
}
@@ -267,7 +267,7 @@ void NotationCanvasView::contentsMousePressEvent(QMouseEvent *e)
handleMousePress(clickHeight, staffNo, e);
}
-void NotationCanvasView::contentsMouseDoubleClickEvent(QMouseEvent* e)
+void NotationCanvasView::contentsMouseDoubleClickEvent(TQMouseEvent* e)
{
NOTATION_DEBUG << "NotationCanvasView::contentsMouseDoubleClickEvent()\n";
@@ -275,15 +275,15 @@ void NotationCanvasView::contentsMouseDoubleClickEvent(QMouseEvent* e)
}
void
-NotationCanvasView::processActiveItems(QMouseEvent* e,
- QCanvasItemList itemList)
+NotationCanvasView::processActiveItems(TQMouseEvent* e,
+ TQCanvasItemList itemList)
{
- QCanvasItem* pressedItem = 0;
- QCanvasItemList::Iterator it;
+ TQCanvasItem* pressedItem = 0;
+ TQCanvasItemList::Iterator it;
for (it = itemList.begin(); it != itemList.end(); ++it) {
- QCanvasItem *item = *it;
+ TQCanvasItem *item = *it;
if (item->active() && !pressedItem) {
NOTATION_DEBUG << "mousepress : got active item\n";
pressedItem = item;
@@ -298,7 +298,7 @@ NotationCanvasView::processActiveItems(QMouseEvent* e,
void
NotationCanvasView::handleMousePress(int height,
int staffNo,
- QMouseEvent *e,
+ TQMouseEvent *e,
NotationElement *el)
{
NOTATION_DEBUG << "NotationCanvasView::handleMousePress() at height "
@@ -308,7 +308,7 @@ NotationCanvasView::handleMousePress(int height,
}
bool
-NotationCanvasView::posIsTooFarFromStaff(const QPoint &pos)
+NotationCanvasView::posIsTooFarFromStaff(const TQPoint &pos)
{
// return true if pos.y is more than m_staffLineThreshold away from
// the last pos for which a collision was detected
@@ -339,7 +339,7 @@ NotationCanvasView::getLegerLineCount(int height, bool &offset)
}
void
-NotationCanvasView::setHeightMarkerHeight(QMouseEvent *e)
+NotationCanvasView::setHeightMarkerHeight(TQMouseEvent *e)
{
NotationStaff *staff = dynamic_cast<NotationStaff *>
(m_linedStaffManager.getStaffForCanvasCoords(e->x(), e->y()));
@@ -381,7 +381,7 @@ NotationCanvasView::setHeightMarkerHeight(QMouseEvent *e)
QCanvasLineGroupable *line =
new QCanvasLineGroupable(canvas(), m_heightMarker);
- line->setPen(QPen(QColor(64, 64, 64), 1));
+ line->setPen(TQPen(TQColor(64, 64, 64), 1));
int y = (int)m_heightMarker->y() +
(above ? -1 : 1) * (i * (spacing + 1));
@@ -403,20 +403,20 @@ NotationCanvasView::setHeightMarkerHeight(QMouseEvent *e)
}
NotationElement *
-NotationCanvasView::getElementAtXCoord(QMouseEvent *e) // any old element
+NotationCanvasView::getElementAtXCoord(TQMouseEvent *e) // any old element
{
- QRect threshold(e->pos(), QSize(4, 100)); //!!!
+ TQRect threshold(e->pos(), TQSize(4, 100)); //!!!
threshold.moveCenter(e->pos());
- QCanvasItemList itemList = canvas()->collisions(threshold);
+ TQCanvasItemList itemList = canvas()->collisions(threshold);
- QCanvasItemList::Iterator it;
+ TQCanvasItemList::Iterator it;
QCanvasNotationSprite* sprite = 0;
for (it = itemList.begin(); it != itemList.end(); ++it)
{
- QCanvasItem *item = *it;
+ TQCanvasItem *item = *it;
if ((sprite = dynamic_cast<QCanvasNotationSprite*>(item))) {
return & (sprite->getNotationElement());
@@ -427,7 +427,7 @@ NotationCanvasView::getElementAtXCoord(QMouseEvent *e) // any old element
}
void
-NotationCanvasView::viewportPaintEvent(QPaintEvent *e)
+NotationCanvasView::viewportPaintEvent(TQPaintEvent *e)
{
int cx(e->rect().x()),
cy(e->rect().y()),
@@ -435,7 +435,7 @@ NotationCanvasView::viewportPaintEvent(QPaintEvent *e)
ch(e->rect().height())*/;
// NOTATION_DEBUG << "NotationCanvasView::viewportPaintEvent: (" << cx << ","
// << cy << ") size (" << cw << "x" << ch << ")" << endl;
- QCanvasView::viewportPaintEvent(e);
+ TQCanvasView::viewportPaintEvent(e);
cx += contentsX();
cy += contentsY();
@@ -445,14 +445,14 @@ NotationCanvasView::viewportPaintEvent(QPaintEvent *e)
}
void
-NotationCanvasView::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
+NotationCanvasView::drawContents(TQPainter *p, int cx, int cy, int cw, int ch)
{
/*
- m_lastRender = QRect(cx, cy, cw, ch);
+ m_lastRender = TQRect(cx, cy, cw, ch);
NOTATION_DEBUG << "NotationCanvasView::drawContents: (" << cx << ","
<< cy << ") size (" << cw << "x" << ch << ")" << endl;
*/
- QCanvasView::drawContents(p, cx, cy, cw, ch);
+ TQCanvasView::drawContents(p, cx, cy, cw, ch);
/*
emit renderRequired(std::min(contentsX(), cx),
std::max(contentsX() + visibleWidth(), cx + cw));
@@ -462,21 +462,21 @@ NotationCanvasView::drawContents(QPainter *p, int cx, int cy, int cw, int ch)
void
NotationCanvasView::slotRenderComplete()
{
- /* QPainter painter(viewport());
+ /* TQPainter painter(viewport());
int cx(m_lastRender.x()),
cy(m_lastRender.y()),
cw(m_lastRender.width()),
ch(m_lastRender.height());
NOTATION_DEBUG << "NotationCanvasView::slotRenderComplete: (" << cx << ","
<< cy << ") size (" << cw << "x" << ch << ")" << endl;
- QCanvasView::drawContents(&painter, cx, cy, cw, ch);
+ TQCanvasView::drawContents(&painter, cx, cy, cw, ch);
*/
- QPaintEvent ev(m_lastRender);
- QCanvasView::viewportPaintEvent(&ev);
+ TQPaintEvent ev(m_lastRender);
+ TQCanvasView::viewportPaintEvent(&ev);
}
void
-NotationCanvasView::slotExternalWheelEvent(QWheelEvent* e)
+NotationCanvasView::slotExternalWheelEvent(TQWheelEvent* e)
{
wheelEvent(e);
}