summaryrefslogtreecommitdiffstats
path: root/src/gui/rulers/ControlRuler.cpp
diff options
context:
space:
mode:
authortpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
committertpearson <tpearson@283d02a7-25f6-0310-bc7c-ecb5cbfe19da>2010-09-06 20:59:29 +0000
commit11f31c37e5fa4889d9989f10272f44845449cb7b (patch)
tree4383da04a76c497950d957fc6120b0fd0d9082c2 /src/gui/rulers/ControlRuler.cpp
parent832eb69d571e8e518db45d0c0e6fbc0f00690209 (diff)
downloadrosegarden-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/ControlRuler.cpp')
-rw-r--r--src/gui/rulers/ControlRuler.cpp102
1 files changed, 51 insertions, 51 deletions
diff --git a/src/gui/rulers/ControlRuler.cpp b/src/gui/rulers/ControlRuler.cpp
index 12064f5..7fea1fc 100644
--- a/src/gui/rulers/ControlRuler.cpp
+++ b/src/gui/rulers/ControlRuler.cpp
@@ -40,15 +40,15 @@
#include "gui/general/RosegardenCanvasView.h"
#include "gui/widgets/TextFloat.h"
#include <kmainwindow.h>
-#include <qcanvas.h>
-#include <qcolor.h>
-#include <qcursor.h>
-#include <qpoint.h>
-#include <qpopupmenu.h>
-#include <qscrollbar.h>
-#include <qscrollview.h>
-#include <qstring.h>
-#include <qwidget.h>
+#include <tqcanvas.h>
+#include <tqcolor.h>
+#include <tqcursor.h>
+#include <tqpoint.h>
+#include <tqpopupmenu.h>
+#include <tqscrollbar.h>
+#include <tqscrollview.h>
+#include <tqstring.h>
+#include <tqwidget.h>
#include <algorithm>
@@ -63,7 +63,7 @@ const int ControlRuler::ItemHeightRange = 64;
ControlRuler::ControlRuler(Segment *segment,
RulerScale* rulerScale,
EditViewBase* parentView,
- QCanvas* c, QWidget* parent,
+ TQCanvas* c, TQWidget* parent,
const char* name, WFlags f) :
RosegardenCanvasView(c, parent, name, f),
m_parentEditView(parentView),
@@ -79,17 +79,17 @@ ControlRuler::ControlRuler(Segment *segment,
m_itemMoved(false),
m_selecting(false),
m_selector(new ControlSelector(this)),
- m_selectionRect(new QCanvasRectangle(canvas())),
+ m_selectionRect(new TQCanvasRectangle(canvas())),
m_menu(0)
{
- setHScrollBarMode(QScrollView::AlwaysOff);
+ setHScrollBarMode(TQScrollView::AlwaysOff);
m_selectionRect->setPen(Qt::red);
setFixedHeight(sizeHint().height());
- connect(this, SIGNAL(stateChange(const QString&, bool)),
- m_parentEditView, SLOT(slotStateChanged(const QString&, bool)));
+ connect(this, TQT_SIGNAL(stateChange(const TQString&, bool)),
+ m_parentEditView, TQT_SLOT(slotStateChanged(const TQString&, bool)));
m_numberFloat = new TextFloat(this);
m_numberFloat->hide();
@@ -120,9 +120,9 @@ void ControlRuler::slotUpdateElementsHPos()
{
computeStaffOffset();
- QCanvasItemList list = canvas()->allItems();
+ TQCanvasItemList list = canvas()->allItems();
- QCanvasItemList::Iterator it = list.begin();
+ TQCanvasItemList::Iterator it = list.begin();
for (; it != list.end(); ++it) {
ControlItem* item = dynamic_cast<ControlItem*>(*it);
if (!item)
@@ -162,7 +162,7 @@ ControlRuler::segmentDeleted(const Segment *)
m_segment = 0;
}
-void ControlRuler::contentsMousePressEvent(QMouseEvent* e)
+void ControlRuler::contentsMousePressEvent(TQMouseEvent* e)
{
if (e->button() != Qt::LeftButton) {
m_numberFloat->hide();
@@ -172,9 +172,9 @@ void ControlRuler::contentsMousePressEvent(QMouseEvent* e)
RG_DEBUG << "ControlRuler::contentsMousePressEvent()\n";
- QPoint p = inverseMapPoint(e->pos());
+ TQPoint p = inverseMapPoint(e->pos());
- QCanvasItemList l = canvas()->collisions(p);
+ TQCanvasItemList l = canvas()->collisions(p);
if (l.count() == 0) { // de-select current item
clearSelectedItems();
@@ -186,12 +186,12 @@ void ControlRuler::contentsMousePressEvent(QMouseEvent* e)
// clear selection unless control was pressed, in which case
// add the event to the current selection
- if (!(e->state() && QMouseEvent::ControlButton)) {
+ if (!(e->state() && TQMouseEvent::ControlButton)) {
clearSelectedItems();
}
ControlItem *topItem = 0;
- for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+ for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
if (ControlItem *item = dynamic_cast<ControlItem*>(*it)) {
@@ -205,7 +205,7 @@ void ControlRuler::contentsMousePressEvent(QMouseEvent* e)
item->handleMouseButtonPress(e);
- for (QCanvasItemList::Iterator it = m_selectedItems.begin();
+ for (TQCanvasItemList::Iterator it = m_selectedItems.begin();
it != m_selectedItems.end(); ++it) {
if (ControlItem *selectedItem =
dynamic_cast<ControlItem*>(*it)) {
@@ -216,7 +216,7 @@ void ControlRuler::contentsMousePressEvent(QMouseEvent* e)
} else { // select it
- if (!(e->state() && QMouseEvent::ControlButton)) {
+ if (!(e->state() && TQMouseEvent::ControlButton)) {
if (item->z() > topItem->z())
topItem = item;
@@ -243,7 +243,7 @@ void ControlRuler::contentsMousePressEvent(QMouseEvent* e)
m_lastEventPos = p;
}
-void ControlRuler::contentsMouseReleaseEvent(QMouseEvent* e)
+void ControlRuler::contentsMouseReleaseEvent(TQMouseEvent* e)
{
if (e->button() != Qt::LeftButton) {
m_numberFloat->hide();
@@ -259,7 +259,7 @@ void ControlRuler::contentsMouseReleaseEvent(QMouseEvent* e)
return ;
}
- for (QCanvasItemList::Iterator it = m_selectedItems.begin(); it != m_selectedItems.end(); ++it) {
+ for (TQCanvasItemList::Iterator it = m_selectedItems.begin(); it != m_selectedItems.end(); ++it) {
if (ControlItem *item = dynamic_cast<ControlItem*>(*it)) {
ElementAdapter * adapter = item->getElementAdapter();
@@ -289,9 +289,9 @@ void ControlRuler::contentsMouseReleaseEvent(QMouseEvent* e)
m_numberFloat->hide();
}
-void ControlRuler::contentsMouseMoveEvent(QMouseEvent* e)
+void ControlRuler::contentsMouseMoveEvent(TQMouseEvent* e)
{
- QPoint p = inverseMapPoint(e->pos());
+ TQPoint p = inverseMapPoint(e->pos());
int deltaX = p.x() - m_lastEventPos.x(),
deltaY = p.y() - m_lastEventPos.y();
@@ -308,7 +308,7 @@ void ControlRuler::contentsMouseMoveEvent(QMouseEvent* e)
// Borrowed from Rotary - compute total position within window
//
- QPoint totalPos = mapTo(topLevelWidget(), QPoint(0, 0));
+ TQPoint totalPos = mapTo(topLevelWidget(), TQPoint(0, 0));
int scrollX = dynamic_cast<EditView*>(m_parentEditView)->getRawCanvasView()->
horizontalScrollBar()->value();
@@ -327,7 +327,7 @@ void ControlRuler::contentsMouseMoveEvent(QMouseEvent* e)
int value = 0;
- for (QCanvasItemList::Iterator it = m_selectedItems.begin(); it != m_selectedItems.end(); ++it) {
+ for (TQCanvasItemList::Iterator it = m_selectedItems.begin(); it != m_selectedItems.end(); ++it) {
if (ControlItem *item = dynamic_cast<ControlItem*>(*it)) {
item->handleMouseMove(e, deltaX, deltaY);
// ElementAdapter* adapter = item->getElementAdapter();
@@ -335,7 +335,7 @@ void ControlRuler::contentsMouseMoveEvent(QMouseEvent* e)
// set value to highest in selection
if (item->getValue() >= value) {
value = item->getValue();
- m_numberFloat->setText(QString("%1").arg(value));
+ m_numberFloat->setText(TQString("%1").arg(value));
}
}
}
@@ -346,10 +346,10 @@ void ControlRuler::contentsMouseMoveEvent(QMouseEvent* e)
}
void
-ControlRuler::contentsWheelEvent(QWheelEvent *e)
+ControlRuler::contentsWheelEvent(TQWheelEvent *e)
{
// not sure what to do yet
- QCanvasView::contentsWheelEvent(e);
+ TQCanvasView::contentsWheelEvent(e);
}
void ControlRuler::updateSelection()
@@ -358,9 +358,9 @@ void ControlRuler::updateSelection()
bool haveSelectedItems = false;
- QCanvasItemList l = getSelectionRectangle()->collisions(true);
+ TQCanvasItemList l = getSelectionRectangle()->collisions(true);
- for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+ for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
if (ControlItem *item = dynamic_cast<ControlItem*>(*it)) {
item->setSelected(true);
@@ -375,7 +375,7 @@ void ControlRuler::updateSelection()
emit stateChange("have_controller_item_selected", haveSelectedItems);
}
-void ControlRuler::contentsContextMenuEvent(QContextMenuEvent* e)
+void ControlRuler::contentsContextMenuEvent(TQContextMenuEvent* e)
{
if (!m_menu && !m_menuName.isEmpty())
createMenu();
@@ -383,7 +383,7 @@ void ControlRuler::contentsContextMenuEvent(QContextMenuEvent* e)
if (m_menu) {
RG_DEBUG << "ControlRuler::showMenu() - show menu with" << m_menu->count() << " items\n";
m_lastEventPos = inverseMapPoint(e->pos());
- m_menu->exec(QCursor::pos());
+ m_menu->exec(TQCursor::pos());
} else
RG_DEBUG << "ControlRuler::showMenu() : no menu to show\n";
@@ -396,7 +396,7 @@ void ControlRuler::createMenu()
KMainWindow* parentMainWindow = dynamic_cast<KMainWindow*>(topLevelWidget());
if (parentMainWindow && parentMainWindow->factory()) {
- m_menu = static_cast<QPopupMenu*>(parentMainWindow->factory()->container(m_menuName, parentMainWindow));
+ m_menu = static_cast<TQPopupMenu*>(parentMainWindow->factory()->container(m_menuName, parentMainWindow));
if (!m_menu) {
RG_DEBUG << "ControlRuler::createMenu() failed\n";
@@ -409,7 +409,7 @@ void ControlRuler::createMenu()
void
ControlRuler::clearSelectedItems()
{
- for (QCanvasItemList::Iterator it = m_selectedItems.begin(); it != m_selectedItems.end(); ++it) {
+ for (TQCanvasItemList::Iterator it = m_selectedItems.begin(); it != m_selectedItems.end(); ++it) {
(*it)->setSelected(false);
}
m_selectedItems.clear();
@@ -420,9 +420,9 @@ ControlRuler::clearSelectedItems()
void ControlRuler::clear()
{
- QCanvasItemList allItems = canvas()->allItems();
+ TQCanvasItemList allItems = canvas()->allItems();
- for (QCanvasItemList::Iterator it = allItems.begin(); it != allItems.end(); ++it) {
+ for (TQCanvasItemList::Iterator it = allItems.begin(); it != allItems.end(); ++it) {
if (ControlItem *item = dynamic_cast<ControlItem*>(*it)) {
delete item;
}
@@ -451,7 +451,7 @@ long ControlRuler::heightToValue(int h)
return val;
}
-QColor ControlRuler::valueToColour(int max, int val)
+TQColor ControlRuler::valueToColour(int max, int val)
{
int maxDefault = DefaultVelocityColour::getInstance()->getMaxValue();
@@ -476,11 +476,11 @@ void ControlRuler::flipForwards()
{
std::pair<int, int> minMax = getZMinMax();
- QCanvasItemList l = canvas()->allItems();
- for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+ TQCanvasItemList l = canvas()->allItems();
+ for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
// skip all but rectangles
- if ((*it)->rtti() != QCanvasItem::Rtti_Rectangle)
+ if ((*it)->rtti() != TQCanvasItem::Rtti_Rectangle)
continue;
// match min
@@ -497,11 +497,11 @@ void ControlRuler::flipBackwards()
{
std::pair<int, int> minMax = getZMinMax();
- QCanvasItemList l = canvas()->allItems();
- for (QCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
+ TQCanvasItemList l = canvas()->allItems();
+ for (TQCanvasItemList::Iterator it = l.begin(); it != l.end(); ++it) {
// skip all but rectangles
- if ((*it)->rtti() != QCanvasItem::Rtti_Rectangle)
+ if ((*it)->rtti() != TQCanvasItem::Rtti_Rectangle)
continue;
// match min
@@ -516,12 +516,12 @@ void ControlRuler::flipBackwards()
std::pair<int, int> ControlRuler::getZMinMax()
{
- QCanvasItemList l = canvas()->allItems();
+ TQCanvasItemList l = canvas()->allItems();
std::vector<int> zList;
- for (QCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
+ for (TQCanvasItemList::Iterator it=l.begin(); it!=l.end(); ++it) {
// skip all but rectangles
- if ((*it)->rtti() != QCanvasItem::Rtti_Rectangle) continue;
+ if ((*it)->rtti() != TQCanvasItem::Rtti_Rectangle) continue;
zList.push_back(int((*it)->z()));
}
@@ -530,7 +530,7 @@ std::pair<int, int> ControlRuler::getZMinMax()
return std::pair<int, int>(zList[0], zList[zList.size() - 1]);
}
-QScrollBar* ControlRuler::getMainHorizontalScrollBar()
+TQScrollBar* ControlRuler::getMainHorizontalScrollBar()
{
return m_mainHorizontalScrollBar ? m_mainHorizontalScrollBar : horizontalScrollBar();
}