diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2010-09-06 20:59:29 +0000 |
commit | 11f31c37e5fa4889d9989f10272f44845449cb7b (patch) | |
tree | 4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/widgets/TimeWidget.cpp | |
parent | 832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff) | |
download | rosegarden-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/widgets/TimeWidget.cpp')
-rw-r--r-- | src/gui/widgets/TimeWidget.cpp | 154 |
1 files changed, 77 insertions, 77 deletions
diff --git a/src/gui/widgets/TimeWidget.cpp b/src/gui/widgets/TimeWidget.cpp index b9bad6f..8eced3a 100644 --- a/src/gui/widgets/TimeWidget.cpp +++ b/src/gui/widgets/TimeWidget.cpp @@ -24,7 +24,7 @@ #include "TimeWidget.h" -#include <qlayout.h> +#include <tqlayout.h> #include <klocale.h> #include "misc/Debug.h" @@ -33,27 +33,27 @@ #include "base/RealTime.h" #include "gui/editors/notation/NotationStrings.h" #include "gui/editors/notation/NotePixmapFactory.h" -#include <qcombobox.h> -#include <qframe.h> -#include <qgroupbox.h> -#include <qlabel.h> -#include <qlineedit.h> -#include <qpixmap.h> -#include <qspinbox.h> -#include <qstring.h> -#include <qwidget.h> +#include <tqcombobox.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqlabel.h> +#include <tqlineedit.h> +#include <tqpixmap.h> +#include <tqspinbox.h> +#include <tqstring.h> +#include <tqwidget.h> namespace Rosegarden { -TimeWidget::TimeWidget(QString title, - QWidget *parent, +TimeWidget::TimeWidget(TQString title, + TQWidget *parent, Composition *composition, timeT absTime, bool editable, bool constrainToCompositionDuration) : - QGroupBox(1, Horizontal, title, parent), + TQGroupBox(1, Horizontal, title, parent), m_composition(composition), m_isDuration(false), m_constrain(constrainToCompositionDuration), @@ -64,14 +64,14 @@ TimeWidget::TimeWidget(QString title, init(editable); } -TimeWidget::TimeWidget(QString title, - QWidget *parent, +TimeWidget::TimeWidget(TQString title, + TQWidget *parent, Composition *composition, timeT startTime, timeT duration, bool editable, bool constrainToCompositionDuration) : - QGroupBox(1, Horizontal, title, parent), + TQGroupBox(1, Horizontal, title, parent), m_composition(composition), m_isDuration(true), m_constrain(constrainToCompositionDuration), @@ -92,18 +92,18 @@ TimeWidget::init(bool editable) bool savedEditable = editable; editable = true; - QFrame *frame = new QFrame(this); - QGridLayout *layout = new QGridLayout(frame, 7, 3, 5, 5); - QLabel *label = 0; + TQFrame *frame = new TQFrame(this); + TQGridLayout *layout = new TQGridLayout(frame, 7, 3, 5, 5); + TQLabel *label = 0; if (m_isDuration) { - label = new QLabel(i18n("Note:"), frame); + label = new TQLabel(i18n("Note:"), frame); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); layout->addWidget(label, 0, 0); if (editable) { - m_note = new QComboBox(frame); + m_note = new TQComboBox(frame); m_noteDurations.push_back(0); m_note->insertItem(i18n("<inexact>")); for (size_t i = 0; i < sizeof(denoms) / sizeof(denoms[0]); ++i) { @@ -116,52 +116,52 @@ TimeWidget::init(bool editable) timeT dottedDuration = duration * 3 / 2; m_noteDurations.push_back(dottedDuration); timeT error = 0; - QString label = NotationStrings::makeNoteMenuLabel + TQString label = NotationStrings::makeNoteMenuLabel (dottedDuration, false, error); - QPixmap pmap = NotePixmapFactory::toQPixmap + TQPixmap pmap = NotePixmapFactory::toQPixmap (NotePixmapFactory::makeNoteMenuPixmap(dottedDuration, error)); m_note->insertItem(pmap, label); // ignore error } m_noteDurations.push_back(duration); timeT error = 0; - QString label = NotationStrings::makeNoteMenuLabel + TQString label = NotationStrings::makeNoteMenuLabel (duration, false, error); - QPixmap pmap = NotePixmapFactory::toQPixmap + TQPixmap pmap = NotePixmapFactory::toQPixmap (NotePixmapFactory::makeNoteMenuPixmap(duration, error)); m_note->insertItem(pmap, label); // ignore error } - connect(m_note, SIGNAL(activated(int)), - this, SLOT(slotNoteChanged(int))); + connect(m_note, TQT_SIGNAL(activated(int)), + this, TQT_SLOT(slotNoteChanged(int))); layout->addMultiCellWidget(m_note, 0, 0, 1, 3); } else { m_note = 0; timeT error = 0; - QString label = NotationStrings::makeNoteMenuLabel + TQString label = NotationStrings::makeNoteMenuLabel (m_time, false, error); if (error != 0) label = i18n("<inexact>"); - QLineEdit *le = new QLineEdit(label, frame); + TQLineEdit *le = new TQLineEdit(label, frame); le->setReadOnly(true); layout->addMultiCellWidget(le, 0, 0, 1, 3); } - label = new QLabel(i18n("Units:"), frame); + label = new TQLabel(i18n("Units:"), frame); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); layout->addWidget(label, 0, 4); if (editable) { - m_timeT = new QSpinBox(frame); + m_timeT = new TQSpinBox(frame); m_timeT->setLineStep (Note(Note::Shortest).getDuration()); - connect(m_timeT, SIGNAL(valueChanged(int)), - this, SLOT(slotTimeTChanged(int))); + connect(m_timeT, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotTimeTChanged(int))); layout->addWidget(m_timeT, 0, 5); } else { m_timeT = 0; - QLineEdit *le = new QLineEdit(QString("%1").arg(m_time), frame); + TQLineEdit *le = new TQLineEdit(TQString("%1").arg(m_time), frame); le->setReadOnly(true); layout->addWidget(le, 0, 5); } @@ -170,64 +170,64 @@ TimeWidget::init(bool editable) m_note = 0; - label = new QLabel(i18n("Time:"), frame); + label = new TQLabel(i18n("Time:"), frame); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); layout->addWidget(label, 0, 0); if (editable) { - m_timeT = new QSpinBox(frame); + m_timeT = new TQSpinBox(frame); m_timeT->setLineStep (Note(Note::Shortest).getDuration()); - connect(m_timeT, SIGNAL(valueChanged(int)), - this, SLOT(slotTimeTChanged(int))); + connect(m_timeT, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotTimeTChanged(int))); layout->addWidget(m_timeT, 0, 1); - layout->addWidget(new QLabel(i18n("units"), frame), 0, 2); + layout->addWidget(new TQLabel(i18n("units"), frame), 0, 2); } else { m_timeT = 0; - QLineEdit *le = new QLineEdit(QString("%1").arg(m_time), frame); + TQLineEdit *le = new TQLineEdit(TQString("%1").arg(m_time), frame); le->setReadOnly(true); layout->addWidget(le, 0, 2); } } - label = new QLabel(m_isDuration ? i18n("Measures:") : i18n("Measure:"), frame); + label = new TQLabel(m_isDuration ? i18n("Measures:") : i18n("Measure:"), frame); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); layout->addWidget(label, 1, 0); if (editable) { m_barLabel = 0; - m_bar = new QSpinBox(frame); + m_bar = new TQSpinBox(frame); if (m_isDuration) m_bar->setMinValue(0); - connect(m_bar, SIGNAL(valueChanged(int)), - this, SLOT(slotBarBeatOrFractionChanged(int))); + connect(m_bar, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotBarBeatOrFractionChanged(int))); layout->addWidget(m_bar, 1, 1); } else { m_bar = 0; - m_barLabel = new QLineEdit(frame); + m_barLabel = new TQLineEdit(frame); m_barLabel->setReadOnly(true); layout->addWidget(m_barLabel, 1, 1); } - label = new QLabel(m_isDuration ? i18n("beats:") : i18n("beat:"), frame); + label = new TQLabel(m_isDuration ? i18n("beats:") : i18n("beat:"), frame); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); layout->addWidget(label, 1, 2); if (editable) { m_beatLabel = 0; - m_beat = new QSpinBox(frame); + m_beat = new TQSpinBox(frame); m_beat->setMinValue(1); - connect(m_beat, SIGNAL(valueChanged(int)), - this, SLOT(slotBarBeatOrFractionChanged(int))); + connect(m_beat, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotBarBeatOrFractionChanged(int))); layout->addWidget(m_beat, 1, 3); } else { m_beat = 0; - m_beatLabel = new QLineEdit(frame); + m_beatLabel = new TQLineEdit(frame); m_beatLabel->setReadOnly(true); layout->addWidget(m_beatLabel, 1, 3); } - label = new QLabel(i18n("%1:").arg(NotationStrings::getShortNoteName + label = new TQLabel(i18n("%1:").arg(NotationStrings::getShortNoteName (Note (Note::Shortest), true)), frame); @@ -236,61 +236,61 @@ TimeWidget::init(bool editable) if (editable) { m_fractionLabel = 0; - m_fraction = new QSpinBox(frame); + m_fraction = new TQSpinBox(frame); m_fraction->setMinValue(1); - connect(m_fraction, SIGNAL(valueChanged(int)), - this, SLOT(slotBarBeatOrFractionChanged(int))); + connect(m_fraction, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotBarBeatOrFractionChanged(int))); layout->addWidget(m_fraction, 1, 5); } else { m_fraction = 0; - m_fractionLabel = new QLineEdit(frame); + m_fractionLabel = new TQLineEdit(frame); m_fractionLabel->setReadOnly(true); layout->addWidget(m_fractionLabel, 1, 5); } - m_timeSig = new QLabel(frame); + m_timeSig = new TQLabel(frame); layout->addWidget(m_timeSig, 1, 6); - label = new QLabel(i18n("Seconds:"), frame); + label = new TQLabel(i18n("Seconds:"), frame); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); layout->addWidget(label, 2, 0); if (editable) { m_secLabel = 0; - m_sec = new QSpinBox(frame); + m_sec = new TQSpinBox(frame); if (m_isDuration) m_sec->setMinValue(0); - connect(m_sec, SIGNAL(valueChanged(int)), - this, SLOT(slotSecOrMSecChanged(int))); + connect(m_sec, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotSecOrMSecChanged(int))); layout->addWidget(m_sec, 2, 1); } else { m_sec = 0; - m_secLabel = new QLineEdit(frame); + m_secLabel = new TQLineEdit(frame); m_secLabel->setReadOnly(true); layout->addWidget(m_secLabel, 2, 1); } - label = new QLabel(i18n("msec:"), frame); + label = new TQLabel(i18n("msec:"), frame); label->setAlignment(Qt::AlignRight | Qt::AlignVCenter); layout->addWidget(label, 2, 2); if (editable) { m_msecLabel = 0; - m_msec = new QSpinBox(frame); + m_msec = new TQSpinBox(frame); m_msec->setMinValue(0); m_msec->setLineStep(10); - connect(m_msec, SIGNAL(valueChanged(int)), - this, SLOT(slotSecOrMSecChanged(int))); + connect(m_msec, TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotSecOrMSecChanged(int))); layout->addWidget(m_msec, 2, 3); } else { m_msec = 0; - m_msecLabel = new QLineEdit(frame); + m_msecLabel = new TQLineEdit(frame); m_msecLabel->setReadOnly(true); layout->addWidget(m_msecLabel, 2, 3); } if (m_isDuration) { - m_tempo = new QLabel(frame); + m_tempo = new TQLabel(frame); layout->addWidget(m_tempo, 2, 6); } else { m_tempo = 0; @@ -383,7 +383,7 @@ TimeWidget::populate() } m_bar->setValue(bars); } else { - m_barLabel->setText(QString("%1").arg(bars)); + m_barLabel->setText(TQString("%1").arg(bars)); } if (m_beat) { @@ -391,7 +391,7 @@ TimeWidget::populate() m_beat->setMaxValue(timeSig.getBeatsPerBar() - 1); m_beat->setValue(beats); } else { - m_beatLabel->setText(QString("%1").arg(beats)); + m_beatLabel->setText(TQString("%1").arg(beats)); } if (m_fraction) { @@ -401,7 +401,7 @@ TimeWidget::populate() getDuration() - 1); m_fraction->setValue(hemidemis); } else { - m_fractionLabel->setText(QString("%1").arg(hemidemis)); + m_fractionLabel->setText(TQString("%1").arg(hemidemis)); } m_timeSig->setText(i18n("(%1/%2 time)").arg(timeSig.getNumerator()). @@ -422,7 +422,7 @@ TimeWidget::populate() } m_sec->setValue(rt.sec); } else { - m_secLabel->setText(QString("%1").arg(rt.sec)); + m_secLabel->setText(TQString("%1").arg(rt.sec)); } if (m_msec) { @@ -430,7 +430,7 @@ TimeWidget::populate() m_msec->setMaxValue(999); m_msec->setValue(rt.msec()); } else { - m_msecLabel->setText(QString("%1").arg(rt.msec())); + m_msecLabel->setText(TQString("%1").arg(rt.msec())); } bool change = (m_composition->getTempoChangeNumberAt(endTime) != @@ -507,7 +507,7 @@ TimeWidget::populate() } m_bar->setValue(bar + 1); } else { - m_barLabel->setText(QString("%1").arg(bar + 1)); + m_barLabel->setText(TQString("%1").arg(bar + 1)); } if (m_beat) { @@ -515,7 +515,7 @@ TimeWidget::populate() m_beat->setMaxValue(timeSig.getBeatsPerBar()); m_beat->setValue(beat); } else { - m_beatLabel->setText(QString("%1").arg(beat)); + m_beatLabel->setText(TQString("%1").arg(beat)); } if (m_fraction) { @@ -525,7 +525,7 @@ TimeWidget::populate() getDuration() - 1); m_fraction->setValue(hemidemis); } else { - m_fractionLabel->setText(QString("%1").arg(hemidemis)); + m_fractionLabel->setText(TQString("%1").arg(hemidemis)); } m_timeSig->setText(i18n("(%1/%2 time)").arg(timeSig.getNumerator()). @@ -543,7 +543,7 @@ TimeWidget::populate() } m_sec->setValue(rt.sec); } else { - m_secLabel->setText(QString("%1").arg(rt.sec)); + m_secLabel->setText(TQString("%1").arg(rt.sec)); } if (m_msec) { @@ -551,7 +551,7 @@ TimeWidget::populate() m_msec->setMaxValue(999); m_msec->setValue(rt.msec()); } else { - m_msecLabel->setText(QString("%1").arg(rt.msec())); + m_msecLabel->setText(TQString("%1").arg(rt.msec())); } } |