summaryrefslogtreecommitdiffstats
path: root/src/gui/editors/segment/segmentcanvas/CompositionView.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-02 22:38:52 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2011-05-02 22:38:52 +0000
commit458efa7b0c935cbaafa2791021a5f8f7241aa876 (patch)
tree624583f2873febe23770bee3fa94b5c24bd59f4f /src/gui/editors/segment/segmentcanvas/CompositionView.cpp
parent747037b72944ae2c02962b7c5c96e0a7f8852e38 (diff)
downloadrosegarden-458efa7b0c935cbaafa2791021a5f8f7241aa876.tar.gz
rosegarden-458efa7b0c935cbaafa2791021a5f8f7241aa876.zip
Initial TQt4 port of Rosegarden
This enables compilation under both Qt3 and Qt4 git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1230242 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/editors/segment/segmentcanvas/CompositionView.cpp')
-rw-r--r--src/gui/editors/segment/segmentcanvas/CompositionView.cpp72
1 files changed, 36 insertions, 36 deletions
diff --git a/src/gui/editors/segment/segmentcanvas/CompositionView.cpp b/src/gui/editors/segment/segmentcanvas/CompositionView.cpp
index 1ff0263..6faf230 100644
--- a/src/gui/editors/segment/segmentcanvas/CompositionView.cpp
+++ b/src/gui/editors/segment/segmentcanvas/CompositionView.cpp
@@ -88,12 +88,12 @@ protected:
CompositionView::CompositionView(RosegardenGUIDoc* doc,
CompositionModel* model,
- TQWidget * parent, const char * name, WFlags f)
+ TQWidget * tqparent, const char * name, WFlags f)
#if KDE_VERSION >= KDE_MAKE_VERSION(3,2,0)
- : RosegardenScrollView(parent, name, f | WNoAutoErase | WStaticContents),
+ : RosegardenScrollView(tqparent, name, f | WNoAutoErase | WStaticContents),
#else
:
- RosegardenScrollView(parent, name, f | WRepaintNoErase | WResizeNoErase | WStaticContents),
+ RosegardenScrollView(tqparent, name, f | WRepaintNoErase | WResizeNoErase | WStaticContents),
#endif
m_model(model),
m_currentItem(0),
@@ -191,7 +191,7 @@ CompositionView::CompositionView(RosegardenGUIDoc* doc,
}
if (doc) {
- doc->getAudioPreviewThread().setEmptyQueueListener(this);
+ doc->getAudioPreviewThread().setEmptyQueueListener(TQT_TQOBJECT(this));
}
m_segmentsDrawBuffer.setOptimization(TQPixmap::BestOptim);
@@ -227,7 +227,7 @@ void CompositionView::slotUpdateSize()
RulerScale *ruler = grid().getRulerScale();
- int minWidth = sizeHint().width();
+ int minWidth = tqsizeHint().width();
int computedWidth = int(nearbyint(ruler->getTotalWidth()));
int width = std::max(computedWidth, minWidth);
@@ -327,7 +327,7 @@ void CompositionView::slotSetTool(const TQString& toolName)
if (m_tool)
m_tool->ready();
else {
- KMessageBox::error(0, TQString("CompositionView::slotSetTool() : unknown tool name %1").arg(toolName));
+ KMessageBox::error(0, TQString("CompositionView::slotSetTool() : unknown tool name %1").tqarg(toolName));
}
}
@@ -495,7 +495,7 @@ void CompositionView::resizeEvent(TQResizeEvent* e)
void CompositionView::viewportPaintEvent(TQPaintEvent* e)
{
- TQMemArray<TQRect> rects = e->region().rects();
+ TQMemArray<TQRect> rects = TQRegion(e->region()).tqrects();
for (unsigned int i = 0; i < rects.size(); ++i) {
viewportPaintRect(rects[i]);
@@ -550,7 +550,7 @@ void CompositionView::viewportPaintRect(TQRect r)
// DEBUG
// TQPainter pdebug(viewport());
- // static TQPen framePen(Qt::red, 1);
+ // static TQPen framePen(TQt::red, 1);
// pdebug.setPen(framePen);
// pdebug.drawRect(updateRect);
@@ -669,7 +669,7 @@ void CompositionView::refreshSegmentsDrawBuffer(const TQRect& rect)
drawArea(&p, rect);
// DEBUG - show what's updated
- // TQPen framePen(Qt::red, 1);
+ // TQPen framePen(TQt::red, 1);
// p.setPen(framePen);
// p.drawRect(rect);
@@ -682,7 +682,7 @@ void CompositionView::refreshArtifactsDrawBuffer(const TQRect& rect)
// << rect << endl;
TQPainter p;
- p.begin(&m_artifactsDrawBuffer, viewport());
+ p.tqbegin(&m_artifactsDrawBuffer, viewport());
p.translate( -contentsX(), -contentsY());
// TQRect r(contentsX(), contentsY(), m_artifactsDrawBuffer.width(), m_artifactsDrawBuffer.height());
drawAreaArtifacts(&p, rect);
@@ -929,7 +929,7 @@ void CompositionView::drawAreaArtifacts(TQPainter * p, const TQRect& clipRect)
//
// Split line
//
- if (m_splitLinePos.x() > 0 && clipRect.contains(m_splitLinePos)) {
+ if (m_splitLinePos.x() > 0 && clipRect.tqcontains(m_splitLinePos)) {
p->save();
p->setPen(m_guideColor);
p->drawLine(m_splitLinePos.x(), m_splitLinePos.y(),
@@ -975,7 +975,7 @@ void CompositionView::drawCompRect(const CompositionRect& r, TQPainter *p, const
// draw 'start' rectangle with original brush
//
- TQRect startRect = r;
+ TQRect startRect = static_cast<const TQRect&>(r);
startRect.setWidth(repeatMarks[0] - r.x());
p->setBrush(r.getBrush());
drawRect(startRect, p, clipRect, r.isSelected(), intersectLvl, fill);
@@ -984,7 +984,7 @@ void CompositionView::drawCompRect(const CompositionRect& r, TQPainter *p, const
// now draw the 'repeat' marks
//
p->setPen(CompositionColourCache::getInstance()->RepeatSegmentBorder);
- int penWidth = std::max(r.getPen().width(), 1u);
+ int penWidth = std::max((uint)r.getPen().width(), 1u);
for (unsigned int i = 0; i < repeatMarks.size(); ++i) {
int pos = repeatMarks[i];
@@ -1020,9 +1020,9 @@ void CompositionView::drawCompRectLabel(const CompositionRect& r, TQPainter *p,
TQRect textRect(r);
textRect.setX(textRect.x() + 3);
TQString label = " " + r.getLabel() + " ";
- TQRect textBoundingRect = p->boundingRect(textRect, Qt::AlignLeft | Qt::AlignVCenter, label);
+ TQRect textBoundingRect = p->boundingRect(textRect, TQt::AlignLeft | TQt::AlignVCenter, label);
p->drawRect(textBoundingRect & r);
- p->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, label);
+ p->drawText(textRect, TQt::AlignLeft | TQt::AlignVCenter, label);
p->restore();
}
#else
@@ -1036,7 +1036,7 @@ void CompositionView::drawCompRectLabel(const CompositionRect& r, TQPainter *p,
font.setItalic(false);
p->setFont(font);
- TQRect labelRect = QRect
+ TQRect labelRect = TQRect
(r.x(),
r.y() + ((r.height() - p->fontMetrics().height()) / 2) + 1,
r.width(),
@@ -1074,7 +1074,7 @@ void CompositionView::drawCompRectLabel(const CompositionRect& r, TQPainter *p,
labelRect.setY(wy);
p->drawText(labelRect,
- Qt::AlignLeft | Qt::AlignTop,
+ TQt::AlignLeft | TQt::AlignTop,
r.getLabel());
}
@@ -1084,7 +1084,7 @@ void CompositionView::drawCompRectLabel(const CompositionRect& r, TQPainter *p,
p->setPen(GUIPalette::getColour
(GUIPalette::SegmentLabel));
p->drawText(labelRect,
- Qt::AlignLeft | Qt::AlignVCenter, r.getLabel());
+ TQt::AlignLeft | TQt::AlignVCenter, r.getLabel());
p->restore();
}
#endif
@@ -1122,13 +1122,13 @@ void CompositionView::drawRect(const TQRect& r, TQPainter *p, const TQRect& clip
// RG_DEBUG << "CompositionView::drawRect : intersected color : " << fillColor << " isSelected : " << isSelected << endl;
}
} else {
- p->setBrush(Qt::NoBrush);
+ p->setBrush(TQt::NoBrush);
}
// Paint using the small coordinates...
TQRect intersection = rect.intersect(clipRect);
- if (clipRect.contains(rect)) {
+ if (clipRect.tqcontains(rect)) {
p->drawRect(rect);
} else {
// draw only what's necessary
@@ -1199,7 +1199,7 @@ void CompositionView::drawIntersections(const CompositionModel::rectcontainer& r
break;
for (; i != rects.end(); ++i) {
- CompositionRect ri = testRect.intersect(*i);
+ CompositionRect ri = TQT_TQRECT_OBJECT(testRect.intersect(*i));
if (!ri.isEmpty()) {
CompositionModel::rectcontainer::iterator t = std::find(intersections.begin(),
intersections.end(), ri);
@@ -1246,7 +1246,7 @@ void CompositionView::drawIntersections(const CompositionModel::rectcontainer& r
break;
for (; i != intersections.end(); ++i) {
- CompositionRect ri = testRect.intersect(*i);
+ CompositionRect ri = TQT_TQRECT_OBJECT(testRect.intersect(*i));
if (!ri.isEmpty() && ri != *i) {
CompositionModel::rectcontainer::iterator t = std::find(intersections2.begin(),
intersections2.end(), ri);
@@ -1356,15 +1356,15 @@ void CompositionView::slotToolHelpChanged(const TQString &text)
void CompositionView::contentsMousePressEvent(TQMouseEvent* e)
{
- Qt::ButtonState bs = e->state();
- slotSetSelectCopy((bs & Qt::ControlButton) != 0);
- slotSetSelectAdd((bs & Qt::ShiftButton) != 0);
- slotSetFineGrain((bs & Qt::ShiftButton) != 0);
- slotSetPencilOverExisting((bs & Qt::AltButton + Qt::ControlButton) != 0);
+ TQt::ButtonState bs = e->state();
+ slotSetSelectCopy((bs & TQt::ControlButton) != 0);
+ slotSetSelectAdd((bs & TQt::ShiftButton) != 0);
+ slotSetFineGrain((bs & TQt::ShiftButton) != 0);
+ slotSetPencilOverExisting((bs & TQt::AltButton + TQt::ControlButton) != 0);
switch (e->button()) {
- case LeftButton:
- case MidButton:
+ case Qt::LeftButton:
+ case Qt::MidButton:
startAutoScroll();
if (m_tool)
@@ -1373,7 +1373,7 @@ void CompositionView::contentsMousePressEvent(TQMouseEvent* e)
RG_DEBUG << "CompositionView::contentsMousePressEvent() :"
<< this << " no tool\n";
break;
- case RightButton:
+ case Qt::RightButton:
if (m_tool)
m_tool->handleRightButtonPress(e);
else
@@ -1394,8 +1394,8 @@ void CompositionView::contentsMouseReleaseEvent(TQMouseEvent* e)
if (!m_tool)
return ;
- if (e->button() == LeftButton ||
- e->button() == MidButton )
+ if (e->button() == Qt::LeftButton ||
+ e->button() == Qt::MidButton )
m_tool->handleMouseButtonRelease(e);
}
@@ -1434,9 +1434,9 @@ void CompositionView::contentsMouseMoveEvent(TQMouseEvent* e)
if (!m_tool)
return ;
- Qt::ButtonState bs = e->state();
- slotSetFineGrain((bs & Qt::ShiftButton) != 0);
- slotSetPencilOverExisting((bs & Qt::AltButton) != 0);
+ TQt::ButtonState bs = e->state();
+ slotSetFineGrain((bs & TQt::ShiftButton) != 0);
+ slotSetPencilOverExisting((bs & TQt::AltButton) != 0);
int follow = m_tool->handleMouseMove(e);
setScrollDirectionConstraint(follow);
@@ -1584,7 +1584,7 @@ CompositionView::slotTextFloatTimeout()
{
hideTextFloat();
slotArtifactsDrawBufferNeedsRefresh();
- // rgapp->slotSetStatusMessage(TQString::null);
+ // rgapp->slotSetStatusMessage(TQString());
}
}