More linux work.

This commit is contained in:
mfeemster
2014-12-10 21:50:15 -08:00
parent 0438827ba5
commit a9ecb6a78e
61 changed files with 1415 additions and 627 deletions

View File

@ -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);