summaryrefslogtreecommitdiffstats
path: root/src/gui/widgets/TimeWidget.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/widgets/TimeWidget.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/widgets/TimeWidget.cpp')
-rw-r--r--src/gui/widgets/TimeWidget.cpp114
1 files changed, 57 insertions, 57 deletions
diff --git a/src/gui/widgets/TimeWidget.cpp b/src/gui/widgets/TimeWidget.cpp
index 8eced3a..df177a4 100644
--- a/src/gui/widgets/TimeWidget.cpp
+++ b/src/gui/widgets/TimeWidget.cpp
@@ -48,12 +48,12 @@ namespace Rosegarden
{
TimeWidget::TimeWidget(TQString title,
- TQWidget *parent,
+ TQWidget *tqparent,
Composition *composition,
timeT absTime,
bool editable,
bool constrainToCompositionDuration) :
- TQGroupBox(1, Horizontal, title, parent),
+ TQGroupBox(1, Qt::Horizontal, title, tqparent),
m_composition(composition),
m_isDuration(false),
m_constrain(constrainToCompositionDuration),
@@ -65,13 +65,13 @@ TimeWidget::TimeWidget(TQString title,
}
TimeWidget::TimeWidget(TQString title,
- TQWidget *parent,
+ TQWidget *tqparent,
Composition *composition,
timeT startTime,
timeT duration,
bool editable,
bool constrainToCompositionDuration) :
- TQGroupBox(1, Horizontal, title, parent),
+ TQGroupBox(1, Qt::Horizontal, title, tqparent),
m_composition(composition),
m_isDuration(true),
m_constrain(constrainToCompositionDuration),
@@ -93,14 +93,14 @@ TimeWidget::init(bool editable)
editable = true;
TQFrame *frame = new TQFrame(this);
- TQGridLayout *layout = new TQGridLayout(frame, 7, 3, 5, 5);
+ TQGridLayout *tqlayout = new TQGridLayout(frame, 7, 3, 5, 5);
TQLabel *label = 0;
if (m_isDuration) {
label = new TQLabel(i18n("Note:"), frame);
- label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- layout->addWidget(label, 0, 0);
+ label->tqsetAlignment(TQt::AlignRight | TQt::AlignVCenter);
+ tqlayout->addWidget(label, 0, 0);
if (editable) {
m_note = new TQComboBox(frame);
@@ -118,7 +118,7 @@ TimeWidget::init(bool editable)
timeT error = 0;
TQString label = NotationStrings::makeNoteMenuLabel
(dottedDuration, false, error);
- TQPixmap pmap = NotePixmapFactory::toQPixmap
+ TQPixmap pmap = NotePixmapFactory::toTQPixmap
(NotePixmapFactory::makeNoteMenuPixmap(dottedDuration, error));
m_note->insertItem(pmap, label); // ignore error
}
@@ -127,13 +127,13 @@ TimeWidget::init(bool editable)
timeT error = 0;
TQString label = NotationStrings::makeNoteMenuLabel
(duration, false, error);
- TQPixmap pmap = NotePixmapFactory::toQPixmap
+ TQPixmap pmap = NotePixmapFactory::toTQPixmap
(NotePixmapFactory::makeNoteMenuPixmap(duration, error));
m_note->insertItem(pmap, label); // ignore error
}
connect(m_note, TQT_SIGNAL(activated(int)),
this, TQT_SLOT(slotNoteChanged(int)));
- layout->addMultiCellWidget(m_note, 0, 0, 1, 3);
+ tqlayout->addMultiCellWidget(m_note, 0, 0, 1, 3);
} else {
@@ -145,12 +145,12 @@ TimeWidget::init(bool editable)
label = i18n("<inexact>");
TQLineEdit *le = new TQLineEdit(label, frame);
le->setReadOnly(true);
- layout->addMultiCellWidget(le, 0, 0, 1, 3);
+ tqlayout->addMultiCellWidget(le, 0, 0, 1, 3);
}
label = new TQLabel(i18n("Units:"), frame);
- label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- layout->addWidget(label, 0, 4);
+ label->tqsetAlignment(TQt::AlignRight | TQt::AlignVCenter);
+ tqlayout->addWidget(label, 0, 4);
if (editable) {
m_timeT = new TQSpinBox(frame);
@@ -158,12 +158,12 @@ TimeWidget::init(bool editable)
(Note(Note::Shortest).getDuration());
connect(m_timeT, TQT_SIGNAL(valueChanged(int)),
this, TQT_SLOT(slotTimeTChanged(int)));
- layout->addWidget(m_timeT, 0, 5);
+ tqlayout->addWidget(m_timeT, 0, 5);
} else {
m_timeT = 0;
- TQLineEdit *le = new TQLineEdit(TQString("%1").arg(m_time), frame);
+ TQLineEdit *le = new TQLineEdit(TQString("%1").tqarg(m_time), frame);
le->setReadOnly(true);
- layout->addWidget(le, 0, 5);
+ tqlayout->addWidget(le, 0, 5);
}
} else {
@@ -171,8 +171,8 @@ TimeWidget::init(bool editable)
m_note = 0;
label = new TQLabel(i18n("Time:"), frame);
- label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- layout->addWidget(label, 0, 0);
+ label->tqsetAlignment(TQt::AlignRight | TQt::AlignVCenter);
+ tqlayout->addWidget(label, 0, 0);
if (editable) {
m_timeT = new TQSpinBox(frame);
@@ -180,19 +180,19 @@ TimeWidget::init(bool editable)
(Note(Note::Shortest).getDuration());
connect(m_timeT, TQT_SIGNAL(valueChanged(int)),
this, TQT_SLOT(slotTimeTChanged(int)));
- layout->addWidget(m_timeT, 0, 1);
- layout->addWidget(new TQLabel(i18n("units"), frame), 0, 2);
+ tqlayout->addWidget(m_timeT, 0, 1);
+ tqlayout->addWidget(new TQLabel(i18n("units"), frame), 0, 2);
} else {
m_timeT = 0;
- TQLineEdit *le = new TQLineEdit(TQString("%1").arg(m_time), frame);
+ TQLineEdit *le = new TQLineEdit(TQString("%1").tqarg(m_time), frame);
le->setReadOnly(true);
- layout->addWidget(le, 0, 2);
+ tqlayout->addWidget(le, 0, 2);
}
}
label = new TQLabel(m_isDuration ? i18n("Measures:") : i18n("Measure:"), frame);
- label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- layout->addWidget(label, 1, 0);
+ label->tqsetAlignment(TQt::AlignRight | TQt::AlignVCenter);
+ tqlayout->addWidget(label, 1, 0);
if (editable) {
m_barLabel = 0;
@@ -201,17 +201,17 @@ TimeWidget::init(bool editable)
m_bar->setMinValue(0);
connect(m_bar, TQT_SIGNAL(valueChanged(int)),
this, TQT_SLOT(slotBarBeatOrFractionChanged(int)));
- layout->addWidget(m_bar, 1, 1);
+ tqlayout->addWidget(m_bar, 1, 1);
} else {
m_bar = 0;
m_barLabel = new TQLineEdit(frame);
m_barLabel->setReadOnly(true);
- layout->addWidget(m_barLabel, 1, 1);
+ tqlayout->addWidget(m_barLabel, 1, 1);
}
label = new TQLabel(m_isDuration ? i18n("beats:") : i18n("beat:"), frame);
- label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- layout->addWidget(label, 1, 2);
+ label->tqsetAlignment(TQt::AlignRight | TQt::AlignVCenter);
+ tqlayout->addWidget(label, 1, 2);
if (editable) {
m_beatLabel = 0;
@@ -219,20 +219,20 @@ TimeWidget::init(bool editable)
m_beat->setMinValue(1);
connect(m_beat, TQT_SIGNAL(valueChanged(int)),
this, TQT_SLOT(slotBarBeatOrFractionChanged(int)));
- layout->addWidget(m_beat, 1, 3);
+ tqlayout->addWidget(m_beat, 1, 3);
} else {
m_beat = 0;
m_beatLabel = new TQLineEdit(frame);
m_beatLabel->setReadOnly(true);
- layout->addWidget(m_beatLabel, 1, 3);
+ tqlayout->addWidget(m_beatLabel, 1, 3);
}
- label = new TQLabel(i18n("%1:").arg(NotationStrings::getShortNoteName
+ label = new TQLabel(i18n("%1:").tqarg(NotationStrings::getShortNoteName
(Note
(Note::Shortest), true)),
frame);
- label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- layout->addWidget(label, 1, 4);
+ label->tqsetAlignment(TQt::AlignRight | TQt::AlignVCenter);
+ tqlayout->addWidget(label, 1, 4);
if (editable) {
m_fractionLabel = 0;
@@ -240,20 +240,20 @@ TimeWidget::init(bool editable)
m_fraction->setMinValue(1);
connect(m_fraction, TQT_SIGNAL(valueChanged(int)),
this, TQT_SLOT(slotBarBeatOrFractionChanged(int)));
- layout->addWidget(m_fraction, 1, 5);
+ tqlayout->addWidget(m_fraction, 1, 5);
} else {
m_fraction = 0;
m_fractionLabel = new TQLineEdit(frame);
m_fractionLabel->setReadOnly(true);
- layout->addWidget(m_fractionLabel, 1, 5);
+ tqlayout->addWidget(m_fractionLabel, 1, 5);
}
m_timeSig = new TQLabel(frame);
- layout->addWidget(m_timeSig, 1, 6);
+ tqlayout->addWidget(m_timeSig, 1, 6);
label = new TQLabel(i18n("Seconds:"), frame);
- label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- layout->addWidget(label, 2, 0);
+ label->tqsetAlignment(TQt::AlignRight | TQt::AlignVCenter);
+ tqlayout->addWidget(label, 2, 0);
if (editable) {
m_secLabel = 0;
@@ -262,17 +262,17 @@ TimeWidget::init(bool editable)
m_sec->setMinValue(0);
connect(m_sec, TQT_SIGNAL(valueChanged(int)),
this, TQT_SLOT(slotSecOrMSecChanged(int)));
- layout->addWidget(m_sec, 2, 1);
+ tqlayout->addWidget(m_sec, 2, 1);
} else {
m_sec = 0;
m_secLabel = new TQLineEdit(frame);
m_secLabel->setReadOnly(true);
- layout->addWidget(m_secLabel, 2, 1);
+ tqlayout->addWidget(m_secLabel, 2, 1);
}
label = new TQLabel(i18n("msec:"), frame);
- label->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
- layout->addWidget(label, 2, 2);
+ label->tqsetAlignment(TQt::AlignRight | TQt::AlignVCenter);
+ tqlayout->addWidget(label, 2, 2);
if (editable) {
m_msecLabel = 0;
@@ -281,17 +281,17 @@ TimeWidget::init(bool editable)
m_msec->setLineStep(10);
connect(m_msec, TQT_SIGNAL(valueChanged(int)),
this, TQT_SLOT(slotSecOrMSecChanged(int)));
- layout->addWidget(m_msec, 2, 3);
+ tqlayout->addWidget(m_msec, 2, 3);
} else {
m_msec = 0;
m_msecLabel = new TQLineEdit(frame);
m_msecLabel->setReadOnly(true);
- layout->addWidget(m_msecLabel, 2, 3);
+ tqlayout->addWidget(m_msecLabel, 2, 3);
}
if (m_isDuration) {
m_tempo = new TQLabel(frame);
- layout->addWidget(m_tempo, 2, 6);
+ tqlayout->addWidget(m_tempo, 2, 6);
} else {
m_tempo = 0;
}
@@ -383,7 +383,7 @@ TimeWidget::populate()
}
m_bar->setValue(bars);
} else {
- m_barLabel->setText(TQString("%1").arg(bars));
+ m_barLabel->setText(TQString("%1").tqarg(bars));
}
if (m_beat) {
@@ -391,7 +391,7 @@ TimeWidget::populate()
m_beat->setMaxValue(timeSig.getBeatsPerBar() - 1);
m_beat->setValue(beats);
} else {
- m_beatLabel->setText(TQString("%1").arg(beats));
+ m_beatLabel->setText(TQString("%1").tqarg(beats));
}
if (m_fraction) {
@@ -401,10 +401,10 @@ TimeWidget::populate()
getDuration() - 1);
m_fraction->setValue(hemidemis);
} else {
- m_fractionLabel->setText(TQString("%1").arg(hemidemis));
+ m_fractionLabel->setText(TQString("%1").tqarg(hemidemis));
}
- m_timeSig->setText(i18n("(%1/%2 time)").arg(timeSig.getNumerator()).
+ m_timeSig->setText(i18n("(%1/%2 time)").tqarg(timeSig.getNumerator()).
arg(timeSig.getDenominator()));
timeT endTime = m_startTime + m_time;
@@ -422,7 +422,7 @@ TimeWidget::populate()
}
m_sec->setValue(rt.sec);
} else {
- m_secLabel->setText(TQString("%1").arg(rt.sec));
+ m_secLabel->setText(TQString("%1").tqarg(rt.sec));
}
if (m_msec) {
@@ -430,7 +430,7 @@ TimeWidget::populate()
m_msec->setMaxValue(999);
m_msec->setValue(rt.msec());
} else {
- m_msecLabel->setText(TQString("%1").arg(rt.msec()));
+ m_msecLabel->setText(TQString("%1").tqarg(rt.msec()));
}
bool change = (m_composition->getTempoChangeNumberAt(endTime) !=
@@ -507,7 +507,7 @@ TimeWidget::populate()
}
m_bar->setValue(bar + 1);
} else {
- m_barLabel->setText(TQString("%1").arg(bar + 1));
+ m_barLabel->setText(TQString("%1").tqarg(bar + 1));
}
if (m_beat) {
@@ -515,7 +515,7 @@ TimeWidget::populate()
m_beat->setMaxValue(timeSig.getBeatsPerBar());
m_beat->setValue(beat);
} else {
- m_beatLabel->setText(TQString("%1").arg(beat));
+ m_beatLabel->setText(TQString("%1").tqarg(beat));
}
if (m_fraction) {
@@ -525,10 +525,10 @@ TimeWidget::populate()
getDuration() - 1);
m_fraction->setValue(hemidemis);
} else {
- m_fractionLabel->setText(TQString("%1").arg(hemidemis));
+ m_fractionLabel->setText(TQString("%1").tqarg(hemidemis));
}
- m_timeSig->setText(i18n("(%1/%2 time)").arg(timeSig.getNumerator()).
+ m_timeSig->setText(i18n("(%1/%2 time)").tqarg(timeSig.getNumerator()).
arg(timeSig.getDenominator()));
RealTime rt = m_composition->getElapsedRealTime(m_time);
@@ -543,7 +543,7 @@ TimeWidget::populate()
}
m_sec->setValue(rt.sec);
} else {
- m_secLabel->setText(TQString("%1").arg(rt.sec));
+ m_secLabel->setText(TQString("%1").tqarg(rt.sec));
}
if (m_msec) {
@@ -551,7 +551,7 @@ TimeWidget::populate()
m_msec->setMaxValue(999);
m_msec->setValue(rt.msec());
} else {
- m_msecLabel->setText(TQString("%1").arg(rt.msec()));
+ m_msecLabel->setText(TQString("%1").tqarg(rt.msec()));
}
}