From 458efa7b0c935cbaafa2791021a5f8f7241aa876 Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 2 May 2011 22:38:52 +0000 Subject: 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 --- src/gui/rulers/ChordNameRuler.cpp | 50 ++++++------- src/gui/rulers/ChordNameRuler.h | 11 +-- src/gui/rulers/ControlItem.cpp | 8 +- src/gui/rulers/ControlItem.h | 4 +- src/gui/rulers/ControlRuler.cpp | 44 +++++------ src/gui/rulers/ControlRuler.h | 9 ++- src/gui/rulers/ControlSelector.cpp | 6 +- src/gui/rulers/ControlSelector.h | 4 +- src/gui/rulers/ControllerEventsRuler.cpp | 66 ++++++++--------- src/gui/rulers/ControllerEventsRuler.h | 8 +- src/gui/rulers/LoopRuler.cpp | 30 ++++---- src/gui/rulers/LoopRuler.h | 7 +- src/gui/rulers/MarkerRuler.cpp | 44 +++++------ src/gui/rulers/MarkerRuler.h | 9 ++- src/gui/rulers/PercussionPitchRuler.cpp | 24 +++--- src/gui/rulers/PercussionPitchRuler.h | 7 +- src/gui/rulers/PitchRuler.cpp | 16 ++-- src/gui/rulers/PitchRuler.h | 9 ++- src/gui/rulers/PropertyBox.cpp | 12 +-- src/gui/rulers/PropertyBox.h | 9 ++- src/gui/rulers/PropertyControlRuler.cpp | 48 ++++++------ src/gui/rulers/PropertyControlRuler.h | 4 +- src/gui/rulers/PropertyViewRuler.cpp | 18 ++--- src/gui/rulers/PropertyViewRuler.h | 7 +- src/gui/rulers/RawNoteRuler.cpp | 52 ++++++------- src/gui/rulers/RawNoteRuler.h | 15 ++-- src/gui/rulers/StandardRuler.cpp | 4 +- src/gui/rulers/StandardRuler.h | 5 +- src/gui/rulers/TempoColour.cpp | 2 +- src/gui/rulers/TempoRuler.cpp | 122 +++++++++++++++---------------- src/gui/rulers/TempoRuler.h | 11 +-- src/gui/rulers/TextRuler.cpp | 16 ++-- src/gui/rulers/TextRuler.h | 9 ++- src/gui/rulers/VelocityColour.h | 2 +- 34 files changed, 352 insertions(+), 340 deletions(-) (limited to 'src/gui/rulers') diff --git a/src/gui/rulers/ChordNameRuler.cpp b/src/gui/rulers/ChordNameRuler.cpp index 001d5fd..121d911 100644 --- a/src/gui/rulers/ChordNameRuler.cpp +++ b/src/gui/rulers/ChordNameRuler.cpp @@ -62,9 +62,9 @@ ChordNameRuler::ChordNameRuler(RulerScale *rulerScale, RosegardenGUIDoc *doc, double xorigin, int height, - TQWidget *parent, + TQWidget *tqparent, const char *name) : - TQWidget(parent, name), + TQWidget(tqparent, name), m_xorigin(xorigin), m_height(height), m_currentXOffset(0), @@ -103,9 +103,9 @@ ChordNameRuler::ChordNameRuler(RulerScale *rulerScale, std::vector &segments, double xorigin, int height, - TQWidget *parent, + TQWidget *tqparent, const char *name) : - TQWidget(parent, name), + TQWidget(tqparent, name), m_xorigin(xorigin), m_height(height), m_currentXOffset(0), @@ -182,15 +182,15 @@ ChordNameRuler::slotScrollHoriz(int x) if (dx > 0) { // moving right, so the existing stuff moves left bitBlt(this, 0, 0, this, dx, 0, w - dx, h); - repaint(w - dx, 0, dx, h); + tqrepaint(w - dx, 0, dx, h); } else { // moving left, so the existing stuff moves right bitBlt(this, -dx, 0, this, 0, 0, w + dx, h); - repaint(0, 0, -dx, h); + tqrepaint(0, 0, -dx, h); } } -QSize -ChordNameRuler::sizeHint() const +TQSize +ChordNameRuler::tqsizeHint() const { double width = m_rulerScale->getBarPosition(m_rulerScale->getLastVisibleBar()) + @@ -203,8 +203,8 @@ ChordNameRuler::sizeHint() const return res; } -QSize -ChordNameRuler::minimumSizeHint() const +TQSize +ChordNameRuler::tqminimumSizeHint() const { double firstBarWidth = m_rulerScale->getBarWidth(0); TQSize res = TQSize(int(firstBarWidth), m_height); @@ -231,8 +231,8 @@ ChordNameRuler::recalculate(timeT from, timeT to) } else if (m_regetSegmentsOnChange) { - RefreshStatus &rs = - m_composition->getRefreshStatus(m_compositionRefreshStatusId); + RefreshtqStatus &rs = + m_composition->getRefreshtqStatus(m_compositionRefreshStatusId); if (rs.needsRefresh()) { rs.setNeedsRefresh(false); @@ -304,15 +304,15 @@ ChordNameRuler::recalculate(timeT from, timeT to) if (m_segments.empty()) return ; - SegmentRefreshStatus overallStatus; - overallStatus.setNeedsRefresh(false); + SegmentRefreshtqStatus overalltqStatus; + overalltqStatus.setNeedsRefresh(false); for (SegmentRefreshMap::iterator i = m_segments.begin(); i != m_segments.end(); ++i) { - SegmentRefreshStatus &status = - i->first->getRefreshStatus(i->second); + SegmentRefreshtqStatus &status = + i->first->getRefreshtqStatus(i->second); if (status.needsRefresh()) { - overallStatus.push(status.from(), status.to()); + overalltqStatus.push(status.from(), status.to()); } } @@ -326,17 +326,17 @@ ChordNameRuler::recalculate(timeT from, timeT to) if (from == to) { NOTATION_DEBUG << "ChordNameRuler::recalculate: from==to, recalculating all" << endl; level = RecalcWhole; - } else if (overallStatus.from() == overallStatus.to()) { - NOTATION_DEBUG << "ChordNameRuler::recalculate: overallStatus.from==overallStatus.to, ignoring" << endl; + } else if (overalltqStatus.from() == overalltqStatus.to()) { + NOTATION_DEBUG << "ChordNameRuler::recalculate: overalltqStatus.from==overalltqStatus.to, ignoring" << endl; level = RecalcNone; - } else if (overallStatus.from() >= from && overallStatus.to() <= to) { - NOTATION_DEBUG << "ChordNameRuler::recalculate: change is " << overallStatus.from() << "->" << overallStatus.to() << ", I show " << from << "->" << to << ", recalculating visible area" << endl; + } else if (overalltqStatus.from() >= from && overalltqStatus.to() <= to) { + NOTATION_DEBUG << "ChordNameRuler::recalculate: change is " << overalltqStatus.from() << "->" << overalltqStatus.to() << ", I show " << from << "->" << to << ", recalculating visible area" << endl; level = RecalcVisible; - } else if (overallStatus.from() >= to || overallStatus.to() <= from) { - NOTATION_DEBUG << "ChordNameRuler::recalculate: change is " << overallStatus.from() << "->" << overallStatus.to() << ", I show " << from << "->" << to << ", ignoring" << endl; + } else if (overalltqStatus.from() >= to || overalltqStatus.to() <= from) { + NOTATION_DEBUG << "ChordNameRuler::recalculate: change is " << overalltqStatus.from() << "->" << overalltqStatus.to() << ", I show " << from << "->" << to << ", ignoring" << endl; level = RecalcNone; } else { - NOTATION_DEBUG << "ChordNameRuler::recalculate: change is " << overallStatus.from() << "->" << overallStatus.to() << ", I show " << from << "->" << to << ", recalculating whole" << endl; + NOTATION_DEBUG << "ChordNameRuler::recalculate: change is " << overalltqStatus.from() << "->" << overalltqStatus.to() << ", I show " << from << "->" << to << ", recalculating whole" << endl; level = RecalcWhole; } } @@ -346,7 +346,7 @@ ChordNameRuler::recalculate(timeT from, timeT to) for (SegmentRefreshMap::iterator i = m_segments.begin(); i != m_segments.end(); ++i) { - i->first->getRefreshStatus(i->second).setNeedsRefresh(false); + i->first->getRefreshtqStatus(i->second).setNeedsRefresh(false); } if (!m_currentSegment) { //!!! arbitrary, must do better diff --git a/src/gui/rulers/ChordNameRuler.h b/src/gui/rulers/ChordNameRuler.h index 988b1f4..1b77ae0 100644 --- a/src/gui/rulers/ChordNameRuler.h +++ b/src/gui/rulers/ChordNameRuler.h @@ -54,9 +54,10 @@ class Composition; * describing the chords in a composition. */ -class ChordNameRuler : public QWidget +class ChordNameRuler : public TQWidget { Q_OBJECT + TQ_OBJECT public: /** @@ -69,7 +70,7 @@ public: RosegardenGUIDoc *doc, double xorigin = 0.0, int height = 0, - TQWidget* parent = 0, + TQWidget* tqparent = 0, const char *name = 0); /** @@ -83,7 +84,7 @@ public: std::vector &segments, double xorigin = 0.0, int height = 0, - TQWidget* parent = 0, + TQWidget* tqparent = 0, const char *name = 0); ~ChordNameRuler(); @@ -97,8 +98,8 @@ public: // may have one of these (to avoid using percussion tracks in chords): void setStudio(Studio *studio); - virtual TQSize sizeHint() const; - virtual TQSize minimumSizeHint() const; + virtual TQSize tqsizeHint() const; + virtual TQSize tqminimumSizeHint() const; void setMinimumWidth(int width) { m_width = width; } diff --git a/src/gui/rulers/ControlItem.cpp b/src/gui/rulers/ControlItem.cpp index 8eb17ed..332542e 100644 --- a/src/gui/rulers/ControlItem.cpp +++ b/src/gui/rulers/ControlItem.cpp @@ -44,8 +44,8 @@ ControlItem::ControlItem(ControlRuler* ruler, ElementAdapter* elementAdapter, width = DefaultWidth/4; // avoid invisible zero-duration items } setWidth(width); - setPen(TQPen(Qt::black, BorderThickness)); - setBrush(Qt::blue); + setPen(TQPen(TQt::black, BorderThickness)); + setBrush(TQt::blue); setX(xx); setY(canvas()->height()); @@ -186,8 +186,8 @@ void ControlItem::setSelected(bool s) { TQCanvasItem::setSelected(s); - if (s) setPen(TQPen(Qt::red, BorderThickness)); - else setPen(TQPen(Qt::black, BorderThickness)); + if (s) setPen(TQPen(TQt::red, BorderThickness)); + else setPen(TQPen(TQt::black, BorderThickness)); canvas()->update(); } diff --git a/src/gui/rulers/ControlItem.h b/src/gui/rulers/ControlItem.h index e90a06d..2aea4b8 100644 --- a/src/gui/rulers/ControlItem.h +++ b/src/gui/rulers/ControlItem.h @@ -29,7 +29,7 @@ namespace Rosegarden { class ControlRuler; class ElementAdapter; -class ControlItem : public QCanvasRectangle +class ControlItem : public TQCanvasRectangle { public: ControlItem(ControlRuler* controlRuler, @@ -54,7 +54,7 @@ public: virtual void setSelected(bool yes); - /// recompute height according to represented value prior to a canvas repaint + /// recompute height according to represented value prior to a canvas tqrepaint virtual void updateFromValue(); /// update value according to height after a user edit diff --git a/src/gui/rulers/ControlRuler.cpp b/src/gui/rulers/ControlRuler.cpp index 7fea1fc..c728093 100644 --- a/src/gui/rulers/ControlRuler.cpp +++ b/src/gui/rulers/ControlRuler.cpp @@ -62,11 +62,11 @@ const int ControlRuler::ItemHeightRange = 64; ControlRuler::ControlRuler(Segment *segment, RulerScale* rulerScale, - EditViewBase* parentView, - TQCanvas* c, TQWidget* parent, + EditViewBase* tqparentView, + TQCanvas* c, TQWidget* tqparent, const char* name, WFlags f) : - RosegardenCanvasView(c, parent, name, f), - m_parentEditView(parentView), + RosegardenCanvasView(c, tqparent, name, f), + m_tqparentEditView(tqparentView), m_mainHorizontalScrollBar(0), m_rulerScale(rulerScale), m_eventSelection(new EventSelection(*segment)), @@ -84,12 +84,12 @@ ControlRuler::ControlRuler(Segment *segment, { setHScrollBarMode(TQScrollView::AlwaysOff); - m_selectionRect->setPen(Qt::red); + m_selectionRect->setPen(TQt::red); - setFixedHeight(sizeHint().height()); + setFixedHeight(tqsizeHint().height()); connect(this, TQT_SIGNAL(stateChange(const TQString&, bool)), - m_parentEditView, TQT_SLOT(slotStateChanged(const TQString&, bool))); + m_tqparentEditView, TQT_SLOT(slotStateChanged(const TQString&, bool))); m_numberFloat = new TextFloat(this); m_numberFloat->hide(); @@ -113,7 +113,7 @@ void ControlRuler::slotUpdate() canvas()->setAllChanged(); // TODO: be a bit more subtle, call setChanged(