mirror of
https://bitbucket.org/mfeemster/fractorium.git
synced 2025-07-02 22:34:52 -04:00
More linux work.
This commit is contained in:
@ -7,11 +7,11 @@
|
||||
/// and change its value using the mouse wheel without explicitly having to click
|
||||
/// inside of it.
|
||||
/// </summary>
|
||||
/// <param name="parent">The parent widget. Default: NULL.</param>
|
||||
/// <param name="height">The height of the spin box. Default: 16.</param>
|
||||
/// <param name="p">The parent widget. Default: NULL.</param>
|
||||
/// <param name="h">The height of the spin box. Default: 16.</param>
|
||||
/// <param name="step">The step used to increment/decrement the spin box when using the mouse wheel. Default: 1.</param>
|
||||
SpinBox::SpinBox(QWidget* parent, int height, int step)
|
||||
: QSpinBox(parent)
|
||||
SpinBox::SpinBox(QWidget* p, int h, int step)
|
||||
: QSpinBox(p)
|
||||
{
|
||||
m_Select = false;
|
||||
m_DoubleClick = false;
|
||||
@ -23,8 +23,8 @@ SpinBox::SpinBox(QWidget* parent, int height, int step)
|
||||
setFrame(false);
|
||||
setButtonSymbols(QAbstractSpinBox::NoButtons);
|
||||
setFocusPolicy(Qt::StrongFocus);
|
||||
setMinimumHeight(height);//setGeometry() has no effect, so set both of these instead.
|
||||
setMaximumHeight(height);
|
||||
setMinimumHeight(h);//setGeometry() has no effect, so set both of these instead.
|
||||
setMaximumHeight(h);
|
||||
lineEdit()->installEventFilter(this);
|
||||
lineEdit()->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
connect(this, SIGNAL(valueChanged(int)), this, SLOT(onSpinBoxValueChanged(int)), Qt::QueuedConnection);
|
||||
@ -141,9 +141,9 @@ bool SpinBox::eventFilter(QObject* o, QEvent* e)
|
||||
{
|
||||
//Take special action for shift to reduce the scroll amount. Control already
|
||||
//increases it automatically.
|
||||
if (QWheelEvent* wheelEvent = dynamic_cast<QWheelEvent*>(e))
|
||||
if (QWheelEvent* wev = dynamic_cast<QWheelEvent*>(e))
|
||||
{
|
||||
Qt::KeyboardModifiers mod = wheelEvent->modifiers();
|
||||
Qt::KeyboardModifiers mod = wev->modifiers();
|
||||
|
||||
if (mod.testFlag(Qt::ShiftModifier))
|
||||
setSingleStep(m_SmallStep);
|
||||
|
Reference in New Issue
Block a user