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/editors/segment/MarkerEditor.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/editors/segment/MarkerEditor.cpp')
-rw-r--r-- | src/gui/editors/segment/MarkerEditor.cpp | 168 |
1 files changed, 84 insertions, 84 deletions
diff --git a/src/gui/editors/segment/MarkerEditor.cpp b/src/gui/editors/segment/MarkerEditor.cpp index 61caaa7..d9df8a2 100644 --- a/src/gui/editors/segment/MarkerEditor.cpp +++ b/src/gui/editors/segment/MarkerEditor.cpp @@ -25,7 +25,7 @@ #include "MarkerEditor.h" #include "MarkerEditorViewItem.h" -#include <qlayout.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> @@ -51,33 +51,33 @@ #include <kmainwindow.h> #include <kstdaccel.h> #include <kstdaction.h> -#include <qaccel.h> -#include <qdialog.h> -#include <qframe.h> -#include <qgroupbox.h> -#include <qiconset.h> -#include <qlabel.h> -#include <qlistview.h> -#include <qptrlist.h> -#include <qpushbutton.h> -#include <qsizepolicy.h> -#include <qstring.h> -#include <qtooltip.h> -#include <qvbox.h> -#include <qwidget.h> -#include <qcanvas.h> +#include <tqaccel.h> +#include <tqdialog.h> +#include <tqframe.h> +#include <tqgroupbox.h> +#include <tqiconset.h> +#include <tqlabel.h> +#include <tqlistview.h> +#include <tqptrlist.h> +#include <tqpushbutton.h> +#include <tqsizepolicy.h> +#include <tqstring.h> +#include <tqtooltip.h> +#include <tqvbox.h> +#include <tqwidget.h> +#include <tqcanvas.h> namespace Rosegarden { -MarkerEditor::MarkerEditor(QWidget *parent, +MarkerEditor::MarkerEditor(TQWidget *parent, RosegardenGUIDoc *doc): KMainWindow(parent, "markereditordialog"), m_doc(doc), m_modified(false) { - QVBox* mainFrame = new QVBox(this); + TQVBox* mainFrame = new TQVBox(this); setCentralWidget(mainFrame); setCaption(i18n("Manage Markers")); @@ -91,44 +91,44 @@ MarkerEditor::MarkerEditor(QWidget *parent, for (int i = 0; i < 3; ++i) m_listView->setColumnAlignment(i, Qt::AlignHCenter); - QGroupBox *posGroup = new QGroupBox(2, Horizontal, + TQGroupBox *posGroup = new TQGroupBox(2, Horizontal, i18n("Pointer position"), mainFrame); - new QLabel(i18n("Absolute time:"), posGroup); - m_absoluteTime = new QLabel(posGroup); + new TQLabel(i18n("Absolute time:"), posGroup); + m_absoluteTime = new TQLabel(posGroup); - new QLabel(i18n("Real time:"), posGroup); - m_realTime = new QLabel(posGroup); + new TQLabel(i18n("Real time:"), posGroup); + m_realTime = new TQLabel(posGroup); - new QLabel(i18n("In measure:"), posGroup); - m_barTime = new QLabel(posGroup); + new TQLabel(i18n("In measure:"), posGroup); + m_barTime = new TQLabel(posGroup); - QFrame* btnBox = new QFrame(mainFrame); + TQFrame* btnBox = new TQFrame(mainFrame); btnBox->setSizePolicy( - QSizePolicy(QSizePolicy::Minimum, QSizePolicy::Fixed)); + TQSizePolicy(TQSizePolicy::Minimum, TQSizePolicy::Fixed)); - QHBoxLayout* layout = new QHBoxLayout(btnBox, 4, 10); + TQHBoxLayout* layout = new TQHBoxLayout(btnBox, 4, 10); - m_addButton = new QPushButton(i18n("Add"), btnBox); - m_deleteButton = new QPushButton(i18n("Delete"), btnBox); - m_deleteAllButton = new QPushButton(i18n("Delete All"), btnBox); + m_addButton = new TQPushButton(i18n("Add"), btnBox); + m_deleteButton = new TQPushButton(i18n("Delete"), btnBox); + m_deleteAllButton = new TQPushButton(i18n("Delete All"), btnBox); - m_closeButton = new QPushButton(i18n("Close"), btnBox); + m_closeButton = new TQPushButton(i18n("Close"), btnBox); - QToolTip::add + TQToolTip::add (m_addButton, i18n("Add a Marker")); - QToolTip::add + TQToolTip::add (m_deleteButton, i18n("Delete a Marker")); - QToolTip::add + TQToolTip::add (m_deleteAllButton, i18n("Delete All Markers")); - QToolTip::add + TQToolTip::add (m_closeButton, i18n("Close the Marker Editor")); @@ -141,48 +141,48 @@ MarkerEditor::MarkerEditor(QWidget *parent, layout->addWidget(m_closeButton); layout->addSpacing(5); - connect(m_addButton, SIGNAL(released()), - SLOT(slotAdd())); + connect(m_addButton, TQT_SIGNAL(released()), + TQT_SLOT(slotAdd())); - connect(m_deleteButton, SIGNAL(released()), - SLOT(slotDelete())); + connect(m_deleteButton, TQT_SIGNAL(released()), + TQT_SLOT(slotDelete())); - connect(m_closeButton, SIGNAL(released()), - SLOT(slotClose())); + connect(m_closeButton, TQT_SIGNAL(released()), + TQT_SLOT(slotClose())); - connect(m_deleteAllButton, SIGNAL(released()), - SLOT(slotDeleteAll())); + connect(m_deleteAllButton, TQT_SIGNAL(released()), + TQT_SLOT(slotDeleteAll())); setupActions(); m_doc->getCommandHistory()->attachView(actionCollection()); - connect(m_doc->getCommandHistory(), SIGNAL(commandExecuted()), - this, SLOT(slotUpdate())); + connect(m_doc->getCommandHistory(), TQT_SIGNAL(commandExecuted()), + this, TQT_SLOT(slotUpdate())); - connect(m_listView, SIGNAL(doubleClicked(QListViewItem *)), - SLOT(slotEdit(QListViewItem *))); + connect(m_listView, TQT_SIGNAL(doubleClicked(TQListViewItem *)), + TQT_SLOT(slotEdit(TQListViewItem *))); - connect(m_listView, SIGNAL(pressed(QListViewItem *)), - this, SLOT(slotItemClicked(QListViewItem *))); + connect(m_listView, TQT_SIGNAL(pressed(TQListViewItem *)), + this, TQT_SLOT(slotItemClicked(TQListViewItem *))); // Highlight all columns - enable extended selection mode // m_listView->setAllColumnsShowFocus(true); - m_listView->setSelectionMode(QListView::Extended); + m_listView->setSelectionMode(TQListView::Extended); m_listView->setItemsRenameable(true); initDialog(); setAutoSaveSettings(MarkerEditorConfigGroup, true); - m_accelerators = new QAccel(this); + m_accelerators = new TQAccel(this); } void MarkerEditor::updatePosition() { timeT pos = m_doc->getComposition().getPosition(); - m_absoluteTime->setText(QString("%1").arg(pos)); + m_absoluteTime->setText(TQString("%1").arg(pos)); RealTime rT = m_doc->getComposition().getElapsedRealTime(pos); long hours = rT.sec / (60 * 60); @@ -190,11 +190,11 @@ MarkerEditor::updatePosition() long secs = rT.sec; long msecs = rT.msec(); - QString realTime, secsStr; + TQString realTime, secsStr; if (hours) - realTime += QString("%1h ").arg(hours); + realTime += TQString("%1h ").arg(hours); if (mins) - realTime += QString("%1m ").arg(mins); + realTime += TQString("%1m ").arg(mins); secsStr.sprintf("%ld.%03lds", secs, msecs); realTime += secsStr; @@ -202,8 +202,8 @@ MarkerEditor::updatePosition() if (m_realTime->text() != realTime) m_realTime->setText(realTime); - QString barTime = - QString("%1").arg(m_doc->getComposition().getBarNumber(pos) + 1); + TQString barTime = + TQString("%1").arg(m_doc->getComposition().getBarNumber(pos) + 1); // again only update if needed if (m_barTime->text() != barTime) @@ -243,7 +243,7 @@ MarkerEditor::slotUpdate() { RG_DEBUG << "MarkerEditor::slotUpdate" << endl; - //QPtrList<QListViewItem> selection = m_listView->selectedItems(); + //TQPtrList<TQListViewItem> selection = m_listView->selectedItems(); MarkerEditorViewItem *item; @@ -258,7 +258,7 @@ MarkerEditor::slotUpdate() int timeMode = kapp->config()->readNumEntry("timemode", 0); for (it = markers.begin(); it != markers.end(); ++it) { - QString timeString = makeTimeString((*it)->getTime(), timeMode); + TQString timeString = makeTimeString((*it)->getTime(), timeMode); item = new MarkerEditorViewItem(m_listView, @@ -275,14 +275,14 @@ MarkerEditor::slotUpdate() } if (m_listView->childCount() == 0) { - QListViewItem *item = + TQListViewItem *item = new MarkerEditorViewItem(m_listView, 0, i18n("<none>")); ((MarkerEditorViewItem *)item)->setFake(true); m_listView->insertItem(item); - m_listView->setSelectionMode(QListView::NoSelection); + m_listView->setSelectionMode(TQListView::NoSelection); } else { - m_listView->setSelectionMode(QListView::Extended); + m_listView->setSelectionMode(TQListView::Extended); } updatePosition(); @@ -295,7 +295,7 @@ MarkerEditor::slotDeleteAll() RG_DEBUG << "MarkerEditor::slotDeleteAll" << endl; KMacroCommand *command = new KMacroCommand(i18n("Remove all markers")); - QListViewItem *item = m_listView->firstChild(); + TQListViewItem *item = m_listView->firstChild(); do { MarkerEditorViewItem *ei = @@ -333,7 +333,7 @@ void MarkerEditor::slotDelete() { RG_DEBUG << "MarkerEditor::slotDelete" << endl; - QListViewItem *item = m_listView->currentItem(); + TQListViewItem *item = m_listView->currentItem(); MarkerEditorViewItem *ei = dynamic_cast<MarkerEditorViewItem *>(item); @@ -368,11 +368,11 @@ void MarkerEditor::setupActions() { KAction* close = KStdAction::close(this, - SLOT(slotClose()), + TQT_SLOT(slotClose()), actionCollection()); m_closeButton->setText(close->text()); - connect(m_closeButton, SIGNAL(released()), this, SLOT(slotClose())); + connect(m_closeButton, TQT_SIGNAL(released()), this, TQT_SLOT(slotClose())); // some adjustments new KToolBarPopupAction(i18n("Und&o"), @@ -387,37 +387,37 @@ MarkerEditor::setupActions() actionCollection(), KStdAction::stdName(KStdAction::Redo)); - QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); + TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); kapp->config()->setGroup(MarkerEditorConfigGroup); int timeMode = kapp->config()->readNumEntry("timemode", 0); KRadioAction *action; - QCanvasPixmap pixmap(pixmapDir + "/toolbar/time-musical.png"); - QIconSet icon(pixmap); + TQCanvasPixmap pixmap(pixmapDir + "/toolbar/time-musical.png"); + TQIconSet icon(pixmap); action = new KRadioAction(i18n("&Musical Times"), icon, 0, this, - SLOT(slotMusicalTime()), + TQT_SLOT(slotMusicalTime()), actionCollection(), "time_musical"); action->setExclusiveGroup("timeMode"); if (timeMode == 0) action->setChecked(true); pixmap.load(pixmapDir + "/toolbar/time-real.png"); - icon = QIconSet(pixmap); + icon = TQIconSet(pixmap); action = new KRadioAction(i18n("&Real Times"), icon, 0, this, - SLOT(slotRealTime()), + TQT_SLOT(slotRealTime()), actionCollection(), "time_real"); action->setExclusiveGroup("timeMode"); if (timeMode == 1) action->setChecked(true); pixmap.load(pixmapDir + "/toolbar/time-raw.png"); - icon = QIconSet(pixmap); + icon = TQIconSet(pixmap); action = new KRadioAction(i18n("Ra&w Times"), icon, 0, this, - SLOT(slotRawTime()), + TQT_SLOT(slotRawTime()), actionCollection(), "time_raw"); action->setExclusiveGroup("timeMode"); if (timeMode == 2) @@ -459,11 +459,11 @@ MarkerEditor::checkModified() } void -MarkerEditor::slotEdit(QListViewItem *i) +MarkerEditor::slotEdit(TQListViewItem *i) { RG_DEBUG << "MarkerEditor::slotEdit" << endl; - if (m_listView->selectionMode() == QListView::NoSelection) { + if (m_listView->selectionMode() == TQListView::NoSelection) { // The marker list is empty, so we shouldn't allow editing the // <none> placeholder return ; @@ -483,7 +483,7 @@ MarkerEditor::slotEdit(QListViewItem *i) item->text(1), item->text(2)); - if (dialog.exec() == QDialog::Accepted) { + if (dialog.exec() == TQDialog::Accepted) { ModifyMarkerCommand *command = new ModifyMarkerCommand(&m_doc->getComposition(), item->getID(), @@ -499,7 +499,7 @@ MarkerEditor::slotEdit(QListViewItem *i) } void -MarkerEditor::closeEvent(QCloseEvent *e) +MarkerEditor::closeEvent(TQCloseEvent *e) { emit closing(); KMainWindow::closeEvent(e); @@ -516,7 +516,7 @@ MarkerEditor::setDocument(RosegardenGUIDoc *doc) } void -MarkerEditor::slotItemClicked(QListViewItem *item) +MarkerEditor::slotItemClicked(TQListViewItem *item) { RG_DEBUG << "MarkerEditor::slotItemClicked" << endl; MarkerEditorViewItem *ei = @@ -541,7 +541,7 @@ MarkerEditor::makeTimeString(timeT time, int timeMode) m_doc->getComposition().getMusicalTimeForAbsoluteTime (time, bar, beat, fraction, remainder); ++bar; - return QString("%1%2%3-%4%5-%6%7-%8%9 ") + return TQString("%1%2%3-%4%5-%6%7-%8%9 ") .arg(bar / 100) .arg((bar % 100) / 10) .arg(bar % 10) @@ -557,12 +557,12 @@ MarkerEditor::makeTimeString(timeT time, int timeMode) { RealTime rt = m_doc->getComposition().getElapsedRealTime(time); - // return QString("%1 ").arg(rt.toString().c_str()); - return QString("%1 ").arg(rt.toText().c_str()); + // return TQString("%1 ").arg(rt.toString().c_str()); + return TQString("%1 ").arg(rt.toText().c_str()); } default: - return QString("%1 ").arg(time); + return TQString("%1 ").arg(time); } } |