summaryrefslogtreecommitdiffstats
path: root/src/gui/editors/segment/segmentcanvas/CompositionView.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/segment/segmentcanvas/CompositionView.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/segment/segmentcanvas/CompositionView.cpp')
-rw-r--r--src/gui/editors/segment/segmentcanvas/CompositionView.cpp318
1 files changed, 159 insertions, 159 deletions
diff --git a/src/gui/editors/segment/segmentcanvas/CompositionView.cpp b/src/gui/editors/segment/segmentcanvas/CompositionView.cpp
index 8e83a6b..1ff0263 100644
--- a/src/gui/editors/segment/segmentcanvas/CompositionView.cpp
+++ b/src/gui/editors/segment/segmentcanvas/CompositionView.cpp
@@ -47,22 +47,22 @@
#include "SegmentToolBox.h"
#include "SegmentTool.h"
#include <kmessagebox.h>
-#include <qbrush.h>
-#include <qcolor.h>
-#include <qevent.h>
-#include <qfont.h>
-#include <qfontmetrics.h>
-#include <qmemarray.h>
-#include <qpainter.h>
-#include <qpen.h>
-#include <qpixmap.h>
-#include <qpoint.h>
-#include <qrect.h>
-#include <qscrollbar.h>
-#include <qscrollview.h>
-#include <qsize.h>
-#include <qstring.h>
-#include <qwidget.h>
+#include <tqbrush.h>
+#include <tqcolor.h>
+#include <tqevent.h>
+#include <tqfont.h>
+#include <tqfontmetrics.h>
+#include <tqmemarray.h>
+#include <tqpainter.h>
+#include <tqpen.h>
+#include <tqpixmap.h>
+#include <tqpoint.h>
+#include <tqrect.h>
+#include <tqscrollbar.h>
+#include <tqscrollview.h>
+#include <tqsize.h>
+#include <tqstring.h>
+#include <tqwidget.h>
#include <kapplication.h>
#include <kconfig.h>
#include <algorithm>
@@ -71,24 +71,24 @@
namespace Rosegarden
{
-class PreviewRect : public QRect {
+class PreviewRect : public TQRect {
public:
PreviewRect(int left, int top, int width, int height) :
- QRect(left, top, width, height) {};
+ TQRect(left, top, width, height) {};
- PreviewRect(const QRect& r) :
- QRect(r) {};
+ PreviewRect(const TQRect& r) :
+ TQRect(r) {};
- const QColor& getColor() const { return m_color; }
- void setColor(QColor c) { m_color = c; }
+ const TQColor& getColor() const { return m_color; }
+ void setColor(TQColor c) { m_color = c; }
protected:
- QColor m_color;
+ TQColor m_color;
};
CompositionView::CompositionView(RosegardenGUIDoc* doc,
CompositionModel* model,
- QWidget * parent, const char * name, WFlags f)
+ TQWidget * parent, const char * name, WFlags f)
#if KDE_VERSION >= KDE_MAKE_VERSION(3,2,0)
: RosegardenScrollView(parent, name, f | WNoAutoErase | WStaticContents),
#else
@@ -110,8 +110,8 @@ CompositionView::CompositionView(RosegardenGUIDoc* doc,
m_pointerPos(0),
m_pointerColor(GUIPalette::getColour(GUIPalette::Pointer)),
m_pointerWidth(4),
- m_pointerPen(QPen(m_pointerColor, m_pointerWidth)),
- m_tmpRect(QRect(QPoint(0, 0), QPoint( -1, -1))),
+ m_pointerPen(TQPen(m_pointerColor, m_pointerWidth)),
+ m_tmpRect(TQRect(TQPoint(0, 0), TQPoint( -1, -1))),
m_tmpRectFill(CompositionRect::DefaultBrushColor),
m_trackDividerColor(GUIPalette::getColour(GUIPalette::TrackDivider)),
m_drawGuides(false),
@@ -132,8 +132,8 @@ CompositionView::CompositionView(RosegardenGUIDoc* doc,
if (doc) {
m_toolBox = new SegmentToolBox(this, doc);
- connect(m_toolBox, SIGNAL(showContextHelp(const QString &)),
- this, SLOT(slotToolHelpChanged(const QString &)));
+ connect(m_toolBox, TQT_SIGNAL(showContextHelp(const TQString &)),
+ this, TQT_SLOT(slotToolHelpChanged(const TQString &)));
}
setDragAutoScroll(true);
@@ -143,46 +143,46 @@ CompositionView::CompositionView(RosegardenGUIDoc* doc,
slotUpdateSize();
- QScrollBar* hsb = horizontalScrollBar();
+ TQScrollBar* hsb = horizontalScrollBar();
// dynamically adjust content size when scrolling past current composition's end
- connect(hsb, SIGNAL(nextLine()),
- this, SLOT(scrollRight()));
- connect(hsb, SIGNAL(prevLine()),
- this, SLOT(scrollLeft()));
-
- // connect(this, SIGNAL(contentsMoving(int, int)),
- // this, SLOT(slotAllDrawBuffersNeedRefresh()));
-
- // connect(this, SIGNAL(contentsMoving(int, int)),
- // this, SLOT(slotContentsMoving(int, int)));
-
- connect(model, SIGNAL(needContentUpdate()),
- this, SLOT(slotUpdateSegmentsDrawBuffer()));
- connect(model, SIGNAL(needContentUpdate(const QRect&)),
- this, SLOT(slotUpdateSegmentsDrawBuffer(const QRect&)));
- connect(model, SIGNAL(needArtifactsUpdate()),
- this, SLOT(slotArtifactsDrawBufferNeedsRefresh()));
- connect(model, SIGNAL(needSizeUpdate()),
- this, SLOT(slotUpdateSize()));
+ connect(hsb, TQT_SIGNAL(nextLine()),
+ this, TQT_SLOT(scrollRight()));
+ connect(hsb, TQT_SIGNAL(prevLine()),
+ this, TQT_SLOT(scrollLeft()));
+
+ // connect(this, TQT_SIGNAL(contentsMoving(int, int)),
+ // this, TQT_SLOT(slotAllDrawBuffersNeedRefresh()));
+
+ // connect(this, TQT_SIGNAL(contentsMoving(int, int)),
+ // this, TQT_SLOT(slotContentsMoving(int, int)));
+
+ connect(model, TQT_SIGNAL(needContentUpdate()),
+ this, TQT_SLOT(slotUpdateSegmentsDrawBuffer()));
+ connect(model, TQT_SIGNAL(needContentUpdate(const TQRect&)),
+ this, TQT_SLOT(slotUpdateSegmentsDrawBuffer(const TQRect&)));
+ connect(model, TQT_SIGNAL(needArtifactsUpdate()),
+ this, TQT_SLOT(slotArtifactsDrawBufferNeedsRefresh()));
+ connect(model, TQT_SIGNAL(needSizeUpdate()),
+ this, TQT_SLOT(slotUpdateSize()));
if (doc) {
- connect(doc, SIGNAL(docColoursChanged()),
- this, SLOT(slotRefreshColourCache()));
+ connect(doc, TQT_SIGNAL(docColoursChanged()),
+ this, TQT_SLOT(slotRefreshColourCache()));
// recording-related signals
- connect(doc, SIGNAL(newMIDIRecordingSegment(Segment*)),
- this, SLOT(slotNewMIDIRecordingSegment(Segment*)));
- connect(doc, SIGNAL(newAudioRecordingSegment(Segment*)),
- this, SLOT(slotNewAudioRecordingSegment(Segment*)));
- // connect(doc, SIGNAL(recordMIDISegmentUpdated(Segment*, timeT)),
- // this, SLOT(slotRecordMIDISegmentUpdated(Segment*, timeT)));
- connect(doc, SIGNAL(stoppedAudioRecording()),
- this, SLOT(slotStoppedRecording()));
- connect(doc, SIGNAL(stoppedMIDIRecording()),
- this, SLOT(slotStoppedRecording()));
- connect(doc, SIGNAL(audioFileFinalized(Segment*)),
- getModel(), SLOT(slotAudioFileFinalized(Segment*)));
+ connect(doc, TQT_SIGNAL(newMIDIRecordingSegment(Segment*)),
+ this, TQT_SLOT(slotNewMIDIRecordingSegment(Segment*)));
+ connect(doc, TQT_SIGNAL(newAudioRecordingSegment(Segment*)),
+ this, TQT_SLOT(slotNewAudioRecordingSegment(Segment*)));
+ // connect(doc, TQT_SIGNAL(recordMIDISegmentUpdated(Segment*, timeT)),
+ // this, TQT_SLOT(slotRecordMIDISegmentUpdated(Segment*, timeT)));
+ connect(doc, TQT_SIGNAL(stoppedAudioRecording()),
+ this, TQT_SLOT(slotStoppedRecording()));
+ connect(doc, TQT_SIGNAL(stoppedMIDIRecording()),
+ this, TQT_SLOT(slotStoppedRecording()));
+ connect(doc, TQT_SIGNAL(audioFileFinalized(Segment*)),
+ getModel(), TQT_SLOT(slotAudioFileFinalized(Segment*)));
}
CompositionModelImpl* cmi = dynamic_cast<CompositionModelImpl*>(model);
@@ -194,8 +194,8 @@ CompositionView::CompositionView(RosegardenGUIDoc* doc,
doc->getAudioPreviewThread().setEmptyQueueListener(this);
}
- m_segmentsDrawBuffer.setOptimization(QPixmap::BestOptim);
- m_artifactsDrawBuffer.setOptimization(QPixmap::BestOptim);
+ m_segmentsDrawBuffer.setOptimization(TQPixmap::BestOptim);
+ m_artifactsDrawBuffer.setOptimization(TQPixmap::BestOptim);
viewport()->setMouseTracking(true);
}
@@ -208,7 +208,7 @@ void CompositionView::endAudioPreviewGeneration()
}
}
-void CompositionView::setBackgroundPixmap(const QPixmap &m)
+void CompositionView::setBackgroundPixmap(const TQPixmap &m)
{
m_backgroundPixmap = m;
// viewport()->setErasePixmap(m_backgroundPixmap);
@@ -216,7 +216,7 @@ void CompositionView::setBackgroundPixmap(const QPixmap &m)
void CompositionView::initStepSize()
{
- QScrollBar* hsb = horizontalScrollBar();
+ TQScrollBar* hsb = horizontalScrollBar();
m_stepSize = hsb->lineStep();
}
@@ -265,7 +265,7 @@ void CompositionView::scrollLeft()
}
-void CompositionView::setSelectionRectPos(const QPoint& pos)
+void CompositionView::setSelectionRectPos(const TQPoint& pos)
{
m_selectionRect.setRect(pos.x(), pos.y(), 0, 0);
getModel()->setSelectionRect(m_selectionRect);
@@ -273,7 +273,7 @@ void CompositionView::setSelectionRectPos(const QPoint& pos)
void CompositionView::setSelectionRectSize(int w, int h)
{
- m_selectionRect.setSize(QSize(w, h));
+ m_selectionRect.setSize(TQSize(w, h));
getModel()->setSelectionRect(m_selectionRect);
}
@@ -303,7 +303,7 @@ void CompositionView::updateSelectionContents()
return ;
- QRect selectionRect = getModel()->getSelectionContentsRect();
+ TQRect selectionRect = getModel()->getSelectionContentsRect();
updateContents(selectionRect);
}
@@ -312,7 +312,7 @@ void CompositionView::slotContentsMoving(int x, int y)
// qDebug("contents moving : x=%d", x);
}
-void CompositionView::slotSetTool(const QString& toolName)
+void CompositionView::slotSetTool(const TQString& toolName)
{
RG_DEBUG << "CompositionView::slotSetTool(" << toolName << ")"
<< this << "\n";
@@ -327,7 +327,7 @@ void CompositionView::slotSetTool(const QString& toolName)
if (m_tool)
m_tool->ready();
else {
- KMessageBox::error(0, QString("CompositionView::slotSetTool() : unknown tool name %1").arg(toolName));
+ KMessageBox::error(0, TQString("CompositionView::slotSetTool() : unknown tool name %1").arg(toolName));
}
}
@@ -335,7 +335,7 @@ void CompositionView::slotSelectSegments(const SegmentSelection &segments)
{
RG_DEBUG << "CompositionView::slotSelectSegments\n";
- static QRect dummy;
+ static TQRect dummy;
getModel()->clearSelected();
@@ -383,13 +383,13 @@ void CompositionView::slotHideSplitLine()
m_splitLinePos.setY( -1);
}
-void CompositionView::slotExternalWheelEvent(QWheelEvent* e)
+void CompositionView::slotExternalWheelEvent(TQWheelEvent* e)
{
e->accept();
wheelEvent(e);
}
-CompositionItem CompositionView::getFirstItemAt(QPoint pos)
+CompositionItem CompositionView::getFirstItemAt(TQPoint pos)
{
CompositionModel::itemcontainer items = getModel()->getItemsAt(pos);
@@ -443,7 +443,7 @@ void CompositionView::slotUpdateSegmentsDrawBuffer()
updateContents();
}
-void CompositionView::slotUpdateSegmentsDrawBuffer(const QRect& rect)
+void CompositionView::slotUpdateSegmentsDrawBuffer(const TQRect& rect)
{
// RG_DEBUG << "CompositionView::slotUpdateSegmentsDrawBuffer() rect "
// << rect << " - valid : " << rect.isValid() << endl;
@@ -479,9 +479,9 @@ void CompositionView::slotStoppedRecording()
getModel()->clearRecordingItems();
}
-void CompositionView::resizeEvent(QResizeEvent* e)
+void CompositionView::resizeEvent(TQResizeEvent* e)
{
- QScrollView::resizeEvent(e);
+ TQScrollView::resizeEvent(e);
slotUpdateSize();
int w = std::max(m_segmentsDrawBuffer.width(), visibleWidth());
@@ -493,18 +493,18 @@ void CompositionView::resizeEvent(QResizeEvent* e)
// RG_DEBUG << "CompositionView::resizeEvent() : drawBuffer size = " << m_segmentsDrawBuffer.size() << endl;
}
-void CompositionView::viewportPaintEvent(QPaintEvent* e)
+void CompositionView::viewportPaintEvent(TQPaintEvent* e)
{
- QMemArray<QRect> rects = e->region().rects();
+ TQMemArray<TQRect> rects = e->region().rects();
for (unsigned int i = 0; i < rects.size(); ++i) {
viewportPaintRect(rects[i]);
}
}
-void CompositionView::viewportPaintRect(QRect r)
+void CompositionView::viewportPaintRect(TQRect r)
{
- QRect updateRect = r;
+ TQRect updateRect = r;
r &= viewport()->rect();
r.moveBy(contentsX(), contentsY());
@@ -520,7 +520,7 @@ void CompositionView::viewportPaintRect(QRect r)
if (changed || m_artifactsDrawBufferRefresh.isValid()) {
// r was modified by checkScrollAndRefreshDrawBuffer
- QRect copyRect(r | m_artifactsDrawBufferRefresh);
+ TQRect copyRect(r | m_artifactsDrawBufferRefresh);
copyRect.moveBy( -contentsX(), -contentsY());
// RG_DEBUG << "copying from segment to artifacts buffer: " << copyRect << endl;
@@ -534,7 +534,7 @@ void CompositionView::viewportPaintRect(QRect r)
if (m_artifactsDrawBufferRefresh.isValid()) {
refreshArtifactsDrawBuffer(m_artifactsDrawBufferRefresh);
- m_artifactsDrawBufferRefresh = QRect();
+ m_artifactsDrawBufferRefresh = TQRect();
}
if (scroll) {
@@ -549,17 +549,17 @@ void CompositionView::viewportPaintRect(QRect r)
// DEBUG
- // QPainter pdebug(viewport());
- // static QPen framePen(Qt::red, 1);
+ // TQPainter pdebug(viewport());
+ // static TQPen framePen(Qt::red, 1);
// pdebug.setPen(framePen);
// pdebug.drawRect(updateRect);
}
-bool CompositionView::checkScrollAndRefreshDrawBuffer(QRect &rect, bool& scroll)
+bool CompositionView::checkScrollAndRefreshDrawBuffer(TQRect &rect, bool& scroll)
{
bool all = false;
- QRect refreshRect = m_segmentsDrawBufferRefresh;
+ TQRect refreshRect = m_segmentsDrawBufferRefresh;
int w = visibleWidth(), h = visibleHeight();
int cx = contentsX(), cy = contentsY();
@@ -591,13 +591,13 @@ bool CompositionView::checkScrollAndRefreshDrawBuffer(QRect &rect, bool& scroll)
if (dx > -w && dx < w) {
- QPainter cp(&m_segmentsDrawBuffer);
+ TQPainter cp(&m_segmentsDrawBuffer);
cp.drawPixmap(dx, 0, m_segmentsDrawBuffer);
if (dx < 0) {
- refreshRect |= QRect(cx + w + dx, cy, -dx, h);
+ refreshRect |= TQRect(cx + w + dx, cy, -dx, h);
} else {
- refreshRect |= QRect(cx, cy, dx, h);
+ refreshRect |= TQRect(cx, cy, dx, h);
}
} else {
@@ -613,13 +613,13 @@ bool CompositionView::checkScrollAndRefreshDrawBuffer(QRect &rect, bool& scroll)
if (dy > -h && dy < h) {
- QPainter cp(&m_segmentsDrawBuffer);
+ TQPainter cp(&m_segmentsDrawBuffer);
cp.drawPixmap(0, dy, m_segmentsDrawBuffer);
if (dy < 0) {
- refreshRect |= QRect(cx, cy + h + dy, w, -dy);
+ refreshRect |= TQRect(cx, cy + h + dy, w, -dy);
} else {
- refreshRect |= QRect(cx, cy, w, dy);
+ refreshRect |= TQRect(cx, cy, w, dy);
}
} else {
@@ -640,7 +640,7 @@ bool CompositionView::checkScrollAndRefreshDrawBuffer(QRect &rect, bool& scroll)
if (needRefresh)
refreshSegmentsDrawBuffer(refreshRect);
- m_segmentsDrawBufferRefresh = QRect();
+ m_segmentsDrawBufferRefresh = TQRect();
m_lastBufferRefreshX = cx;
m_lastBufferRefreshY = cy;
@@ -650,17 +650,17 @@ bool CompositionView::checkScrollAndRefreshDrawBuffer(QRect &rect, bool& scroll)
return needRefresh;
}
-void CompositionView::refreshSegmentsDrawBuffer(const QRect& rect)
+void CompositionView::refreshSegmentsDrawBuffer(const TQRect& rect)
{
// Profiler profiler("CompositionView::refreshDrawBuffer", true);
// RG_DEBUG << "CompositionView::refreshSegmentsDrawBuffer() r = "
// << rect << endl;
- QPainter p(&m_segmentsDrawBuffer, viewport());
+ TQPainter p(&m_segmentsDrawBuffer, viewport());
p.translate( -contentsX(), -contentsY());
if (!m_backgroundPixmap.isNull()) {
- QPoint pp(rect.x() % m_backgroundPixmap.height(), rect.y() % m_backgroundPixmap.width());
+ TQPoint pp(rect.x() % m_backgroundPixmap.height(), rect.y() % m_backgroundPixmap.width());
p.drawTiledPixmap(rect, m_backgroundPixmap, pp);
} else {
p.eraseRect(rect);
@@ -669,29 +669,29 @@ void CompositionView::refreshSegmentsDrawBuffer(const QRect& rect)
drawArea(&p, rect);
// DEBUG - show what's updated
- // QPen framePen(Qt::red, 1);
+ // TQPen framePen(Qt::red, 1);
// p.setPen(framePen);
// p.drawRect(rect);
// m_segmentsDrawBufferNeedsRefresh = false;
}
-void CompositionView::refreshArtifactsDrawBuffer(const QRect& rect)
+void CompositionView::refreshArtifactsDrawBuffer(const TQRect& rect)
{
// RG_DEBUG << "CompositionView::refreshArtifactsDrawBuffer() r = "
// << rect << endl;
- QPainter p;
+ TQPainter p;
p.begin(&m_artifactsDrawBuffer, viewport());
p.translate( -contentsX(), -contentsY());
- // QRect r(contentsX(), contentsY(), m_artifactsDrawBuffer.width(), m_artifactsDrawBuffer.height());
+ // TQRect r(contentsX(), contentsY(), m_artifactsDrawBuffer.width(), m_artifactsDrawBuffer.height());
drawAreaArtifacts(&p, rect);
p.end();
// m_artifactsDrawBufferNeedsRefresh = false;
}
-void CompositionView::drawArea(QPainter *p, const QRect& clipRect)
+void CompositionView::drawArea(TQPainter *p, const TQRect& clipRect)
{
// Profiler profiler("CompositionView::drawArea", true);
@@ -705,7 +705,7 @@ void CompositionView::drawArea(QPainter *p, const QRect& clipRect)
if (!lineHeights.empty()) {
p->save();
- QColor light = m_trackDividerColor.light();
+ TQColor light = m_trackDividerColor.light();
p->setPen(light);
for (CompositionModel::heightlist::const_iterator hi = lineHeights.begin();
@@ -802,8 +802,8 @@ void CompositionView::drawArea(QPainter *p, const QRect& clipRect)
for (; interval.range.first != interval.range.second; ++interval.range.first) {
const PreviewRect& pr = *(interval.range.first);
- QColor defaultCol = CompositionColourCache::getInstance()->SegmentInternalPreview;
- QColor col = interval.color.isValid() ? interval.color : defaultCol;
+ TQColor defaultCol = CompositionColourCache::getInstance()->SegmentInternalPreview;
+ TQColor col = interval.color.isValid() ? interval.color : defaultCol;
p->setBrush(col);
p->setPen(col);
// RG_DEBUG << "CompositionView::drawArea : drawing preview rect at x = " << pr.x() << endl;
@@ -828,15 +828,15 @@ void CompositionView::drawArea(QPainter *p, const QRect& clipRect)
}
-void CompositionView::drawAreaAudioPreviews(QPainter * p, const QRect& clipRect)
+void CompositionView::drawAreaAudioPreviews(TQPainter * p, const TQRect& clipRect)
{
CompositionModel::AudioPreviewDrawData::const_iterator api = m_audioPreviewRects.begin();
CompositionModel::AudioPreviewDrawData::const_iterator apEnd = m_audioPreviewRects.end();
- QRect rectToFill, // rect to fill on canvas
+ TQRect rectToFill, // rect to fill on canvas
localRect; // the rect of the tile to draw on the canvas
- QPoint basePoint, // origin of segment rect
+ TQPoint basePoint, // origin of segment rect
drawBasePoint; // origin of rect to fill on canvas
- QRect r;
+ TQRect r;
for (; api != apEnd; ++api) {
rectToFill = api->rect;
basePoint = api->basePoint;
@@ -891,7 +891,7 @@ void CompositionView::drawAreaAudioPreviews(QPainter * p, const QRect& clipRect)
}
}
-void CompositionView::drawAreaArtifacts(QPainter * p, const QRect& clipRect)
+void CompositionView::drawAreaArtifacts(TQPainter * p, const TQRect& clipRect)
{
//
// Playback Pointer
@@ -938,10 +938,10 @@ void CompositionView::drawAreaArtifacts(QPainter * p, const QRect& clipRect)
}
}
-void CompositionView::drawGuides(QPainter * p, const QRect& /*clipRect*/)
+void CompositionView::drawGuides(TQPainter * p, const TQRect& /*clipRect*/)
{
// no need to check for clipping, these guides are meant to follow the mouse cursor
- QPoint guideOrig(m_topGuidePos, m_foreGuidePos);
+ TQPoint guideOrig(m_topGuidePos, m_foreGuidePos);
p->save();
p->setPen(m_guideColor);
@@ -950,15 +950,15 @@ void CompositionView::drawGuides(QPainter * p, const QRect& /*clipRect*/)
p->restore();
}
-void CompositionView::drawCompRect(const CompositionRect& r, QPainter *p, const QRect& clipRect,
+void CompositionView::drawCompRect(const CompositionRect& r, TQPainter *p, const TQRect& clipRect,
int intersectLvl, bool fill)
{
p->save();
- QBrush brush = r.getBrush();
+ TQBrush brush = r.getBrush();
if (r.isRepeating()) {
- QColor brushColor = brush.color();
+ TQColor brushColor = brush.color();
brush.setColor(brushColor.light(150));
}
@@ -975,7 +975,7 @@ void CompositionView::drawCompRect(const CompositionRect& r, QPainter *p, const
// draw 'start' rectangle with original brush
//
- QRect startRect = r;
+ TQRect startRect = r;
startRect.setWidth(repeatMarks[0] - r.x());
p->setBrush(r.getBrush());
drawRect(startRect, p, clipRect, r.isSelected(), intersectLvl, fill);
@@ -992,7 +992,7 @@ void CompositionView::drawCompRect(const CompositionRect& r, QPainter *p, const
break;
if (pos >= clipRect.left()) {
- QPoint p1(pos, r.y() + penWidth),
+ TQPoint p1(pos, r.y() + penWidth),
p2(pos, r.y() + r.height() - penWidth - 1);
// RG_DEBUG << "CompositionView::drawCompRect() : drawing repeat mark at "
@@ -1007,7 +1007,7 @@ void CompositionView::drawCompRect(const CompositionRect& r, QPainter *p, const
p->restore();
}
-void CompositionView::drawCompRectLabel(const CompositionRect& r, QPainter *p, const QRect& clipRect)
+void CompositionView::drawCompRectLabel(const CompositionRect& r, TQPainter *p, const TQRect& clipRect)
{
// draw segment label
//
@@ -1017,10 +1017,10 @@ void CompositionView::drawCompRectLabel(const CompositionRect& r, QPainter *p, c
p->save();
p->setPen(GUIPalette::getColour(GUIPalette::SegmentLabel));
p->setBrush(white);
- QRect textRect(r);
+ TQRect textRect(r);
textRect.setX(textRect.x() + 3);
- QString label = " " + r.getLabel() + " ";
- QRect textBoundingRect = p->boundingRect(textRect, Qt::AlignLeft | Qt::AlignVCenter, label);
+ TQString label = " " + r.getLabel() + " ";
+ TQRect textBoundingRect = p->boundingRect(textRect, Qt::AlignLeft | Qt::AlignVCenter, label);
p->drawRect(textBoundingRect & r);
p->drawText(textRect, Qt::AlignLeft | Qt::AlignVCenter, label);
p->restore();
@@ -1030,13 +1030,13 @@ void CompositionView::drawCompRectLabel(const CompositionRect& r, QPainter *p, c
p->save();
- QFont font;
+ TQFont font;
font.setPixelSize(r.height() / 2.2);
- font.setWeight(QFont::Bold);
+ font.setWeight(TQFont::Bold);
font.setItalic(false);
p->setFont(font);
- QRect labelRect = QRect
+ TQRect labelRect = QRect
(r.x(),
r.y() + ((r.height() - p->fontMetrics().height()) / 2) + 1,
r.width(),
@@ -1045,8 +1045,8 @@ void CompositionView::drawCompRectLabel(const CompositionRect& r, QPainter *p, c
int x = labelRect.x() + p->fontMetrics().width('x');
int y = labelRect.y();
- QBrush brush = r.getBrush();
- QColor surroundColour = brush.color().light(110);
+ TQBrush brush = r.getBrush();
+ TQColor surroundColour = brush.color().light(110);
int h, s, v;
surroundColour.hsv(&h, &s, &v);
@@ -1090,7 +1090,7 @@ void CompositionView::drawCompRectLabel(const CompositionRect& r, QPainter *p, c
#endif
}
-void CompositionView::drawRect(const QRect& r, QPainter *p, const QRect& clipRect,
+void CompositionView::drawRect(const TQRect& r, TQPainter *p, const TQRect& clipRect,
bool isSelected, int intersectLvl, bool fill)
{
// RG_DEBUG << "CompositionView::drawRect : intersectLvl = " << intersectLvl
@@ -1101,22 +1101,22 @@ void CompositionView::drawRect(const QRect& r, QPainter *p, const QRect& clipRec
p->save();
- QRect rect = r;
+ TQRect rect = r;
if (fill) {
if (isSelected) {
- QColor fillColor = p->brush().color();
+ TQColor fillColor = p->brush().color();
fillColor = fillColor.dark(200);
- QBrush b = p->brush();
+ TQBrush b = p->brush();
b.setColor(fillColor);
p->setBrush(b);
// RG_DEBUG << "CompositionView::drawRect : selected color : " << fillColor << endl;
}
if (intersectLvl > 0) {
- QColor fillColor = p->brush().color();
+ TQColor fillColor = p->brush().color();
fillColor = fillColor.dark((intersectLvl) * 105);
- QBrush b = p->brush();
+ TQBrush b = p->brush();
b.setColor(fillColor);
p->setBrush(b);
// RG_DEBUG << "CompositionView::drawRect : intersected color : " << fillColor << " isSelected : " << isSelected << endl;
@@ -1126,7 +1126,7 @@ void CompositionView::drawRect(const QRect& r, QPainter *p, const QRect& clipRec
}
// Paint using the small coordinates...
- QRect intersection = rect.intersect(clipRect);
+ TQRect intersection = rect.intersect(clipRect);
if (clipRect.contains(rect)) {
p->drawRect(rect);
@@ -1166,9 +1166,9 @@ void CompositionView::drawRect(const QRect& r, QPainter *p, const QRect& clipRec
p->restore();
}
-QColor CompositionView::mixBrushes(QBrush a, QBrush b)
+TQColor CompositionView::mixBrushes(TQBrush a, TQBrush b)
{
- QColor ac = a.color(), bc = b.color();
+ TQColor ac = a.color(), bc = b.color();
int aR = ac.red(), aG = ac.green(), aB = ac.blue(),
bR = bc.red(), bG = bc.green(), bB = ac.blue();
@@ -1179,7 +1179,7 @@ QColor CompositionView::mixBrushes(QBrush a, QBrush b)
}
void CompositionView::drawIntersections(const CompositionModel::rectcontainer& rects,
- QPainter * p, const QRect& clipRect)
+ TQPainter * p, const TQRect& clipRect)
{
if (! (rects.size() > 1))
return ;
@@ -1262,7 +1262,7 @@ void CompositionView::drawIntersections(const CompositionModel::rectcontainer& r
}
-void CompositionView::drawPointer(QPainter *p, const QRect& clipRect)
+void CompositionView::drawPointer(TQPainter *p, const TQRect& clipRect)
{
// RG_DEBUG << "CompositionView::drawPointer: clipRect "
// << clipRect.x() << "," << clipRect.y() << " " << clipRect.width()
@@ -1277,11 +1277,11 @@ void CompositionView::drawPointer(QPainter *p, const QRect& clipRect)
}
-void CompositionView::drawTextFloat(QPainter *p, const QRect& clipRect)
+void CompositionView::drawTextFloat(TQPainter *p, const TQRect& clipRect)
{
- QFontMetrics metrics(p->fontMetrics());
+ TQFontMetrics metrics(p->fontMetrics());
- QRect bound = p->boundingRect(0, 0, 300, metrics.height() + 6, AlignAuto, m_textFloatText);
+ TQRect bound = p->boundingRect(0, 0, 300, metrics.height() + 6, AlignAuto, m_textFloatText);
p->save();
@@ -1290,7 +1290,7 @@ void CompositionView::drawTextFloat(QPainter *p, const QRect& clipRect)
bound.setTop(bound.top() - 2);
bound.setBottom(bound.bottom() + 2);
- QPoint pos(m_textFloatPos);
+ TQPoint pos(m_textFloatPos);
if (pos.y() < 0 && getModel()) {
if (pos.y() + bound.height() < 0) {
pos.setY(pos.y() + getModel()->grid().getYSnap() * 3);
@@ -1316,7 +1316,7 @@ void CompositionView::drawTextFloat(QPainter *p, const QRect& clipRect)
p->restore();
}
-bool CompositionView::event(QEvent* e)
+bool CompositionView::event(TQEvent* e)
{
if (e->type() == AudioPreviewThread::AudioPreviewQueueEmpty) {
RG_DEBUG << "CompositionView::event - AudioPreviewQueueEmpty\n";
@@ -1328,7 +1328,7 @@ bool CompositionView::event(QEvent* e)
return RosegardenScrollView::event(e);
}
-void CompositionView::enterEvent(QEvent *e)
+void CompositionView::enterEvent(TQEvent *e)
{
kapp->config()->setGroup(GeneralOptionsConfigGroup);
if (!kapp->config()->readBoolEntry("toolcontexthelp", true)) return;
@@ -1337,13 +1337,13 @@ void CompositionView::enterEvent(QEvent *e)
m_contextHelpShown = true;
}
-void CompositionView::leaveEvent(QEvent *e)
+void CompositionView::leaveEvent(TQEvent *e)
{
emit showContextHelp("");
m_contextHelpShown = false;
}
-void CompositionView::slotToolHelpChanged(const QString &text)
+void CompositionView::slotToolHelpChanged(const TQString &text)
{
if (m_toolContextHelp == text) return;
m_toolContextHelp = text;
@@ -1354,7 +1354,7 @@ void CompositionView::slotToolHelpChanged(const QString &text)
if (m_contextHelpShown) emit showContextHelp(text);
}
-void CompositionView::contentsMousePressEvent(QMouseEvent* e)
+void CompositionView::contentsMousePressEvent(TQMouseEvent* e)
{
Qt::ButtonState bs = e->state();
slotSetSelectCopy((bs & Qt::ControlButton) != 0);
@@ -1385,7 +1385,7 @@ void CompositionView::contentsMousePressEvent(QMouseEvent* e)
}
}
-void CompositionView::contentsMouseReleaseEvent(QMouseEvent* e)
+void CompositionView::contentsMouseReleaseEvent(TQMouseEvent* e)
{
RG_DEBUG << "CompositionView::contentsMouseReleaseEvent()\n";
@@ -1399,7 +1399,7 @@ void CompositionView::contentsMouseReleaseEvent(QMouseEvent* e)
m_tool->handleMouseButtonRelease(e);
}
-void CompositionView::contentsMouseDoubleClickEvent(QMouseEvent* e)
+void CompositionView::contentsMouseDoubleClickEvent(TQMouseEvent* e)
{
m_currentItem = getFirstItemAt(e->pos());
@@ -1429,7 +1429,7 @@ void CompositionView::contentsMouseDoubleClickEvent(QMouseEvent* e)
}
}
-void CompositionView::contentsMouseMoveEvent(QMouseEvent* e)
+void CompositionView::contentsMouseMoveEvent(TQMouseEvent* e)
{
if (!m_tool)
return ;
@@ -1500,7 +1500,7 @@ void CompositionView::setPointerPos(int pos)
if (deltaW <= m_pointerPen.width() * 2) { // use one rect instead of two separate ones
- QRect updateRect
+ TQRect updateRect
(std::min(m_pointerPos, oldPos) - m_pointerPen.width(), 0,
deltaW + m_pointerPen.width() * 2, contentsHeight());
@@ -1509,11 +1509,11 @@ void CompositionView::setPointerPos(int pos)
} else {
slotArtifactsDrawBufferNeedsRefresh
- (QRect(m_pointerPos - m_pointerPen.width(), 0,
+ (TQRect(m_pointerPos - m_pointerPen.width(), 0,
m_pointerPen.width() * 2, contentsHeight()));
slotArtifactsDrawBufferNeedsRefresh
- (QRect(oldPos - m_pointerPen.width(), 0,
+ (TQRect(oldPos - m_pointerPen.width(), 0,
m_pointerPen.width() * 2, contentsHeight()));
}
}
@@ -1525,7 +1525,7 @@ void CompositionView::setGuidesPos(int x, int y)
slotArtifactsDrawBufferNeedsRefresh();
}
-void CompositionView::setGuidesPos(const QPoint& p)
+void CompositionView::setGuidesPos(const TQPoint& p)
{
m_topGuidePos = p.x();
m_foreGuidePos = p.y();
@@ -1538,20 +1538,20 @@ void CompositionView::setDrawGuides(bool d)
slotArtifactsDrawBufferNeedsRefresh();
}
-void CompositionView::setTmpRect(const QRect& r)
+void CompositionView::setTmpRect(const TQRect& r)
{
setTmpRect(r, m_tmpRectFill);
}
-void CompositionView::setTmpRect(const QRect& r, const QColor &c)
+void CompositionView::setTmpRect(const TQRect& r, const TQColor &c)
{
- QRect pRect = m_tmpRect;
+ TQRect pRect = m_tmpRect;
m_tmpRect = r;
m_tmpRectFill = c;
slotUpdateSegmentsDrawBuffer(m_tmpRect | pRect);
}
-void CompositionView::setTextFloat(int x, int y, const QString &text)
+void CompositionView::setTextFloat(int x, int y, const TQString &text)
{
m_textFloatPos.setX(x);
m_textFloatPos.setY(y);
@@ -1562,7 +1562,7 @@ void CompositionView::setTextFloat(int x, int y, const QString &text)
// most of the time when the floating text is drawn
// we want to update a larger part of the view
// so don't update here
- // QRect r = fontMetrics().boundingRect(x, y, 300, 40, AlignAuto, m_textFloatText);
+ // TQRect r = fontMetrics().boundingRect(x, y, 300, 40, AlignAuto, m_textFloatText);
// slotUpdateSegmentsDrawBuffer(r);
@@ -1584,7 +1584,7 @@ CompositionView::slotTextFloatTimeout()
{
hideTextFloat();
slotArtifactsDrawBufferNeedsRefresh();
- // rgapp->slotSetStatusMessage(QString::null);
+ // rgapp->slotSetStatusMessage(TQString::null);
}
}