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/TrackEditor.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/TrackEditor.cpp')
-rw-r--r-- | src/gui/editors/segment/TrackEditor.cpp | 252 |
1 files changed, 126 insertions, 126 deletions
diff --git a/src/gui/editors/segment/TrackEditor.cpp b/src/gui/editors/segment/TrackEditor.cpp index 32c2b02..9eeb21b 100644 --- a/src/gui/editors/segment/TrackEditor.cpp +++ b/src/gui/editors/segment/TrackEditor.cpp @@ -24,7 +24,7 @@ #include "TrackEditor.h" -#include <qlayout.h> +#include <tqlayout.h> #include <kapplication.h> #include <klocale.h> @@ -64,33 +64,33 @@ #include <kcommand.h> #include <kglobal.h> #include <kmessagebox.h> -#include <qapplication.h> -#include <qcursor.h> -#include <qfont.h> -#include <qpixmap.h> -#include <qpoint.h> -#include <qscrollview.h> -#include <qstring.h> -#include <qstringlist.h> -#include <qstrlist.h> -#include <qwidget.h> -#include <qvalidator.h> -#include <qdragobject.h> -#include <qtextstream.h> +#include <tqapplication.h> +#include <tqcursor.h> +#include <tqfont.h> +#include <tqpixmap.h> +#include <tqpoint.h> +#include <tqscrollview.h> +#include <tqstring.h> +#include <tqstringlist.h> +#include <tqstrlist.h> +#include <tqwidget.h> +#include <tqvalidator.h> +#include <tqdragobject.h> +#include <tqtextstream.h> namespace Rosegarden { TrackEditor::TrackEditor(RosegardenGUIDoc* doc, - QWidget* rosegardenguiview, + TQWidget* rosegardenguiview, RulerScale *rulerScale, bool showTrackLabels, double initialUnitsPerPixel, - QWidget* parent, const char* name, + TQWidget* parent, const char* name, WFlags) : DCOPObject("TrackEditorIface"), - QWidget(parent, name), + TQWidget(parent, name), m_doc(doc), m_rulerScale(rulerScale), m_topStandardRuler(0), @@ -118,9 +118,9 @@ TrackEditor::~TrackEditor() } void -TrackEditor::init(QWidget* rosegardenguiview) +TrackEditor::init(TQWidget* rosegardenguiview) { - QGridLayout *grid = new QGridLayout(this, 4, 2); + TQGridLayout *grid = new TQGridLayout(this, 4, 2); int trackLabelWidth = 230; int barButtonsHeight = 25; @@ -164,18 +164,18 @@ TrackEditor::init(QWidget* rosegardenguiview) m_doc->getStudio(), m_rulerScale, getTrackCellHeight()); - connect(rosegardenguiview, SIGNAL(instrumentParametersChanged(InstrumentId)), - m_compositionModel, SLOT(slotInstrumentParametersChanged(InstrumentId))); - connect(rosegardenguiview->parent(), SIGNAL(instrumentParametersChanged(InstrumentId)), - m_compositionModel, SLOT(slotInstrumentParametersChanged(InstrumentId))); + connect(rosegardenguiview, TQT_SIGNAL(instrumentParametersChanged(InstrumentId)), + m_compositionModel, TQT_SLOT(slotInstrumentParametersChanged(InstrumentId))); + connect(rosegardenguiview->parent(), TQT_SIGNAL(instrumentParametersChanged(InstrumentId)), + m_compositionModel, TQT_SLOT(slotInstrumentParametersChanged(InstrumentId))); m_segmentCanvas = new CompositionView(m_doc, m_compositionModel, this); kapp->config()->setGroup(GeneralOptionsConfigGroup); if (kapp->config()->readBoolEntry("backgroundtextures", true)) { - QPixmap background; - QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); - if (background.load(QString("%1/misc/bg-segmentcanvas.xpm"). + TQPixmap background; + TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); + if (background.load(TQString("%1/misc/bg-segmentcanvas.xpm"). arg(pixmapDir))) { m_segmentCanvas->setBackgroundPixmap(background); m_segmentCanvas->viewport()->setBackgroundPixmap(background); @@ -202,7 +202,7 @@ TrackEditor::init(QWidget* rosegardenguiview) // Track Buttons // - // (must be put in a QScrollView) + // (must be put in a TQScrollView) // m_trackButtonScroll = new QDeferScrollView(this); grid->addWidget(m_trackButtonScroll, 3, 0); @@ -217,111 +217,111 @@ TrackEditor::init(QWidget* rosegardenguiview) canvasHeight, m_trackButtonScroll->viewport()); m_trackButtonScroll->addChild(m_trackButtons); - m_trackButtonScroll->setHScrollBarMode(QScrollView::AlwaysOff); - m_trackButtonScroll->setVScrollBarMode(QScrollView::AlwaysOff); - m_trackButtonScroll->setResizePolicy(QScrollView::AutoOneFit); + m_trackButtonScroll->setHScrollBarMode(TQScrollView::AlwaysOff); + m_trackButtonScroll->setVScrollBarMode(TQScrollView::AlwaysOff); + m_trackButtonScroll->setResizePolicy(TQScrollView::AutoOneFit); m_trackButtonScroll->setBottomMargin(m_bottomStandardRuler->height() + m_segmentCanvas->horizontalScrollBar()->height()); - connect(m_trackButtons, SIGNAL(widthChanged()), - this, SLOT(slotTrackButtonsWidthChanged())); + connect(m_trackButtons, TQT_SIGNAL(widthChanged()), + this, TQT_SLOT(slotTrackButtonsWidthChanged())); - connect(m_trackButtons, SIGNAL(trackSelected(int)), - rosegardenguiview, SLOT(slotSelectTrackSegments(int))); + connect(m_trackButtons, TQT_SIGNAL(trackSelected(int)), + rosegardenguiview, TQT_SLOT(slotSelectTrackSegments(int))); - connect(m_trackButtons, SIGNAL(instrumentSelected(int)), - rosegardenguiview, SLOT(slotUpdateInstrumentParameterBox(int))); + connect(m_trackButtons, TQT_SIGNAL(instrumentSelected(int)), + rosegardenguiview, TQT_SLOT(slotUpdateInstrumentParameterBox(int))); - connect(this, SIGNAL(stateChange(QString, bool)), - rosegardenguiview, SIGNAL(stateChange(QString, bool))); + connect(this, TQT_SIGNAL(stateChange(TQString, bool)), + rosegardenguiview, TQT_SIGNAL(stateChange(TQString, bool))); - connect(m_trackButtons, SIGNAL(modified()), - m_doc, SLOT(slotDocumentModified())); + connect(m_trackButtons, TQT_SIGNAL(modified()), + m_doc, TQT_SLOT(slotDocumentModified())); - connect(m_trackButtons, SIGNAL(muteButton(TrackId, bool)), - rosegardenguiview, SLOT(slotSetMuteButton(TrackId, bool))); + connect(m_trackButtons, TQT_SIGNAL(muteButton(TrackId, bool)), + rosegardenguiview, TQT_SLOT(slotSetMuteButton(TrackId, bool))); // connect loop rulers' follow-scroll signals - connect(m_topStandardRuler->getLoopRuler(), SIGNAL(startMouseMove(int)), - m_segmentCanvas, SLOT(startAutoScroll(int))); - connect(m_topStandardRuler->getLoopRuler(), SIGNAL(stopMouseMove()), - m_segmentCanvas, SLOT(stopAutoScroll())); - connect(m_bottomStandardRuler->getLoopRuler(), SIGNAL(startMouseMove(int)), - m_segmentCanvas, SLOT(startAutoScroll(int))); - connect(m_bottomStandardRuler->getLoopRuler(), SIGNAL(stopMouseMove()), - m_segmentCanvas, SLOT(stopAutoScroll())); - - connect(m_segmentCanvas, SIGNAL(contentsMoving(int, int)), - this, SLOT(slotCanvasScrolled(int, int))); + connect(m_topStandardRuler->getLoopRuler(), TQT_SIGNAL(startMouseMove(int)), + m_segmentCanvas, TQT_SLOT(startAutoScroll(int))); + connect(m_topStandardRuler->getLoopRuler(), TQT_SIGNAL(stopMouseMove()), + m_segmentCanvas, TQT_SLOT(stopAutoScroll())); + connect(m_bottomStandardRuler->getLoopRuler(), TQT_SIGNAL(startMouseMove(int)), + m_segmentCanvas, TQT_SLOT(startAutoScroll(int))); + connect(m_bottomStandardRuler->getLoopRuler(), TQT_SIGNAL(stopMouseMove()), + m_segmentCanvas, TQT_SLOT(stopAutoScroll())); + + connect(m_segmentCanvas, TQT_SIGNAL(contentsMoving(int, int)), + this, TQT_SLOT(slotCanvasScrolled(int, int))); // Synchronize bar buttons' scrollview with segment canvas' scrollbar // - connect(m_segmentCanvas->verticalScrollBar(), SIGNAL(valueChanged(int)), - this, SLOT(slotVerticalScrollTrackButtons(int))); + connect(m_segmentCanvas->verticalScrollBar(), TQT_SIGNAL(valueChanged(int)), + this, TQT_SLOT(slotVerticalScrollTrackButtons(int))); - connect(m_segmentCanvas->verticalScrollBar(), SIGNAL(sliderMoved(int)), - this, SLOT(slotVerticalScrollTrackButtons(int))); + connect(m_segmentCanvas->verticalScrollBar(), TQT_SIGNAL(sliderMoved(int)), + this, TQT_SLOT(slotVerticalScrollTrackButtons(int))); // scrolling with mouse wheel - connect(m_trackButtonScroll, SIGNAL(gotWheelEvent(QWheelEvent*)), - m_segmentCanvas, SLOT(slotExternalWheelEvent(QWheelEvent*))); + connect(m_trackButtonScroll, TQT_SIGNAL(gotWheelEvent(TQWheelEvent*)), + m_segmentCanvas, TQT_SLOT(slotExternalWheelEvent(TQWheelEvent*))); // Connect horizontal scrollbar // - connect(m_segmentCanvas->horizontalScrollBar(), SIGNAL(valueChanged(int)), - m_topStandardRuler, SLOT(slotScrollHoriz(int))); - connect(m_segmentCanvas->horizontalScrollBar(), SIGNAL(sliderMoved(int)), - m_topStandardRuler, SLOT(slotScrollHoriz(int))); + connect(m_segmentCanvas->horizontalScrollBar(), TQT_SIGNAL(valueChanged(int)), + m_topStandardRuler, TQT_SLOT(slotScrollHoriz(int))); + connect(m_segmentCanvas->horizontalScrollBar(), TQT_SIGNAL(sliderMoved(int)), + m_topStandardRuler, TQT_SLOT(slotScrollHoriz(int))); - connect(m_segmentCanvas->horizontalScrollBar(), SIGNAL(valueChanged(int)), - m_bottomStandardRuler, SLOT(slotScrollHoriz(int))); - connect(m_segmentCanvas->horizontalScrollBar(), SIGNAL(sliderMoved(int)), - m_bottomStandardRuler, SLOT(slotScrollHoriz(int))); + connect(m_segmentCanvas->horizontalScrollBar(), TQT_SIGNAL(valueChanged(int)), + m_bottomStandardRuler, TQT_SLOT(slotScrollHoriz(int))); + connect(m_segmentCanvas->horizontalScrollBar(), TQT_SIGNAL(sliderMoved(int)), + m_bottomStandardRuler, TQT_SLOT(slotScrollHoriz(int))); - connect(m_segmentCanvas->horizontalScrollBar(), SIGNAL(valueChanged(int)), - m_tempoRuler, SLOT(slotScrollHoriz(int))); - connect(m_segmentCanvas->horizontalScrollBar(), SIGNAL(sliderMoved(int)), - m_tempoRuler, SLOT(slotScrollHoriz(int))); + connect(m_segmentCanvas->horizontalScrollBar(), TQT_SIGNAL(valueChanged(int)), + m_tempoRuler, TQT_SLOT(slotScrollHoriz(int))); + connect(m_segmentCanvas->horizontalScrollBar(), TQT_SIGNAL(sliderMoved(int)), + m_tempoRuler, TQT_SLOT(slotScrollHoriz(int))); - connect(m_segmentCanvas->horizontalScrollBar(), SIGNAL(valueChanged(int)), - m_chordNameRuler, SLOT(slotScrollHoriz(int))); - connect(m_segmentCanvas->horizontalScrollBar(), SIGNAL(sliderMoved(int)), - m_chordNameRuler, SLOT(slotScrollHoriz(int))); + connect(m_segmentCanvas->horizontalScrollBar(), TQT_SIGNAL(valueChanged(int)), + m_chordNameRuler, TQT_SLOT(slotScrollHoriz(int))); + connect(m_segmentCanvas->horizontalScrollBar(), TQT_SIGNAL(sliderMoved(int)), + m_chordNameRuler, TQT_SLOT(slotScrollHoriz(int))); - connect(this, SIGNAL(needUpdate()), m_segmentCanvas, SLOT(slotUpdateSegmentsDrawBuffer())); + connect(this, TQT_SIGNAL(needUpdate()), m_segmentCanvas, TQT_SLOT(slotUpdateSegmentsDrawBuffer())); connect(m_segmentCanvas->getModel(), - SIGNAL(selectedSegments(const SegmentSelection &)), + TQT_SIGNAL(selectedSegments(const SegmentSelection &)), rosegardenguiview, - SLOT(slotSelectedSegments(const SegmentSelection &))); + TQT_SLOT(slotSelectedSegments(const SegmentSelection &))); - connect(m_segmentCanvas, SIGNAL(zoomIn()), - RosegardenGUIApp::self(), SLOT(slotZoomIn())); - connect(m_segmentCanvas, SIGNAL(zoomOut()), - RosegardenGUIApp::self(), SLOT(slotZoomOut())); + connect(m_segmentCanvas, TQT_SIGNAL(zoomIn()), + RosegardenGUIApp::self(), TQT_SLOT(slotZoomIn())); + connect(m_segmentCanvas, TQT_SIGNAL(zoomOut()), + RosegardenGUIApp::self(), TQT_SLOT(slotZoomOut())); - connect(getCommandHistory(), SIGNAL(commandExecuted()), - this, SLOT(update())); + connect(getCommandHistory(), TQT_SIGNAL(commandExecuted()), + this, TQT_SLOT(update())); - connect(m_doc, SIGNAL(pointerPositionChanged(timeT)), - this, SLOT(slotSetPointerPosition(timeT))); + connect(m_doc, TQT_SIGNAL(pointerPositionChanged(timeT)), + this, TQT_SLOT(slotSetPointerPosition(timeT))); // // pointer and loop drag signals from top and bottom bar buttons (loop rulers actually) // - connect(m_topStandardRuler, SIGNAL(dragPointerToPosition(timeT)), - this, SLOT(slotPointerDraggedToPosition(timeT))); - connect(m_bottomStandardRuler, SIGNAL(dragPointerToPosition(timeT)), - this, SLOT(slotPointerDraggedToPosition(timeT))); + connect(m_topStandardRuler, TQT_SIGNAL(dragPointerToPosition(timeT)), + this, TQT_SLOT(slotPointerDraggedToPosition(timeT))); + connect(m_bottomStandardRuler, TQT_SIGNAL(dragPointerToPosition(timeT)), + this, TQT_SLOT(slotPointerDraggedToPosition(timeT))); - connect(m_topStandardRuler, SIGNAL(dragLoopToPosition(timeT)), - this, SLOT(slotLoopDraggedToPosition(timeT))); - connect(m_bottomStandardRuler, SIGNAL(dragLoopToPosition(timeT)), - this, SLOT(slotLoopDraggedToPosition(timeT))); + connect(m_topStandardRuler, TQT_SIGNAL(dragLoopToPosition(timeT)), + this, TQT_SLOT(slotLoopDraggedToPosition(timeT))); + connect(m_bottomStandardRuler, TQT_SIGNAL(dragLoopToPosition(timeT)), + this, TQT_SLOT(slotLoopDraggedToPosition(timeT))); - connect(m_doc, SIGNAL(loopChanged(timeT, + connect(m_doc, TQT_SIGNAL(loopChanged(timeT, timeT)), - this, SLOT(slotSetLoop(timeT, timeT))); + this, TQT_SLOT(slotSetLoop(timeT, timeT))); } void TrackEditor::slotReadjustCanvasSize() @@ -342,17 +342,17 @@ void TrackEditor::slotTrackButtonsWidthChanged() int TrackEditor::getTrackCellHeight() const { int size; - static QFont defaultFont; + static TQFont defaultFont; // do some scrabbling around for a reasonable size // size = defaultFont.pixelSize(); if (size < 8) { - if (QApplication::font(this).pixelSize() < 8) + if (TQApplication::font(this).pixelSize() < 8) size = 12; else - size = QApplication::font(this).pixelSize(); + size = TQApplication::font(this).pixelSize(); } return size + 12; @@ -382,7 +382,7 @@ void TrackEditor::updateRulers() getBottomStandardRuler()->update(); } -void TrackEditor::paintEvent(QPaintEvent* e) +void TrackEditor::paintEvent(TQPaintEvent* e) { if (isCompositionModified()) { @@ -407,7 +407,7 @@ void TrackEditor::paintEvent(QPaintEvent* e) setCompositionModified(false); } - QWidget::paintEvent(e); + TQWidget::paintEvent(e); } void TrackEditor::slotAddTracks(unsigned int nbNewTracks, @@ -443,7 +443,7 @@ void TrackEditor::addSegment(int track, int time, unsigned int duration) void TrackEditor::slotSegmentOrderChanged(int section, int fromIdx, int toIdx) { - RG_DEBUG << QString("TrackEditor::segmentOrderChanged(section : %1, from %2, to %3)") + RG_DEBUG << TQString("TrackEditor::segmentOrderChanged(section : %1, from %2, to %3)") .arg(section).arg(fromIdx).arg(toIdx) << endl; //!!! how do we get here? need to involve a command @@ -461,7 +461,7 @@ TrackEditor::slotCanvasScrolled(int x, int y) m_bottomStandardRuler->getLoopRuler()->hasActiveMousePress() && !m_bottomStandardRuler->getLoopRuler()->getLoopingMode())) { - int mx = m_segmentCanvas->viewport()->mapFromGlobal(QCursor::pos()).x(); + int mx = m_segmentCanvas->viewport()->mapFromGlobal(TQCursor::pos()).x(); m_segmentCanvas->setPointerPos(x + mx); // bad idea, creates a feedback loop @@ -642,7 +642,7 @@ TrackEditor::slotTurnRepeatingSegmentToRealCopies() if (segments.size() == 0) return ; - QString text; + TQString text; if (segments.size() == 1) text = i18n("Turn Repeating Segment into Real Copies"); @@ -668,16 +668,16 @@ TrackEditor::slotVerticalScrollTrackButtons(int y) m_trackButtonScroll->setContentsPos(0, y); } -void TrackEditor::dragEnterEvent(QDragEnterEvent *event) +void TrackEditor::dragEnterEvent(TQDragEnterEvent *event) { - event->accept(QUriDrag::canDecode(event) || - QTextDrag::canDecode(event)); + event->accept(TQUriDrag::canDecode(event) || + TQTextDrag::canDecode(event)); } -void TrackEditor::dropEvent(QDropEvent* event) +void TrackEditor::dropEvent(TQDropEvent* event) { - QStrList uri; - QString text; + TQStrList uri; + TQString text; int heightAdjust = 0; //int widthAdjust = 0; @@ -693,7 +693,7 @@ void TrackEditor::dropEvent(QDropEvent* event) if (m_chordNameRuler && m_chordNameRuler->isVisible()) heightAdjust += m_chordNameRuler->height(); - QPoint posInSegmentCanvas = + TQPoint posInSegmentCanvas = m_segmentCanvas->viewportToContents (m_segmentCanvas-> viewport()->mapFrom(this, event->pos())); @@ -706,20 +706,20 @@ void TrackEditor::dropEvent(QDropEvent* event) m_segmentCanvas->grid().snapX(posInSegmentCanvas.x()); - if (QUriDrag::decode(event, uri)) { + if (TQUriDrag::decode(event, uri)) { RG_DEBUG << "TrackEditor::dropEvent() : got URI :" << uri.first() << endl; - QString uriPath = uri.first(); + TQString uriPath = uri.first(); if (uriPath.endsWith(".rg")) { emit droppedDocument(uriPath); } else { - QStrList uris; - QString uri; - if (QUriDrag::decode(event, uris)) uri = uris.first(); -// QUriDrag::decodeLocalFiles(event, files); -// QString filePath = files.first(); + TQStrList uris; + TQString uri; + if (TQUriDrag::decode(event, uris)) uri = uris.first(); +// TQUriDrag::decodeLocalFiles(event, files); +// TQString filePath = files.first(); RG_DEBUG << "TrackEditor::dropEvent() : got URI: " << uri << endl; @@ -736,8 +736,8 @@ void TrackEditor::dropEvent(QDropEvent* event) Track* track = m_doc->getComposition().getTrackByPosition(trackPos); if (track) { - QString audioText; - QTextOStream t(&audioText); + TQString audioText; + TQTextOStream t(&audioText); t << uri << "\n"; t << track->getId() << "\n"; @@ -748,7 +748,7 @@ void TrackEditor::dropEvent(QDropEvent* event) } - } else if (QTextDrag::decode(event, text)) { + } else if (TQTextDrag::decode(event, text)) { RG_DEBUG << "TrackEditor::dropEvent() : got text info " << endl; //<< text << endl; @@ -758,14 +758,14 @@ void TrackEditor::dropEvent(QDropEvent* event) // WARNING // // DO NOT PERFORM ANY OPERATIONS AFTER THAT - // EMITTING THIS SIGNAL TRIGGERS THE LOADING OF A NEW DOCUMENT + // EMITTING THIS TQT_SIGNAL TRIGGERS THE LOADING OF A NEW DOCUMENT // AND AS A CONSEQUENCE THE DELETION OF THIS TrackEditor OBJECT // } else { - QTextIStream s(&text); + TQTextIStream s(&text); - QString id; + TQString id; AudioFileId audioFileId; RealTime startTime, endTime; @@ -796,8 +796,8 @@ void TrackEditor::dropEvent(QDropEvent* event) << posInSegmentCanvas.x() << endl; - QString audioText; - QTextOStream t(&audioText); + TQString audioText; + TQTextOStream t(&audioText); t << audioFileId << "\n"; t << track->getId() << "\n"; t << time << "\n"; // time on canvas |