diff options
Diffstat (limited to 'src/gui/widgets/Rotary.cpp')
-rw-r--r-- | src/gui/widgets/Rotary.cpp | 44 |
1 files changed, 22 insertions, 22 deletions
diff --git a/src/gui/widgets/Rotary.cpp b/src/gui/widgets/Rotary.cpp index f7cd1ec..a011275 100644 --- a/src/gui/widgets/Rotary.cpp +++ b/src/gui/widgets/Rotary.cpp @@ -60,7 +60,7 @@ static TQTimer *_floatTimer = 0; Rotary::PixmapCache Rotary::m_pixmaps; -Rotary::Rotary(TQWidget *parent, +Rotary::Rotary(TQWidget *tqparent, float minValue, float maxValue, float step, @@ -71,7 +71,7 @@ Rotary::Rotary(TQWidget *parent, bool snapToTicks, bool centred, bool logarithmic) : - TQWidget(parent), + TQWidget(tqparent), m_minValue(minValue), m_maxValue(maxValue), m_step(step), @@ -89,7 +89,7 @@ Rotary::Rotary(TQWidget *parent, m_knobColour(0, 0, 0), m_logarithmic(logarithmic) { - setBackgroundMode(Qt::NoBackground); + setBackgroundMode(TQt::NoBackground); if (!_float) _float = new TextFloat(this); @@ -133,7 +133,7 @@ void Rotary::setKnobColour(const TQColor &colour) { m_knobColour = colour; - repaint(); + tqrepaint(); } void @@ -187,7 +187,7 @@ Rotary::paintEvent(TQPaintEvent *) pen.setWidth(scale); paint.setPen(pen); - if (m_knobColour != Qt::black) { + if (m_knobColour != TQt::black) { paint.setBrush(m_knobColour); } else { paint.setBrush( @@ -223,7 +223,7 @@ Rotary::paintEvent(TQPaintEvent *) paint.setBrush(TQBrush::NoBrush); - pen.setColor(colorGroup().dark()); + pen.setColor(tqcolorGroup().dark()); pen.setWidth(scale); paint.setPen(pen); @@ -253,7 +253,7 @@ Rotary::paintEvent(TQPaintEvent *) paint.setPen(pen); int shadowAngle = -720; - c = colorGroup().dark(); + c = tqcolorGroup().dark(); for (int arc = 120; arc < 2880; arc += 240) { pen.setColor(c); paint.setPen(pen); @@ -263,7 +263,7 @@ Rotary::paintEvent(TQPaintEvent *) } shadowAngle = 2160; - c = colorGroup().dark(); + c = tqcolorGroup().dark(); for (int arc = 120; arc < 2880; arc += 240) { pen.setColor(c); paint.setPen(pen); @@ -289,7 +289,7 @@ Rotary::paintEvent(TQPaintEvent *) double y = hyp + len * cos(angle); pen.setWidth(scale * 2); - pen.setColor(colorGroup().dark()); + pen.setColor(tqcolorGroup().dark()); paint.setPen(pen); paint.drawLine(int(x0), int(y0), int(x), int(y)); @@ -373,17 +373,17 @@ Rotary::snapPosition() void Rotary::mousePressEvent(TQMouseEvent *e) { - if (e->button() == LeftButton) { + if (e->button() == Qt::LeftButton) { m_buttonPressed = true; m_lastY = e->y(); m_lastX = e->x(); - } else if (e->button() == MidButton) // reset to default + } else if (e->button() == Qt::MidButton) // reset to default { m_position = m_initialPosition; snapPosition(); update(); emit valueChanged(m_snapPosition); - } else if (e->button() == RightButton) // reset to centre position + } else if (e->button() == Qt::RightButton) // reset to centre position { m_position = (m_maxValue + m_minValue) / 2.0; snapPosition(); @@ -391,23 +391,23 @@ Rotary::mousePressEvent(TQMouseEvent *e) emit valueChanged(m_snapPosition); } - TQPoint totalPos = mapTo(topLevelWidget(), TQPoint(0, 0)); + TQPoint totalPos = mapTo(tqtopLevelWidget(), TQPoint(0, 0)); if (!_float) _float = new TextFloat(this); _float->reparent(this); _float->move(totalPos + TQPoint(width() + 2, -height() / 2)); if (m_logarithmic) { - _float->setText(TQString("%1").arg(powf(10, m_position))); + _float->setText(TQString("%1").tqarg(powf(10, m_position))); } else { - _float->setText(TQString("%1").arg(m_position)); + _float->setText(TQString("%1").tqarg(m_position)); } _float->show(); // std::cerr << "Rotary::mousePressEvent: logarithmic = " << m_logarithmic // << ", position = " << m_position << std::endl; - if (e->button() == RightButton || e->button() == MidButton) { + if (e->button() == Qt::RightButton || e->button() == Qt::MidButton) { // one shot, 500ms _floatTimer->start(500, true); } @@ -455,7 +455,7 @@ Rotary::mouseDoubleClickEvent(TQMouseEvent * /*e*/) void Rotary::mouseReleaseEvent(TQMouseEvent *e) { - if (e->button() == LeftButton) { + if (e->button() == Qt::LeftButton) { m_buttonPressed = false; m_lastY = 0; m_lastX = 0; @@ -498,9 +498,9 @@ Rotary::mouseMoveEvent(TQMouseEvent *e) // draw on the float text if (m_logarithmic) { - _float->setText(TQString("%1").arg(powf(10, m_snapPosition))); + _float->setText(TQString("%1").tqarg(powf(10, m_snapPosition))); } else { - _float->setText(TQString("%1").arg(m_snapPosition)); + _float->setText(TQString("%1").tqarg(m_snapPosition)); } } } @@ -527,15 +527,15 @@ Rotary::wheelEvent(TQWheelEvent *e) // draw on the float text if (m_logarithmic) { - _float->setText(TQString("%1").arg(powf(10, m_snapPosition))); + _float->setText(TQString("%1").tqarg(powf(10, m_snapPosition))); } else { - _float->setText(TQString("%1").arg(m_snapPosition)); + _float->setText(TQString("%1").tqarg(m_snapPosition)); } // Reposition - we need to sum the relative positions up to the // topLevel or dialog to please move(). Move just top/right of the rotary // - TQPoint totalPos = mapTo(topLevelWidget(), TQPoint(0, 0)); + TQPoint totalPos = mapTo(tqtopLevelWidget(), TQPoint(0, 0)); _float->reparent(this); _float->move(totalPos + TQPoint(width() + 2, -height() / 2)); _float->show(); |