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/dialogs/TransportDialog.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/dialogs/TransportDialog.cpp')
-rw-r--r-- | src/gui/dialogs/TransportDialog.cpp | 212 |
1 files changed, 106 insertions, 106 deletions
diff --git a/src/gui/dialogs/TransportDialog.cpp b/src/gui/dialogs/TransportDialog.cpp index 115a528..a632469 100644 --- a/src/gui/dialogs/TransportDialog.cpp +++ b/src/gui/dialogs/TransportDialog.cpp @@ -39,28 +39,28 @@ #include "document/ConfigGroups.h" #include <kconfig.h> #include <kglobal.h> -#include <qaccel.h> -#include <qcolor.h> -#include <qcstring.h> -#include <qdatastream.h> -#include <qfont.h> -#include <qhbox.h> -#include <qlabel.h> -#include <qpalette.h> -#include <qpixmap.h> -#include <qpushbutton.h> -#include <qstring.h> -#include <qtimer.h> -#include <qwidget.h> +#include <tqaccel.h> +#include <tqcolor.h> +#include <tqcstring.h> +#include <tqdatastream.h> +#include <tqfont.h> +#include <tqhbox.h> +#include <tqlabel.h> +#include <tqpalette.h> +#include <tqpixmap.h> +#include <tqpushbutton.h> +#include <tqstring.h> +#include <tqtimer.h> +#include <tqwidget.h> namespace Rosegarden { -TransportDialog::TransportDialog(QWidget *parent, +TransportDialog::TransportDialog(TQWidget *parent, const char *name, WFlags flags): - QWidget(parent, name, WType_TopLevel | WStyle_DialogBorder | WStyle_Minimize | WStyle_SysMenu | WDestructiveClose), + TQWidget(parent, name, WType_TopLevel | WStyle_DialogBorder | WStyle_Minimize | WStyle_SysMenu | WDestructiveClose), m_transport(0), m_lastTenHours(0), m_lastUnitHours(0), @@ -138,45 +138,45 @@ TransportDialog::TransportDialog(QWidget *parent, loadPixmaps(); // Create Midi label timers - m_midiInTimer = new QTimer(this); - m_midiOutTimer = new QTimer(this); - m_clearMetronomeTimer = new QTimer(this); + m_midiInTimer = new TQTimer(this); + m_midiOutTimer = new TQTimer(this); + m_clearMetronomeTimer = new TQTimer(this); - connect(m_midiInTimer, SIGNAL(timeout()), - SLOT(slotClearMidiInLabel())); + connect(m_midiInTimer, TQT_SIGNAL(timeout()), + TQT_SLOT(slotClearMidiInLabel())); - connect(m_midiOutTimer, SIGNAL(timeout()), - SLOT(slotClearMidiOutLabel())); + connect(m_midiOutTimer, TQT_SIGNAL(timeout()), + TQT_SLOT(slotClearMidiOutLabel())); - connect(m_clearMetronomeTimer, SIGNAL(timeout()), - SLOT(slotResetBackground())); + connect(m_clearMetronomeTimer, TQT_SIGNAL(timeout()), + TQT_SLOT(slotResetBackground())); m_transport->TimeDisplayLabel->hide(); m_transport->ToEndLabel->hide(); - connect(m_transport->TimeDisplayButton, SIGNAL(clicked()), - SLOT(slotChangeTimeDisplay())); + connect(m_transport->TimeDisplayButton, TQT_SIGNAL(clicked()), + TQT_SLOT(slotChangeTimeDisplay())); - connect(m_transport->ToEndButton, SIGNAL(clicked()), - SLOT(slotChangeToEnd())); + connect(m_transport->ToEndButton, TQT_SIGNAL(clicked()), + TQT_SLOT(slotChangeToEnd())); - connect(m_transport->LoopButton, SIGNAL(clicked()), - SLOT(slotLoopButtonClicked())); + connect(m_transport->LoopButton, TQT_SIGNAL(clicked()), + TQT_SLOT(slotLoopButtonClicked())); - connect(m_transport->PanelOpenButton, SIGNAL(clicked()), - SLOT(slotPanelOpenButtonClicked())); + connect(m_transport->PanelOpenButton, TQT_SIGNAL(clicked()), + TQT_SLOT(slotPanelOpenButtonClicked())); - connect(m_transport->PanelCloseButton, SIGNAL(clicked()), - SLOT(slotPanelCloseButtonClicked())); + connect(m_transport->PanelCloseButton, TQT_SIGNAL(clicked()), + TQT_SLOT(slotPanelCloseButtonClicked())); - connect(m_transport->PanicButton, SIGNAL(clicked()), SIGNAL(panic())); + connect(m_transport->PanicButton, TQT_SIGNAL(clicked()), TQT_SIGNAL(panic())); m_panelOpen = *m_transport->PanelOpenButton->pixmap(); m_panelClosed = *m_transport->PanelCloseButton->pixmap(); - connect(m_transport->SetStartLPButton, SIGNAL(clicked()), SLOT(slotSetStartLoopingPointAtMarkerPos())); - connect(m_transport->SetStopLPButton, SIGNAL(clicked()), SLOT(slotSetStopLoopingPointAtMarkerPos())); + connect(m_transport->SetStartLPButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetStartLoopingPointAtMarkerPos())); + connect(m_transport->SetStopLPButton, TQT_SIGNAL(clicked()), TQT_SLOT(slotSetStopLoopingPointAtMarkerPos())); // clear labels // @@ -202,66 +202,66 @@ TransportDialog::TransportDialog(QWidget *parent, // if the rest of the Transport ever changes then this code // will have to as well. // - QPalette pal; - pal.setColor(QColorGroup::Foreground, QColor(192, 216, 255)); + TQPalette pal; + pal.setColor(TQColorGroup::Foreground, TQColor(192, 216, 255)); m_transport->TempoDisplay->setPalette(pal); - m_transport->TempoDisplay->setAlignment(int(QLabel::AlignVCenter | QLabel::AlignRight)); + m_transport->TempoDisplay->setAlignment(int(TQLabel::AlignVCenter | TQLabel::AlignRight)); m_transport->TimeSigDisplay->setPalette(pal); - m_transport->TimeSigDisplay->setAlignment(int(QLabel::AlignVCenter | QLabel::AlignRight)); + m_transport->TimeSigDisplay->setAlignment(int(TQLabel::AlignVCenter | TQLabel::AlignRight)); - QFont localFont(m_transport->OutDisplay->font() ); + TQFont localFont(m_transport->OutDisplay->font() ); localFont.setFamily( "lucida" ); localFont.setBold( TRUE ); m_transport->TempoDisplay->setFont( localFont ); m_transport->TimeSigDisplay->setFont( localFont ); - connect(m_transport->TempoDisplay, SIGNAL(doubleClicked()), - this, SLOT(slotEditTempo())); + connect(m_transport->TempoDisplay, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTempo())); - connect(m_transport->TempoDisplay, SIGNAL(scrollWheel(int)), - this, SIGNAL(scrollTempo(int))); + connect(m_transport->TempoDisplay, TQT_SIGNAL(scrollWheel(int)), + this, TQT_SIGNAL(scrollTempo(int))); - connect(m_transport->TimeSigDisplay, SIGNAL(doubleClicked()), - this, SLOT(slotEditTimeSignature())); + connect(m_transport->TimeSigDisplay, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTimeSignature())); // toil through the individual pixmaps - connect(m_transport->NegativePixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->TenHoursPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->UnitHoursPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->HourColonPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->TenMinutesPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->UnitMinutesPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->MinuteColonPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->TenSecondsPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->UnitSecondsPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->SecondColonPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->TenthsPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->HundredthsPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->HundredthColonPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->TenThousandthsPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); - connect(m_transport->ThousandthsPixmap, SIGNAL(doubleClicked()), - this, SLOT(slotEditTime())); + connect(m_transport->NegativePixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->TenHoursPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->UnitHoursPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->HourColonPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->TenMinutesPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->UnitMinutesPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->MinuteColonPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->TenSecondsPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->UnitSecondsPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->SecondColonPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->TenthsPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->HundredthsPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->HundredthColonPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->TenThousandthsPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); + connect(m_transport->ThousandthsPixmap, TQT_SIGNAL(doubleClicked()), + this, TQT_SLOT(slotEditTime())); // accelerator object // - m_accelerators = new QAccel(this); + m_accelerators = new TQAccel(this); } TransportDialog::~TransportDialog() @@ -311,16 +311,16 @@ TransportDialog::show() int x = config->readNumEntry("transportx", -1); int y = config->readNumEntry("transporty", -1); if (x >= 0 && y >= 0) { - int dw = QApplication::desktop()->availableGeometry(QPoint(x, y)).width(); - int dh = QApplication::desktop()->availableGeometry(QPoint(x, y)).height(); + int dw = TQApplication::desktop()->availableGeometry(TQPoint(x, y)).width(); + int dh = TQApplication::desktop()->availableGeometry(TQPoint(x, y)).height(); if (x + m_transport->width() > dw) x = dw - m_transport->width(); if (y + m_transport->height() > dh) y = dh - m_transport->height(); move(x, y); // std::cerr << "TransportDialog::show(): moved to " << x << "," << y << std::endl; - QWidget::show(); + TQWidget::show(); // std::cerr << "TransportDialog::show(): now at " << this->x() << "," << this->y() << std::endl; } else { - QWidget::show(); + TQWidget::show(); } } @@ -333,18 +333,18 @@ TransportDialog::hide() config->writeEntry("transportx", x()); config->writeEntry("transporty", y()); } - QWidget::hide(); + TQWidget::hide(); } void TransportDialog::loadPixmaps() { m_lcdList.clear(); - QString fileName; - QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); + TQString fileName; + TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); for (int i = 0; i < 10; i++) { - fileName = QString("%1/transport/led-%2.xpm").arg(pixmapDir).arg(i); + fileName = TQString("%1/transport/led-%2.xpm").arg(pixmapDir).arg(i); if (!m_lcdList[i].load(fileName)) { std::cerr << "TransportDialog - failed to load pixmap \"" << fileName << "\"" << std::endl; @@ -353,7 +353,7 @@ TransportDialog::loadPixmaps() // Load the "negative" sign pixmap // - fileName = QString("%1/transport/led--.xpm").arg(pixmapDir); + fileName = TQString("%1/transport/led--.xpm").arg(pixmapDir); m_lcdNegative.load(fileName); } @@ -376,9 +376,9 @@ TransportDialog::resetFonts() } void -TransportDialog::resetFont(QWidget *w) +TransportDialog::resetFont(TQWidget *w) { - QFont font = w->font(); + TQFont font = w->font(); font.setPixelSize(10); w->setFont(font); } @@ -404,12 +404,12 @@ TransportDialog::computeSampleRate() { if (m_sampleRate == 0) { - QCString replyType; - QByteArray replyData; + TQCString replyType; + TQByteArray replyData; m_sampleRate = 0; if (rgapp->sequencerCall("getSampleRate()", replyType, replyData)) { - QDataStream streamIn(replyData, IO_ReadOnly); + TQDataStream streamIn(replyData, IO_ReadOnly); unsigned int result; streamIn >> result; m_sampleRate = result; @@ -479,7 +479,7 @@ TransportDialog::displayTime() case FrameMode: m_clearMetronomeTimer->stop(); - m_transport->TimeDisplayLabel->setText(QString("%1").arg(m_sampleRate)); + m_transport->TimeDisplayLabel->setText(TQString("%1").arg(m_sampleRate)); m_transport->TimeDisplayLabel->show(); break; } @@ -879,7 +879,7 @@ TransportDialog::setTempo(const tempoT &tempo) StudioControl::sendQuarterNoteLength(qnTime); - QString tempoString; + TQString tempoString; tempoString.sprintf("%4.3f", Composition::getTempoQpm(tempo)); m_transport->TempoDisplay->setText(tempoString); @@ -895,7 +895,7 @@ TransportDialog::setTimeSignature(const TimeSignature &timeSig) m_numerator = numerator; m_denominator = denominator; - QString timeSigString; + TQString timeSigString; timeSigString.sprintf("%d/%d", numerator, denominator); m_transport->TimeSigDisplay->setText(timeSigString); } @@ -917,7 +917,7 @@ TransportDialog::setMidiInLabel(const MappedEvent *mE) MidiPitchLabel mPL(mE->getPitch()); m_transport->InDisplay->setText (mPL.getQString() + - QString(" %1").arg(mE->getVelocity())); + TQString(" %1").arg(mE->getVelocity())); } break; @@ -959,7 +959,7 @@ TransportDialog::setMidiInLabel(const MappedEvent *mE) void TransportDialog::slotClearMidiInLabel() { - m_transport->InDisplay->setText(i18n(QString("NO EVENTS"))); + m_transport->InDisplay->setText(i18n(TQString("NO EVENTS"))); // also, just to be sure: slotResetBackground(); @@ -977,7 +977,7 @@ TransportDialog::setMidiOutLabel(const MappedEvent *mE) MidiPitchLabel mPL(mE->getPitch()); m_transport->OutDisplay->setText (mPL.getQString() + - QString(" %1").arg(mE->getVelocity())); + TQString(" %1").arg(mE->getVelocity())); } break; @@ -1019,11 +1019,11 @@ TransportDialog::setMidiOutLabel(const MappedEvent *mE) void TransportDialog::slotClearMidiOutLabel() { - m_transport->OutDisplay->setText(i18n(QString("NO EVENTS"))); + m_transport->OutDisplay->setText(i18n(TQString("NO EVENTS"))); } void -TransportDialog::closeEvent (QCloseEvent * /*e*/) +TransportDialog::closeEvent (TQCloseEvent * /*e*/) { //e->accept(); // accept the close event here emit closed(); @@ -1118,7 +1118,7 @@ TransportDialog::slotEditTime() } void -TransportDialog::slotSetBackground(QColor c) +TransportDialog::slotSetBackground(TQColor c) { if (!m_haveOriginalBackground) { m_originalBackground = m_transport->LCDBoxFrame->paletteBackgroundColor(); @@ -1133,13 +1133,13 @@ TransportDialog::slotSetBackground(QColor c) /* this is a bit more thorough, but too slow and flickery: - const QObjectList *children = m_transport->LCDBoxFrame->children(); - QObjectListIt it(*children); - QObject *obj; + const TQObjectList *children = m_transport->LCDBoxFrame->tqchildren(); + TQObjectListIt it(*children); + TQObject *obj; while ((obj = it.current()) != 0) { - QWidget *w = dynamic_cast<QWidget *>(obj); + TQWidget *w = dynamic_cast<TQWidget *>(obj); if (w) { w->setPaletteBackgroundColor(c); } |