diff options
author | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-02 22:38:52 +0000 |
---|---|---|
committer | tpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da> | 2011-05-02 22:38:52 +0000 |
commit | 458efa7b0c935cbaafa2791021a5f8f7241aa876 (patch) | |
tree | 624583f2873febe23770bee3fa94b5c24bd59f4f /src/gui/rulers/MarkerRuler.cpp | |
parent | 747037b72944ae2c02962b7c5c96e0a7f8852e38 (diff) | |
download | rosegarden-458efa7b0c935cbaafa2791021a5f8f7241aa876.tar.gz rosegarden-458efa7b0c935cbaafa2791021a5f8f7241aa876.zip |
Initial TQt4 port of Rosegarden
This enables compilation under both Qt3 and Qt4
git-svn-id: svn://anonsvn.kde.org/home/kde/branches/trinity/applications/rosegarden@1230242 283d02a7-25f6-0310-bc7c-ecb5cbfe19da
Diffstat (limited to 'src/gui/rulers/MarkerRuler.cpp')
-rw-r--r-- | src/gui/rulers/MarkerRuler.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/gui/rulers/MarkerRuler.cpp b/src/gui/rulers/MarkerRuler.cpp index 5d328a8..f572e64 100644 --- a/src/gui/rulers/MarkerRuler.cpp +++ b/src/gui/rulers/MarkerRuler.cpp @@ -61,10 +61,10 @@ MarkerRuler::MarkerRuler(RosegardenGUIDoc *doc, RulerScale *rulerScale, int barHeight, double xorigin, - TQWidget* parent, + TQWidget* tqparent, const char* name, WFlags f) - : TQWidget(parent, name, f), + : TQWidget(tqparent, name, f), m_barHeight(barHeight), m_xorigin(xorigin), m_currentXOffset(0), @@ -73,16 +73,16 @@ MarkerRuler::MarkerRuler(RosegardenGUIDoc *doc, m_menu(0), m_doc(doc), m_rulerScale(rulerScale), - m_parentMainWindow(dynamic_cast<KMainWindow*>(doc->parent())) + m_tqparentMainWindow(dynamic_cast<KMainWindow*>(doc->tqparent())) { - // If the parent window has a main window above it, we need to use - // that as the parent main window, not the document's parent. + // If the tqparent window has a main window above it, we need to use + // that as the tqparent main window, not the document's tqparent. // Otherwise we'll end up adding all actions to the same // (document-level) action collection regardless of which window // we're in. - TQObject *probe = parent; - while (probe && !dynamic_cast<KMainWindow *>(probe)) probe = probe->parent(); - if (probe) m_parentMainWindow = dynamic_cast<KMainWindow *>(probe); + TQObject *probe = TQT_TQOBJECT(tqparent); + while (probe && !dynamic_cast<KMainWindow *>(probe)) probe = probe->tqparent(); + if (probe) m_tqparentMainWindow = dynamic_cast<KMainWindow *>(probe); // m_barFont = new TQFont("helvetica", 12); // m_barFont->setPixelSize(12); @@ -97,21 +97,21 @@ MarkerRuler::MarkerRuler(RosegardenGUIDoc *doc, // don't become more event-specific in future... icon = TQIconSet(TQPixmap(pixmapDir + "/toolbar/event-insert.png")); - new KAction(i18n("Insert Marker"), icon, 0, this, + new KAction(i18n("Insert Marker"), icon, 0, TQT_TQOBJECT(this), TQT_SLOT(slotInsertMarkerHere()), actionCollection(), "insert_marker_here"); - new KAction(i18n("Insert Marker at Playback Position"), 0, this, + new KAction(i18n("Insert Marker at Playback Position"), 0, TQT_TQOBJECT(this), TQT_SLOT(slotInsertMarkerAtPointer()), actionCollection(), "insert_marker_at_pointer"); icon = TQIconSet(TQPixmap(pixmapDir + "/toolbar/event-delete.png")); - new KAction(i18n("Delete Marker"), icon, 0, this, + new KAction(i18n("Delete Marker"), icon, 0, TQT_TQOBJECT(this), TQT_SLOT(slotDeleteMarker()), actionCollection(), "delete_marker"); icon = TQIconSet(TQPixmap(pixmapDir + "/toolbar/event-edit.png")); - new KAction(i18n("Edit Marker..."), icon, 0, this, + new KAction(i18n("Edit Marker..."), icon, 0, TQT_TQOBJECT(this), TQT_SLOT(slotEditMarker()), actionCollection(), "edit_marker"); @@ -124,7 +124,7 @@ MarkerRuler::~MarkerRuler() delete m_barFont; // we have to do this so that the menu is re-created properly // when the main window is itself recreated (on a File->New for instance) - KXMLGUIFactory* factory = m_parentMainWindow->factory(); + KXMLGUIFactory* factory = m_tqparentMainWindow->factory(); if (factory) factory->removeClient(this); } @@ -134,7 +134,7 @@ MarkerRuler::createMenu() { setXMLFile("markerruler.rc"); - KXMLGUIFactory* factory = m_parentMainWindow->factory(); + KXMLGUIFactory* factory = m_tqparentMainWindow->factory(); factory->addClient(this); TQWidget* tmp = factory->container("marker_ruler_menu", this); @@ -156,11 +156,11 @@ void MarkerRuler::scrollHoriz(int x) { m_currentXOffset = static_cast<int>( -x / getHScaleFactor()); - repaint(); + tqrepaint(); } TQSize -MarkerRuler::sizeHint() const +MarkerRuler::tqsizeHint() const { int lastBar = m_rulerScale->getLastVisibleBar(); @@ -172,7 +172,7 @@ MarkerRuler::sizeHint() const } TQSize -MarkerRuler::minimumSizeHint() const +MarkerRuler::tqminimumSizeHint() const { double firstBarWidth = m_rulerScale->getBarWidth(0) + m_xorigin; @@ -201,8 +201,8 @@ MarkerRuler::slotDeleteMarker() if (marker) emit deleteMarker(marker->getID(), marker->getTime(), - marker->getName(), - marker->getDescription()); + marker->getName().c_str(), + marker->getDescription().c_str()); } void @@ -366,7 +366,7 @@ MarkerRuler::paintEvent(TQPaintEvent*) painter.setWorldXForm(false); if (i >= 0) - painter.drawText(textDrawPoint, TQString("%1").arg(i + 1)); + painter.drawText(textDrawPoint, TQString("%1").tqarg(i + 1)); painter.setWorldXForm(enableXForm); } else { @@ -432,7 +432,7 @@ MarkerRuler::mousePressEvent(TQMouseEvent *e) // if right-click, show popup menu // - if (e->button() == RightButton) { + if (e->button() == Qt::RightButton) { if (!m_menu) createMenu(); if (m_menu) { @@ -443,7 +443,7 @@ MarkerRuler::mousePressEvent(TQMouseEvent *e) return; } - bool shiftPressed = ((e->state() & Qt::ShiftButton) != 0); + bool shiftPressed = ((e->state() & TQt::ShiftButton) != 0); Composition &comp = m_doc->getComposition(); Composition::markercontainer markers = comp.getMarkers(); |