summaryrefslogtreecommitdiffstats
path: root/src/gui/rulers/ControlItem.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/rulers/ControlItem.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/rulers/ControlItem.cpp')
-rw-r--r--src/gui/rulers/ControlItem.cpp32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/gui/rulers/ControlItem.cpp b/src/gui/rulers/ControlItem.cpp
index 623fbf3..8eb17ed 100644
--- a/src/gui/rulers/ControlItem.cpp
+++ b/src/gui/rulers/ControlItem.cpp
@@ -35,7 +35,7 @@ static int _canvasItemZ = 30;
ControlItem::ControlItem(ControlRuler* ruler, ElementAdapter* elementAdapter,
int xx, int width)
- : QCanvasRectangle(ruler->canvas()),
+ : TQCanvasRectangle(ruler->canvas()),
m_value(0),
m_controlRuler(ruler),
m_elementAdapter(elementAdapter)
@@ -44,7 +44,7 @@ ControlItem::ControlItem(ControlRuler* ruler, ElementAdapter* elementAdapter,
width = DefaultWidth/4; // avoid invisible zero-duration items
}
setWidth(width);
- setPen(QPen(Qt::black, BorderThickness));
+ setPen(TQPen(Qt::black, BorderThickness));
setBrush(Qt::blue);
setX(xx);
@@ -85,7 +85,7 @@ void ControlItem::updateFromValue()
}
}
-typedef std::pair<int, QCanvasItem*> ItemPair;
+typedef std::pair<int, TQCanvasItem*> ItemPair;
struct ItemCmp
{
bool operator()(const ItemPair &i1, const ItemPair &i2)
@@ -94,14 +94,14 @@ struct ItemCmp
}
};
-void ControlItem::draw(QPainter &painter)
+void ControlItem::draw(TQPainter &painter)
{
if (!isEnabled())
updateFromValue();
setBrush(m_controlRuler->valueToColour(m_controlRuler->getMaxItemValue(), m_value));
- QCanvasRectangle::draw(painter);
+ TQCanvasRectangle::draw(painter);
/*
@@ -111,16 +111,16 @@ void ControlItem::draw(QPainter &painter)
// calculate collisions and assign Z values accordingly
//
- QCanvasItemList l = collisions(false);
+ TQCanvasItemList l = collisions(false);
std::vector<ItemPair> sortList;
- for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
+ for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
// skip all but rectangles
- if ((*it)->rtti() != QCanvasItem::Rtti_Rectangle) continue;
+ if ((*it)->rtti() != TQCanvasItem::Rtti_Rectangle) continue;
- if (QCanvasRectangle *rect = dynamic_cast<QCanvasRectangle*>(*it))
+ if (TQCanvasRectangle *rect = dynamic_cast<TQCanvasRectangle*>(*it))
sortList.push_back(ItemPair(rect->height(), *it));
}
@@ -144,19 +144,19 @@ void ControlItem::draw(QPainter &painter)
}
-void ControlItem::handleMouseButtonPress(QMouseEvent*)
+void ControlItem::handleMouseButtonPress(TQMouseEvent*)
{
// RG_DEBUG << "ControlItem::handleMouseButtonPress()" << this << endl;
setEnabled(true);
}
-void ControlItem::handleMouseButtonRelease(QMouseEvent*)
+void ControlItem::handleMouseButtonRelease(TQMouseEvent*)
{
// RG_DEBUG << "ControlItem::handleMouseButtonRelease()" << this << endl;
setEnabled(false);
}
-void ControlItem::handleMouseMove(QMouseEvent*, int /*deltaX*/, int deltaY)
+void ControlItem::handleMouseMove(TQMouseEvent*, int /*deltaX*/, int deltaY)
{
// RG_DEBUG << "ControlItem::handleMouseMove()" << this << endl;
@@ -177,17 +177,17 @@ void ControlItem::handleMouseMove(QMouseEvent*, int /*deltaX*/, int deltaY)
setValue(m_controlRuler->heightToValue(getHeight()));
}
-void ControlItem::handleMouseWheel(QWheelEvent *)
+void ControlItem::handleMouseWheel(TQWheelEvent *)
{
// RG_DEBUG << "ControlItem::handleMouseWheel - got wheel event" << endl;
}
void ControlItem::setSelected(bool s)
{
- QCanvasItem::setSelected(s);
+ TQCanvasItem::setSelected(s);
- if (s) setPen(QPen(Qt::red, BorderThickness));
- else setPen(QPen(Qt::black, BorderThickness));
+ if (s) setPen(TQPen(Qt::red, BorderThickness));
+ else setPen(TQPen(Qt::black, BorderThickness));
canvas()->update();
}