From 11f31c37e5fa4889d9989f10272f44845449cb7b Mon Sep 17 00:00:00 2001 From: tpearson Date: Mon, 6 Sep 2010 20:59:29 +0000 Subject: Initial TQt conversion git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1172292 283d02a7-25f6-0310-bc7c-ecb5cbfe19da --- src/gui/dialogs/AudioSplitDialog.cpp | 100 +++++++++++++++++------------------ 1 file changed, 50 insertions(+), 50 deletions(-) (limited to 'src/gui/dialogs/AudioSplitDialog.cpp') diff --git a/src/gui/dialogs/AudioSplitDialog.cpp b/src/gui/dialogs/AudioSplitDialog.cpp index 42290b3..b7a1b67 100644 --- a/src/gui/dialogs/AudioSplitDialog.cpp +++ b/src/gui/dialogs/AudioSplitDialog.cpp @@ -36,21 +36,21 @@ #include "gui/application/RosegardenApplication.h" #include "sound/AudioFileManager.h" #include -#include -#include -#include -#include -#include -#include -#include -#include -#include +#include +#include +#include +#include +#include +#include +#include +#include +#include namespace Rosegarden { -AudioSplitDialog::AudioSplitDialog(QWidget *parent, +AudioSplitDialog::AudioSplitDialog(TQWidget *parent, Segment *segment, RosegardenGUIDoc *doc): KDialogBase(parent, 0, true, @@ -65,27 +65,27 @@ AudioSplitDialog::AudioSplitDialog(QWidget *parent, if (!segment || segment->getType() != Segment::Audio) reject(); - QVBox *w = makeVBoxMainWidget(); + TQVBox *w = makeVBoxMainWidget(); - new QLabel(i18n("AutoSplit Segment \"") + - strtoqstr(m_segment->getLabel()) + QString("\""), w); + new TQLabel(i18n("AutoSplit Segment \"") + + strtoqstr(m_segment->getLabel()) + TQString("\""), w); - m_canvas = new QCanvas(w); + m_canvas = new TQCanvas(w); m_canvas->resize(m_canvasWidth, m_canvasHeight); - m_canvasView = new QCanvasView(m_canvas, w); + m_canvasView = new TQCanvasView(m_canvas, w); m_canvasView->setFixedWidth(m_canvasWidth); m_canvasView->setFixedHeight(m_canvasHeight); - m_canvasView->setHScrollBarMode(QScrollView::AlwaysOff); - m_canvasView->setVScrollBarMode(QScrollView::AlwaysOff); + m_canvasView->setHScrollBarMode(TQScrollView::AlwaysOff); + m_canvasView->setVScrollBarMode(TQScrollView::AlwaysOff); m_canvasView->setDragAutoScroll(false); - QHBox *hbox = new QHBox(w); - new QLabel(i18n("Threshold"), hbox); - m_thresholdSpin = new QSpinBox(hbox); + TQHBox *hbox = new TQHBox(w); + new TQLabel(i18n("Threshold"), hbox); + m_thresholdSpin = new TQSpinBox(hbox); m_thresholdSpin->setSuffix(" %"); - connect(m_thresholdSpin, SIGNAL(valueChanged(int)), - SLOT(slotThresholdChanged(int))); + connect(m_thresholdSpin, TQT_SIGNAL(valueChanged(int)), + TQT_SLOT(slotThresholdChanged(int))); // ensure this is cleared m_previewBoxes.clear(); @@ -103,8 +103,8 @@ AudioSplitDialog::drawPreview() { // Delete everything on the canvas // - QCanvasItemList list = m_canvas->allItems(); - for (QCanvasItemList::Iterator it = list.begin(); it != list.end(); it++) + TQCanvasItemList list = m_canvas->allItems(); + for (TQCanvasItemList::Iterator it = list.begin(); it != list.end(); it++) delete *it; // empty the preview boxes @@ -113,13 +113,13 @@ AudioSplitDialog::drawPreview() // Draw a bounding box // int border = 5; - QCanvasRectangle *rect = new QCanvasRectangle(m_canvas); + TQCanvasRectangle *rect = new TQCanvasRectangle(m_canvas); rect->setSize(m_canvasWidth - border * 2, m_canvasHeight - border * 2); rect->setX(border); rect->setY(border); rect->setZ(1); - rect->setPen(kapp->palette().color(QPalette::Active, QColorGroup::Dark)); - rect->setBrush(kapp->palette().color(QPalette::Active, QColorGroup::Base)); + rect->setPen(kapp->palette().color(TQPalette::Active, TQColorGroup::Dark)); + rect->setBrush(kapp->palette().color(TQPalette::Active, TQColorGroup::Base)); rect->setVisible(true); // Get preview in vector form @@ -136,9 +136,9 @@ AudioSplitDialog::drawPreview() m_previewWidth, false); } catch (Exception e) { - QCanvasText *text = new QCanvasText(m_canvas); + TQCanvasText *text = new TQCanvasText(m_canvas); text->setColor(kapp->palette(). - color(QPalette::Active, QColorGroup::Shadow)); + color(TQPalette::Active, TQColorGroup::Shadow)); text->setText(i18n("")); text->setX(30); text->setY(30); @@ -182,28 +182,28 @@ AudioSplitDialog::drawPreview() endY = 0; } - QCanvasLine *line = new QCanvasLine(m_canvas); + TQCanvasLine *line = new TQCanvasLine(m_canvas); line->setPoints(startX + i, startY, startX + i, endY); line->setZ(3); line->setPen(kapp-> - palette().color(QPalette::Active, QColorGroup::Shadow)); + palette().color(TQPalette::Active, TQColorGroup::Shadow)); line->setBrush(kapp-> - palette().color(QPalette::Active, QColorGroup::Shadow)); + palette().color(TQPalette::Active, TQColorGroup::Shadow)); line->setVisible(true); } // Draw zero dc line // - rect = new QCanvasRectangle(m_canvas); + rect = new TQCanvasRectangle(m_canvas); rect->setX(startX); rect->setY(halfHeight - 1); rect->setSize(m_previewWidth, 2); - rect->setPen(kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); - rect->setBrush(kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + rect->setPen(kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); + rect->setBrush(kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); rect->setZ(4); rect->setVisible(true); @@ -211,46 +211,46 @@ AudioSplitDialog::drawPreview() // char msecs[100]; sprintf(msecs, "%03d", m_segment->getAudioStartTime().msec()); - QString startText = QString("%1.%2s") + TQString startText = TQString("%1.%2s") .arg(m_segment->getAudioStartTime().sec) .arg(msecs); - QCanvasText *text = new QCanvasText(m_canvas); + TQCanvasText *text = new TQCanvasText(m_canvas); text->setColor( - kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); text->setText(startText); text->setX(startX - 20); text->setY(m_canvasHeight / 2 - m_previewHeight / 2 - 35); text->setZ(3); text->setVisible(true); - rect = new QCanvasRectangle(m_canvas); + rect = new TQCanvasRectangle(m_canvas); rect->setX(startX - 1); rect->setY(m_canvasHeight / 2 - m_previewHeight / 2 - 14); rect->setSize(1, m_previewHeight + 28); - rect->setPen(kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + rect->setPen(kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); rect->setZ(3); rect->setVisible(true); // End time // sprintf(msecs, "%03d", m_segment->getAudioEndTime().msec()); - QString endText = QString("%1.%2s") + TQString endText = TQString("%1.%2s") .arg(m_segment->getAudioEndTime().sec) .arg(msecs); - text = new QCanvasText(m_canvas); + text = new TQCanvasText(m_canvas); text->setColor( - kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); text->setText(endText); text->setX(startX + m_previewWidth - 20); text->setY(m_canvasHeight / 2 - m_previewHeight / 2 - 35); text->setZ(3); text->setVisible(true); - rect = new QCanvasRectangle(m_canvas); + rect = new TQCanvasRectangle(m_canvas); rect->setX(startX + m_previewWidth - 1); rect->setY(m_canvasHeight / 2 - m_previewHeight / 2 - 14); rect->setSize(1, m_previewHeight + 28); - rect->setPen(kapp->palette().color(QPalette::Active, QColorGroup::Shadow)); + rect->setPen(kapp->palette().color(TQPalette::Active, TQColorGroup::Shadow)); rect->setZ(3); rect->setVisible(true); @@ -273,7 +273,7 @@ AudioSplitDialog::drawSplits(int threshold) threshold); std::vector::iterator it; - std::vector tempRects; + std::vector tempRects; RealTime length = endTime - startTime; double ticksPerUsec = double(m_previewWidth) / @@ -294,20 +294,20 @@ AudioSplitDialog::drawSplits(int threshold) x2 = int(ticksPerUsec * double(double(splitEnd.sec) * 1000000.0 + double(splitEnd.usec()))); - QCanvasRectangle *rect = new QCanvasRectangle(m_canvas); + TQCanvasRectangle *rect = new TQCanvasRectangle(m_canvas); rect->setX(startX + x1); rect->setY(halfHeight - m_previewHeight / 2 - overlapHeight / 2); rect->setZ(2); rect->setSize(x2 - x1, m_previewHeight + overlapHeight); rect->setPen(kapp-> - palette().color(QPalette::Active, QColorGroup::Mid)); + palette().color(TQPalette::Active, TQColorGroup::Mid)); rect->setBrush(kapp-> - palette().color(QPalette::Active, QColorGroup::Mid)); + palette().color(TQPalette::Active, TQColorGroup::Mid)); rect->setVisible(true); tempRects.push_back(rect); } - std::vector::iterator pIt; + std::vector::iterator pIt; // We've written the new Rects, now delete the old ones // -- cgit v1.2.3