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/rulers/MarkerRuler.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/rulers/MarkerRuler.cpp')
-rw-r--r-- | src/gui/rulers/MarkerRuler.cpp | 108 |
1 files changed, 54 insertions, 54 deletions
diff --git a/src/gui/rulers/MarkerRuler.cpp b/src/gui/rulers/MarkerRuler.cpp index 7dcb67a..5d328a8 100644 --- a/src/gui/rulers/MarkerRuler.cpp +++ b/src/gui/rulers/MarkerRuler.cpp @@ -36,22 +36,22 @@ #include "commands/edit/ModifyMarkerCommand.h" #include "document/MultiViewCommandHistory.h" #include <kxmlguifactory.h> -#include <qbrush.h> -#include <qcursor.h> -#include <qfont.h> -#include <qfontmetrics.h> -#include <qpainter.h> -#include <qpen.h> -#include <qpoint.h> -#include <qpopupmenu.h> -#include <qrect.h> -#include <qsize.h> -#include <qstring.h> -#include <qwidget.h> +#include <tqbrush.h> +#include <tqcursor.h> +#include <tqfont.h> +#include <tqfontmetrics.h> +#include <tqpainter.h> +#include <tqpen.h> +#include <tqpoint.h> +#include <tqpopupmenu.h> +#include <tqrect.h> +#include <tqsize.h> +#include <tqstring.h> +#include <tqwidget.h> #include <klocale.h> #include <kaction.h> #include <kstddirs.h> -#include <qtooltip.h> +#include <tqtooltip.h> namespace Rosegarden @@ -61,10 +61,10 @@ MarkerRuler::MarkerRuler(RosegardenGUIDoc *doc, RulerScale *rulerScale, int barHeight, double xorigin, - QWidget* parent, + TQWidget* parent, const char* name, WFlags f) - : QWidget(parent, name, f), + : TQWidget(parent, name, f), m_barHeight(barHeight), m_xorigin(xorigin), m_currentXOffset(0), @@ -80,42 +80,42 @@ MarkerRuler::MarkerRuler(RosegardenGUIDoc *doc, // Otherwise we'll end up adding all actions to the same // (document-level) action collection regardless of which window // we're in. - QObject *probe = parent; + TQObject *probe = parent; while (probe && !dynamic_cast<KMainWindow *>(probe)) probe = probe->parent(); if (probe) m_parentMainWindow = dynamic_cast<KMainWindow *>(probe); - // m_barFont = new QFont("helvetica", 12); + // m_barFont = new TQFont("helvetica", 12); // m_barFont->setPixelSize(12); - m_barFont = new QFont(); + m_barFont = new TQFont(); m_barFont->setPointSize(10); - QString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); - QIconSet icon; + TQString pixmapDir = KGlobal::dirs()->findResource("appdata", "pixmaps/"); + TQIconSet icon; // Use the event insert, delete, edit icons because they are // actually generic enough to serve for anything. Let's hope they // don't become more event-specific in future... - icon = QIconSet(QPixmap(pixmapDir + "/toolbar/event-insert.png")); + icon = TQIconSet(TQPixmap(pixmapDir + "/toolbar/event-insert.png")); new KAction(i18n("Insert Marker"), icon, 0, this, - SLOT(slotInsertMarkerHere()), actionCollection(), + TQT_SLOT(slotInsertMarkerHere()), actionCollection(), "insert_marker_here"); new KAction(i18n("Insert Marker at Playback Position"), 0, this, - SLOT(slotInsertMarkerAtPointer()), actionCollection(), + TQT_SLOT(slotInsertMarkerAtPointer()), actionCollection(), "insert_marker_at_pointer"); - icon = QIconSet(QPixmap(pixmapDir + "/toolbar/event-delete.png")); + icon = TQIconSet(TQPixmap(pixmapDir + "/toolbar/event-delete.png")); new KAction(i18n("Delete Marker"), icon, 0, this, - SLOT(slotDeleteMarker()), actionCollection(), + TQT_SLOT(slotDeleteMarker()), actionCollection(), "delete_marker"); - icon = QIconSet(QPixmap(pixmapDir + "/toolbar/event-edit.png")); + icon = TQIconSet(TQPixmap(pixmapDir + "/toolbar/event-edit.png")); new KAction(i18n("Edit Marker..."), icon, 0, this, - SLOT(slotEditMarker()), actionCollection(), + TQT_SLOT(slotEditMarker()), actionCollection(), "edit_marker"); - QToolTip::add + TQToolTip::add (this, i18n("Click on a marker to move the playback pointer.\nShift-click to set a range between markers.\nDouble-click to open the marker editor.")); } @@ -137,14 +137,14 @@ MarkerRuler::createMenu() KXMLGUIFactory* factory = m_parentMainWindow->factory(); factory->addClient(this); - QWidget* tmp = factory->container("marker_ruler_menu", this); + TQWidget* tmp = factory->container("marker_ruler_menu", this); // if (!tmp) { // RG_DEBUG << "MarkerRuler::createMenu() menu not found\n" // << domDocument().toString(4) << endl; // } - m_menu = dynamic_cast<QPopupMenu*>(tmp); + m_menu = dynamic_cast<TQPopupMenu*>(tmp); if (!m_menu) { RG_DEBUG << "MarkerRuler::createMenu() failed\n"; @@ -159,7 +159,7 @@ MarkerRuler::scrollHoriz(int x) repaint(); } -QSize +TQSize MarkerRuler::sizeHint() const { int lastBar = @@ -168,15 +168,15 @@ MarkerRuler::sizeHint() const m_rulerScale->getBarPosition(lastBar) + m_rulerScale->getBarWidth(lastBar) + m_xorigin; - return QSize(std::max(int(width), m_width), m_barHeight); + return TQSize(std::max(int(width), m_width), m_barHeight); } -QSize +TQSize MarkerRuler::minimumSizeHint() const { double firstBarWidth = m_rulerScale->getBarWidth(0) + m_xorigin; - return QSize(static_cast<int>(firstBarWidth), m_barHeight); + return TQSize(static_cast<int>(firstBarWidth), m_barHeight); } void @@ -220,7 +220,7 @@ MarkerRuler::slotEditMarker() // it, be my guest. MarkerModifyDialog dialog(this, &m_doc->getComposition(), marker); - if (dialog.exec() == QDialog::Accepted) { + if (dialog.exec() == TQDialog::Accepted) { ModifyMarkerCommand *command = new ModifyMarkerCommand(&m_doc->getComposition(), marker->getID(), @@ -244,7 +244,7 @@ MarkerRuler::getClickPosition() Rosegarden::Marker* MarkerRuler::getMarkerAtClickPosition() { - QRect clipRect = visibleRect(); + TQRect clipRect = visibleRect(); int firstBar = m_rulerScale->getBarForX(clipRect.x() - m_currentXOffset - @@ -261,16 +261,16 @@ MarkerRuler::getMarkerAtClickPosition() timeT end = comp.getBarEnd(lastBar); // need these to calculate the visible extents of a marker tag - QPainter painter(this); + TQPainter painter(this); painter.setFont(*m_barFont); - QFontMetrics metrics = painter.fontMetrics(); + TQFontMetrics metrics = painter.fontMetrics(); for (Composition::markerconstiterator i = markers.begin(); i != markers.end(); ++i) { if ((*i)->getTime() >= start && (*i)->getTime() < end) { - QString name(strtoqstr((*i)->getName())); + TQString name(strtoqstr((*i)->getName())); int x = m_rulerScale->getXForTime((*i)->getTime()) + m_xorigin + m_currentXOffset; @@ -299,15 +299,15 @@ MarkerRuler::getMarkerAtClickPosition() } void -MarkerRuler::paintEvent(QPaintEvent*) +MarkerRuler::paintEvent(TQPaintEvent*) { - QPainter painter(this); + TQPainter painter(this); painter.setFont(*m_barFont); if (getHScaleFactor() != 1.0) painter.scale(getHScaleFactor(), 1.0); - QRect clipRect = visibleRect(); + TQRect clipRect = visibleRect(); int firstBar = m_rulerScale->getBarForX(clipRect.x() - m_currentXOffset - @@ -360,19 +360,19 @@ MarkerRuler::paintEvent(QPaintEvent*) painter.drawLine(static_cast<int>(x), 0, static_cast<int>(x), m_barHeight); // disable worldXForm for text - QPoint textDrawPoint = painter.xForm(QPoint(static_cast<int>(x + 4), 12)); + TQPoint textDrawPoint = painter.xForm(TQPoint(static_cast<int>(x + 4), 12)); bool enableXForm = painter.hasWorldXForm(); painter.setWorldXForm(false); if (i >= 0) - painter.drawText(textDrawPoint, QString("%1").arg(i + 1)); + painter.drawText(textDrawPoint, TQString("%1").arg(i + 1)); painter.setWorldXForm(enableXForm); } else { - const QPen normalPen = painter.pen(); + const TQPen normalPen = painter.pen(); ; - QPen endPen(black, 2); + TQPen endPen(black, 2); painter.setPen(endPen); painter.drawLine(static_cast<int>(x), 0, static_cast<int>(x), m_barHeight); painter.setPen(normalPen); @@ -387,11 +387,11 @@ MarkerRuler::paintEvent(QPaintEvent*) timeT start = comp.getBarStart(firstBar); timeT end = comp.getBarEnd(lastBar); - QFontMetrics metrics = painter.fontMetrics(); + TQFontMetrics metrics = painter.fontMetrics(); for (it = markers.begin(); it != markers.end(); ++it) { if ((*it)->getTime() >= start && (*it)->getTime() < end) { - QString name(strtoqstr((*it)->getName())); + TQString name(strtoqstr((*it)->getName())); double x = m_rulerScale->getXForTime((*it)->getTime()) + m_xorigin + m_currentXOffset; @@ -399,13 +399,13 @@ MarkerRuler::paintEvent(QPaintEvent*) painter.fillRect(static_cast<int>(x), 1, static_cast<int>(metrics.width(name) + 5), m_barHeight - 2, - QBrush(GUIPalette::getColour(GUIPalette::MarkerBackground))); + TQBrush(GUIPalette::getColour(GUIPalette::MarkerBackground))); painter.drawLine(int(x), 1, int(x), m_barHeight - 2); painter.drawLine(int(x) + 1, 1, int(x) + 1, m_barHeight - 2); - QPoint textDrawPoint = painter.xForm - (QPoint(static_cast<int>(x + 3), m_barHeight - 4)); + TQPoint textDrawPoint = painter.xForm + (TQPoint(static_cast<int>(x + 3), m_barHeight - 4)); // disable worldXForm for text bool enableXForm = painter.hasWorldXForm(); @@ -420,7 +420,7 @@ MarkerRuler::paintEvent(QPaintEvent*) } void -MarkerRuler::mousePressEvent(QMouseEvent *e) +MarkerRuler::mousePressEvent(TQMouseEvent *e) { RG_DEBUG << "MarkerRuler::mousePressEvent: x = " << e->x() << endl; @@ -438,7 +438,7 @@ MarkerRuler::mousePressEvent(QMouseEvent *e) if (m_menu) { actionCollection()->action("delete_marker")->setEnabled(clickedMarker != 0); actionCollection()->action("edit_marker")->setEnabled(clickedMarker != 0); - m_menu->exec(QCursor::pos()); + m_menu->exec(TQCursor::pos()); } return; } @@ -479,7 +479,7 @@ MarkerRuler::mousePressEvent(QMouseEvent *e) } void -MarkerRuler::mouseDoubleClickEvent(QMouseEvent *) +MarkerRuler::mouseDoubleClickEvent(TQMouseEvent *) { RG_DEBUG << "MarkerRuler::mouseDoubleClickEvent" << endl; |