summaryrefslogtreecommitdiff
path: root/muse2/muse/widgets/spinbox.cpp
diff options
context:
space:
mode:
authorTim E. Real <termtech@rogers.com>2010-12-07 03:27:48 +0000
committerTim E. Real <termtech@rogers.com>2010-12-07 03:27:48 +0000
commit8e9886770af1022d88e6f92ff4fcceb3e50d0e55 (patch)
treefb42340c5d7a75278b7ed37478f066324fa59dde /muse2/muse/widgets/spinbox.cpp
parent45f13100f9b5d0fd5a9f4950e135c2ed6de0429c (diff)
Built Awl::posedit and Awl::sigedit, and replaced /widget versions and all usages.
Reverted class SpinBox to previous revision.
Diffstat (limited to 'muse2/muse/widgets/spinbox.cpp')
-rw-r--r--muse2/muse/widgets/spinbox.cpp48
1 files changed, 1 insertions, 47 deletions
diff --git a/muse2/muse/widgets/spinbox.cpp b/muse2/muse/widgets/spinbox.cpp
index aa536809..ee585da7 100644
--- a/muse2/muse/widgets/spinbox.cpp
+++ b/muse2/muse/widgets/spinbox.cpp
@@ -5,10 +5,8 @@
// (C) Copyright 2001 Werner Schweer (ws@seh.de)
//=========================================================
-#include <QEvent>
#include <QKeyEvent>
-#include <QMouseEvent>
-
+#include <QEvent>
#include "spinbox.h"
//---------------------------------------------------------
@@ -27,52 +25,8 @@ SpinBox::SpinBox(int minValue, int maxValue, int step, QWidget* parent)
setRange(minValue, maxValue);
setSingleStep(step);
_clearFocus = true;
- upEnabled = StepUpEnabled;
- downEnabled = StepDownEnabled;
-}
-
-QAbstractSpinBox::StepEnabled SpinBox::stepEnabled() const
-{
- return upEnabled | downEnabled;
}
-void SpinBox::setStepEnabled(bool up, bool down)
-{
- upEnabled = up ? StepUpEnabled : StepNone;
- downEnabled = down ? StepDownEnabled : StepNone;
-}
-
-int SpinBox::arrowWidth() const
-{
- QStyleOptionSpinBox styleOpt;
- styleOpt.initFrom(this);
- QRect upArrowRect = QApplication::style()->subControlRect(QStyle::CC_SpinBox, &styleOpt, QStyle::SC_SpinBoxUp, this);
- return upArrowRect.width();
-}
-
-void SpinBox::setEditor(QLineEdit* ed)
-{
- setLineEdit(ed);
-}
-
-void SpinBox::mousePressEvent ( QMouseEvent * event )
-{
- // FIXME: I couldn't find a way to access the arrow buttons directly. Hence I am using a QRect::contains method.
- // Unfortunately this is not 100% accurate with the Oxygen style; one needs to push to the right hand side of the
- // buttons. But it works perfect with the QtCurve style - Orcan
- QStyleOptionSpinBox styleOpt;
- styleOpt.initFrom(this);
- QRect upArrowRect = QApplication::style()->subControlRect(QStyle::CC_SpinBox, &styleOpt, QStyle::SC_SpinBoxUp, this);
- QRect downArrowRect = QApplication::style()->subControlRect(QStyle::CC_SpinBox, &styleOpt, QStyle::SC_SpinBoxDown, this);
-
- if (upArrowRect.contains(event->pos()))
- emit(stepUpPressed());
- else if (downArrowRect.contains(event->pos()))
- emit(stepDownPressed());
- QSpinBox::mousePressEvent(event);
-}
-
-
bool SpinBox::eventFilter(QObject* o, QEvent* ev)
{
// if (o != (QObject*)editor()) ddskrjo can't find editor()