diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-02 22:38:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-02 22:38:52 +0000 |
commit | 458efa7b0c935cbaafa2791021a5f8f7241aa876 (patch) | |
tree | 624583f2873febe23770bee3fa94b5c24bd59f4f /src/gui/editors/eventlist | |
parent | 747037b72944ae2c02962b7c5c96e0a7f8852e38 (diff) | |
download | rosegarden-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/eventlist')
-rw-r--r-- | src/gui/editors/eventlist/EventView.cpp | 150 | ||||
-rw-r--r-- | src/gui/editors/eventlist/EventView.h | 3 | ||||
-rw-r--r-- | src/gui/editors/eventlist/EventViewItem.h | 44 | ||||
-rw-r--r-- | src/gui/editors/eventlist/TrivialVelocityDialog.cpp | 4 | ||||
-rw-r--r-- | src/gui/editors/eventlist/TrivialVelocityDialog.h | 2 |
5 files changed, 102 insertions, 101 deletions
diff --git a/src/gui/editors/eventlist/EventView.cpp b/src/gui/editors/eventlist/EventView.cpp index cdf73cc..0d9b9c5 100644 --- a/src/gui/editors/eventlist/EventView.cpp +++ b/src/gui/editors/eventlist/EventView.cpp @@ -97,8 +97,8 @@ EventView::m_lastSetEventFilter = -1; EventView::EventView(RosegardenGUIDoc *doc, std::vector<Segment *> segments, - TQWidget *parent): - EditViewBase(doc, segments, 2, parent, "eventview"), + TQWidget *tqparent): + EditViewBase(doc, segments, 2, tqparent, "eventview"), m_eventFilter(Note | Text | SystemExclusive | Controller | ProgramChange | PitchBend | Indication | Other), m_menu(0) @@ -126,7 +126,7 @@ EventView::EventView(RosegardenGUIDoc *doc, // define some note filtering buttons in a group // m_filterGroup = - new TQButtonGroup(1, Horizontal, i18n("Event filters"), getCentralWidget()); + new TQButtonGroup(1, Qt::Horizontal, i18n("Event filters"), getCentralWidget()); m_noteCheckBox = new TQCheckBox(i18n("Note"), m_filterGroup); m_programCheckBox = new TQCheckBox(i18n("Program Change"), m_filterGroup); @@ -157,44 +157,44 @@ EventView::EventView(RosegardenGUIDoc *doc, TriggerSegmentRec *rec = segments[0]->getComposition()->getTriggerSegmentRec(id); - TQGroupBox *groupBox = new QGroupBox - (1, Horizontal, i18n("Triggered Segment Properties"), getCentralWidget()); + TQGroupBox *groupBox = new TQGroupBox + (1, Qt::Horizontal, i18n("Triggered Segment Properties"), getCentralWidget()); TQFrame *frame = new TQFrame(groupBox); - TQGridLayout *layout = new TQGridLayout(frame, 5, 3, 5, 5); + TQGridLayout *tqlayout = new TQGridLayout(frame, 5, 3, 5, 5); - layout->addWidget(new TQLabel(i18n("Label: "), frame), 0, 0); + tqlayout->addWidget(new TQLabel(i18n("Label: "), frame), 0, 0); TQString label = strtoqstr(segments[0]->getLabel()); if (label == "") label = i18n("<no label>"); m_triggerName = new TQLabel(label, frame); - layout->addWidget(m_triggerName, 0, 1); + tqlayout->addWidget(m_triggerName, 0, 1); TQPushButton *editButton = new TQPushButton(i18n("edit"), frame); - layout->addWidget(editButton, 0, 2); - connect(editButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditTriggerName())); + tqlayout->addWidget(editButton, 0, 2); + connect(editButton, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotEditTriggerName())); - layout->addWidget(new TQLabel(i18n("Base pitch: "), frame), 1, 0); - m_triggerPitch = new TQLabel(TQString("%1").arg(rec->getBasePitch()), frame); - layout->addWidget(m_triggerPitch, 1, 1); + tqlayout->addWidget(new TQLabel(i18n("Base pitch: "), frame), 1, 0); + m_triggerPitch = new TQLabel(TQString("%1").tqarg(rec->getBasePitch()), frame); + tqlayout->addWidget(m_triggerPitch, 1, 1); editButton = new TQPushButton(i18n("edit"), frame); - layout->addWidget(editButton, 1, 2); - connect(editButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditTriggerPitch())); + tqlayout->addWidget(editButton, 1, 2); + connect(editButton, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotEditTriggerPitch())); - layout->addWidget(new TQLabel(i18n("Base velocity: "), frame), 2, 0); - m_triggerVelocity = new TQLabel(TQString("%1").arg(rec->getBaseVelocity()), frame); - layout->addWidget(m_triggerVelocity, 2, 1); + tqlayout->addWidget(new TQLabel(i18n("Base velocity: "), frame), 2, 0); + m_triggerVelocity = new TQLabel(TQString("%1").tqarg(rec->getBaseVelocity()), frame); + tqlayout->addWidget(m_triggerVelocity, 2, 1); editButton = new TQPushButton(i18n("edit"), frame); - layout->addWidget(editButton, 2, 2); - connect(editButton, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotEditTriggerVelocity())); + tqlayout->addWidget(editButton, 2, 2); + connect(editButton, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotEditTriggerVelocity())); /*!!! Comment out these two options, which are not yet used anywhere else -- intended for use with library ornaments, not yet implemented - layout->addWidget(new TQLabel(i18n("Default timing: "), frame), 3, 0); + tqlayout->addWidget(new TQLabel(i18n("Default timing: "), frame), 3, 0); KComboBox *adjust = new KComboBox(frame); - layout->addMultiCellWidget(adjust, 3, 3, 1, 2); + tqlayout->addMultiCellWidget(adjust, 3, 3, 1, 2); adjust->insertItem(i18n("As stored")); adjust->insertItem(i18n("Truncate if longer than note")); adjust->insertItem(i18n("End at same time as note")); @@ -203,7 +203,7 @@ EventView::EventView(RosegardenGUIDoc *doc, std::string timing = rec->getDefaultTimeAdjust(); if (timing == BaseProperties::TRIGGER_SEGMENT_ADJUST_NONE) { adjust->setCurrentItem(0); - } else if (timing == BaseProperties::TRIGGER_SEGMENT_ADJUST_SQUISH) { + } else if (timing == BaseProperties::TRIGGER_SEGMENT_ADJUST_STQUISH) { adjust->setCurrentItem(3); } else if (timing == BaseProperties::TRIGGER_SEGMENT_ADJUST_SYNC_START) { adjust->setCurrentItem(1); @@ -211,12 +211,12 @@ EventView::EventView(RosegardenGUIDoc *doc, adjust->setCurrentItem(2); } - connect(adjust, TQT_SIGNAL(activated(int)), this, TQT_SLOT(slotTriggerTimeAdjustChanged(int))); + connect(adjust, TQT_SIGNAL(activated(int)), TQT_TQOBJECT(this), TQT_SLOT(slotTriggerTimeAdjustChanged(int))); TQCheckBox *retune = new TQCheckBox(i18n("Adjust pitch to trigger note by default"), frame); retune->setChecked(rec->getDefaultRetune()); - connect(retune, TQT_SIGNAL(clicked()), this, TQT_SLOT(slotTriggerRetuneChanged())); - layout->addMultiCellWidget(retune, 4, 4, 1, 2); + connect(retune, TQT_SIGNAL(clicked()), TQT_TQOBJECT(this), TQT_SLOT(slotTriggerRetuneChanged())); + tqlayout->addMultiCellWidget(retune, 4, 4, 1, 2); */ @@ -387,7 +387,7 @@ EventView::applyLayout(int /*staffNo*/) int p = (*it)->get <Int>(BaseProperties::PITCH); pitchStr = TQString("%1 %2 ") - .arg(p).arg(MidiPitchLabel(p).getQString()); + .tqarg(p).tqarg(MidiPitchLabel(p).getTQString()); } else if ((*it)->isa(Note::EventType)) { pitchStr = "<not set>"; } @@ -601,7 +601,7 @@ EventView::makeInitialSelection(timeT time) } } -QString +TQString EventView::makeTimeString(timeT time, int timeMode) { switch (timeMode) { @@ -613,31 +613,31 @@ EventView::makeTimeString(timeT time, int timeMode) (time, bar, beat, fraction, remainder); ++bar; return TQString("%1%2%3-%4%5-%6%7-%8%9 ") - .arg(bar / 100) - .arg((bar % 100) / 10) - .arg(bar % 10) - .arg(beat / 10) - .arg(beat % 10) - .arg(fraction / 10) - .arg(fraction % 10) - .arg(remainder / 10) - .arg(remainder % 10); + .tqarg(bar / 100) + .tqarg((bar % 100) / 10) + .tqarg(bar % 10) + .tqarg(beat / 10) + .tqarg(beat % 10) + .tqarg(fraction / 10) + .tqarg(fraction % 10) + .tqarg(remainder / 10) + .tqarg(remainder % 10); } case 1: // real time { RealTime rt = getDocument()->getComposition().getElapsedRealTime(time); - // return TQString("%1 ").arg(rt.toString().c_str()); - return TQString("%1 ").arg(rt.toText().c_str()); + // return TQString("%1 ").tqarg(rt.toString().c_str()); + return TQString("%1 ").tqarg(rt.toText().c_str()); } default: - return TQString("%1 ").arg(time); + return TQString("%1 ").tqarg(time); } } -QString +TQString EventView::makeDurationString(timeT time, timeT duration, int timeMode) { @@ -649,15 +649,15 @@ EventView::makeDurationString(timeT time, getDocument()->getComposition().getMusicalTimeForDuration (time, duration, bar, beat, fraction, remainder); return TQString("%1%2%3-%4%5-%6%7-%8%9 ") - .arg(bar / 100) - .arg((bar % 100) / 10) - .arg(bar % 10) - .arg(beat / 10) - .arg(beat % 10) - .arg(fraction / 10) - .arg(fraction % 10) - .arg(remainder / 10) - .arg(remainder % 10); + .tqarg(bar / 100) + .tqarg((bar % 100) / 10) + .tqarg(bar % 10) + .tqarg(beat / 10) + .tqarg(beat % 10) + .tqarg(fraction / 10) + .tqarg(fraction % 10) + .tqarg(remainder / 10) + .tqarg(remainder % 10); } case 1: // real time @@ -665,12 +665,12 @@ EventView::makeDurationString(timeT time, RealTime rt = getDocument()->getComposition().getRealTimeDifference (time, time + duration); - // return TQString("%1 ").arg(rt.toString().c_str()); - return TQString("%1 ").arg(rt.toText().c_str()); + // return TQString("%1 ").tqarg(rt.toString().c_str()); + return TQString("%1 ").tqarg(rt.toText().c_str()); } default: - return TQString("%1 ").arg(duration); + return TQString("%1 ").tqarg(duration); } } @@ -719,7 +719,7 @@ EventView::slotEditTriggerPitch() if (dlg->exec() == TQDialog::Accepted) { addCommandToHistory(new SetTriggerSegmentBasePitchCommand (&getDocument()->getComposition(), id, dlg->getPitch())); - m_triggerPitch->setText(TQString("%1").arg(dlg->getPitch())); + m_triggerPitch->setText(TQString("%1").tqarg(dlg->getPitch())); } } @@ -737,14 +737,14 @@ EventView::slotEditTriggerVelocity() if (dlg->exec() == TQDialog::Accepted) { addCommandToHistory(new SetTriggerSegmentBaseVelocityCommand (&getDocument()->getComposition(), id, dlg->getVelocity())); - m_triggerVelocity->setText(TQString("%1").arg(dlg->getVelocity())); + m_triggerVelocity->setText(TQString("%1").tqarg(dlg->getVelocity())); } } void EventView::slotTriggerTimeAdjustChanged(int option) { - std::string adjust = BaseProperties::TRIGGER_SEGMENT_ADJUST_SQUISH; + std::string adjust = BaseProperties::TRIGGER_SEGMENT_ADJUST_STQUISH; switch (option) { @@ -758,7 +758,7 @@ EventView::slotTriggerTimeAdjustChanged(int option) adjust = BaseProperties::TRIGGER_SEGMENT_ADJUST_SYNC_END; break; case 3: - adjust = BaseProperties::TRIGGER_SEGMENT_ADJUST_SQUISH; + adjust = BaseProperties::TRIGGER_SEGMENT_ADJUST_STQUISH; break; default: @@ -1120,41 +1120,41 @@ EventView::setupActions() TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); TQIconSet icon(TQPixmap(pixmapDir + "/toolbar/event-insert.png")); - new KAction(i18n("&Insert Event"), icon, Key_I, this, + new KAction(i18n("&Insert Event"), icon, Key_I, TQT_TQOBJECT(this), TQT_SLOT(slotEditInsert()), actionCollection(), "insert"); TQCanvasPixmap pixmap(pixmapDir + "/toolbar/event-delete.png"); icon = TQIconSet(pixmap); - new KAction(i18n("&Delete Event"), icon, Key_Delete, this, + new KAction(i18n("&Delete Event"), icon, Key_Delete, TQT_TQOBJECT(this), TQT_SLOT(slotEditDelete()), actionCollection(), "delete"); pixmap.load(pixmapDir + "/toolbar/event-edit.png"); icon = TQIconSet(pixmap); - new KAction(i18n("&Edit Event"), icon, Key_E, this, + new KAction(i18n("&Edit Event"), icon, Key_E, TQT_TQOBJECT(this), TQT_SLOT(slotEditEvent()), actionCollection(), "edit_simple"); pixmap.load(pixmapDir + "/toolbar/event-edit-advanced.png"); icon = TQIconSet(pixmap); - new KAction(i18n("&Advanced Event Editor"), icon, Key_A, this, + new KAction(i18n("&Advanced Event Editor"), icon, Key_A, TQT_TQOBJECT(this), TQT_SLOT(slotEditEventAdvanced()), actionCollection(), "edit_advanced"); // icon = TQIconSet(TQCanvasPixmap(pixmapDir + "/toolbar/eventfilter.xpm")); - new KAction(i18n("&Filter Selection"), "filter", Key_F, this, + new KAction(i18n("&Filter Selection"), "filter", Key_F, TQT_TQOBJECT(this), TQT_SLOT(slotFilterSelection()), actionCollection(), "filter_selection"); - new KAction(i18n("Select &All"), Key_A + CTRL, this, + new KAction(i18n("Select &All"), Key_A + CTRL, TQT_TQOBJECT(this), TQT_SLOT(slotSelectAll()), actionCollection(), "select_all"); - new KAction(i18n("Clear Selection"), Key_Escape, this, + new KAction(i18n("Clear Selection"), Key_Escape, TQT_TQOBJECT(this), TQT_SLOT(slotClearSelection()), actionCollection(), "clear_selection"); @@ -1166,7 +1166,7 @@ EventView::setupActions() pixmap.load(pixmapDir + "/toolbar/time-musical.png"); icon = TQIconSet(pixmap); - action = new KRadioAction(i18n("&Musical Times"), icon, 0, this, + action = new KRadioAction(i18n("&Musical Times"), icon, 0, TQT_TQOBJECT(this), TQT_SLOT(slotMusicalTime()), actionCollection(), "time_musical"); action->setExclusiveGroup("timeMode"); @@ -1176,7 +1176,7 @@ EventView::setupActions() pixmap.load(pixmapDir + "/toolbar/time-real.png"); icon = TQIconSet(pixmap); - action = new KRadioAction(i18n("&Real Times"), icon, 0, this, + action = new KRadioAction(i18n("&Real Times"), icon, 0, TQT_TQOBJECT(this), TQT_SLOT(slotRealTime()), actionCollection(), "time_real"); action->setExclusiveGroup("timeMode"); @@ -1186,7 +1186,7 @@ EventView::setupActions() pixmap.load(pixmapDir + "/toolbar/time-raw.png"); icon = TQIconSet(pixmap); - action = new KRadioAction(i18n("Ra&w Times"), icon, 0, this, + action = new KRadioAction(i18n("Ra&w Times"), icon, 0, TQT_TQOBJECT(this), TQT_SLOT(slotRawTime()), actionCollection(), "time_raw"); action->setExclusiveGroup("timeMode"); @@ -1230,7 +1230,7 @@ EventView::initStatusBar() //sb->addWidget(m_selectionCounter); } -QSize +TQSize EventView::getViewSize() { return m_eventList->size(); @@ -1271,7 +1271,7 @@ EventView::getCurrentSegment() void EventView::slotModifyFilter(int button) { - TQCheckBox *checkBox = dynamic_cast<TQCheckBox*>(m_filterGroup->find(button)); + TQCheckBox *checkBox = dynamic_cast<TQCheckBox*>(m_filterGroup->tqfind(button)); if (checkBox == 0) return ; @@ -1575,8 +1575,8 @@ EventView::updateViewCaption() if (m_isTriggerSegment) { setCaption(i18n("%1 - Triggered Segment: %2") - .arg(getDocument()->getTitle()) - .arg(strtoqstr(m_segments[0]->getLabel()))); + .tqarg(getDocument()->getTitle()) + .tqarg(strtoqstr(m_segments[0]->getLabel()))); } else if (m_segments.size() == 1) { @@ -1590,14 +1590,14 @@ EventView::updateViewCaption() trackPosition = track->getPosition(); setCaption(i18n("%1 - Segment Track #%2 - Event List") - .arg(getDocument()->getTitle()) - .arg(trackPosition + 1)); + .tqarg(getDocument()->getTitle()) + .tqarg(trackPosition + 1)); } else { setCaption(i18n("%1 - %2 Segments - Event List") - .arg(getDocument()->getTitle()) - .arg(m_segments.size())); + .tqarg(getDocument()->getTitle()) + .tqarg(m_segments.size())); } } diff --git a/src/gui/editors/eventlist/EventView.h b/src/gui/editors/eventlist/EventView.h index fc4719a..b4f03c9 100644 --- a/src/gui/editors/eventlist/EventView.h +++ b/src/gui/editors/eventlist/EventView.h @@ -58,6 +58,7 @@ class Event; class EventView : public EditViewBase, public SegmentObserver { Q_OBJECT + TQ_OBJECT // Event filters // @@ -80,7 +81,7 @@ class EventView : public EditViewBase, public SegmentObserver public: EventView(RosegardenGUIDoc *doc, std::vector<Segment *> segments, - TQWidget *parent); + TQWidget *tqparent); virtual ~EventView(); diff --git a/src/gui/editors/eventlist/EventViewItem.h b/src/gui/editors/eventlist/EventViewItem.h index a94e29f..f5b47bb 100644 --- a/src/gui/editors/eventlist/EventViewItem.h +++ b/src/gui/editors/eventlist/EventViewItem.h @@ -41,44 +41,44 @@ class EventViewItem : public KListViewItem public: EventViewItem(Rosegarden::Segment *segment, Rosegarden::Event *event, - KListView *parent) : - KListViewItem(parent), + KListView *tqparent) : + KListViewItem(tqparent), m_segment(segment), m_event(event) {;} EventViewItem(Rosegarden::Segment *segment, Rosegarden::Event *event, - KListViewItem *parent) : - KListViewItem(parent), + KListViewItem *tqparent) : + KListViewItem(tqparent), m_segment(segment), m_event(event) {;} EventViewItem(Rosegarden::Segment *segment, Rosegarden::Event *event, - TQListView *parent, TQString label1, - TQString label2 = TQString::null, - TQString label3 = TQString::null, - TQString label4 = TQString::null, - TQString label5 = TQString::null, - TQString label6 = TQString::null, - TQString label7 = TQString::null, - TQString label8 = TQString::null) : - KListViewItem(parent, label1, label2, label3, label4, + TQListView *tqparent, TQString label1, + TQString label2 = TQString(), + TQString label3 = TQString(), + TQString label4 = TQString(), + TQString label5 = TQString(), + TQString label6 = TQString(), + TQString label7 = TQString(), + TQString label8 = TQString()) : + KListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8), m_segment(segment), m_event(event) {;} EventViewItem(Rosegarden::Segment *segment, Rosegarden::Event *event, - KListViewItem *parent, TQString label1, - TQString label2 = TQString::null, - TQString label3 = TQString::null, - TQString label4 = TQString::null, - TQString label5 = TQString::null, - TQString label6 = TQString::null, - TQString label7 = TQString::null, - TQString label8 = TQString::null) : - KListViewItem(parent, label1, label2, label3, label4, + KListViewItem *tqparent, TQString label1, + TQString label2 = TQString(), + TQString label3 = TQString(), + TQString label4 = TQString(), + TQString label5 = TQString(), + TQString label6 = TQString(), + TQString label7 = TQString(), + TQString label8 = TQString()) : + KListViewItem(tqparent, label1, label2, label3, label4, label5, label6, label7, label8), m_segment(segment), m_event(event) {;} diff --git a/src/gui/editors/eventlist/TrivialVelocityDialog.cpp b/src/gui/editors/eventlist/TrivialVelocityDialog.cpp index 6b9f748..08a4d22 100644 --- a/src/gui/editors/eventlist/TrivialVelocityDialog.cpp +++ b/src/gui/editors/eventlist/TrivialVelocityDialog.cpp @@ -30,8 +30,8 @@ namespace Rosegarden { -TrivialVelocityDialog::TrivialVelocityDialog(TQWidget *parent, TQString label, int deft) : - KDialogBase(parent, 0, true, label, Ok | Cancel) +TrivialVelocityDialog::TrivialVelocityDialog(TQWidget *tqparent, TQString label, int deft) : + KDialogBase(tqparent, 0, true, label, Ok | Cancel) { TQHBox *hbox = makeHBoxMainWidget(); new TQLabel(label, hbox); diff --git a/src/gui/editors/eventlist/TrivialVelocityDialog.h b/src/gui/editors/eventlist/TrivialVelocityDialog.h index c164110..cadb1e1 100644 --- a/src/gui/editors/eventlist/TrivialVelocityDialog.h +++ b/src/gui/editors/eventlist/TrivialVelocityDialog.h @@ -35,7 +35,7 @@ namespace Rosegarden { class TrivialVelocityDialog : public KDialogBase { public: - TrivialVelocityDialog(TQWidget *parent, TQString label, int deft); + TrivialVelocityDialog(TQWidget *tqparent, TQString label, int deft); int getVelocity(); |