Commit 158ad441 authored by David Jarvie's avatar David Jarvie
Browse files

Fix time spin boxes being displayed in the wrong position

Using Qt 5.15.3, widgets directly inherited from SpinBox2 were
redisplayed in the wrong position, at the top left of their parent's
widget. This is fixed by adding a layout into SpinBox2.
parent 4565ff43
Pipeline #166475 passed with stage
in 1 minute and 55 seconds
KAlarm Change Log
=== Version 3.4.1 (KDE Gear 22.04.1) --- 18 April 2022 ===
=== Version 3.4.1 (KDE Gear 22.04.1) --- 20 April 2022 ===
* Fix checkboxes being disabled in Preferences dialogue.
* Fix time spin boxes being displayed in the wrong position.
=== Version 3.4.0 (KDE Gear 22.04) --- 6 April 2022 ===
* Allow calendars and date picker to be shown together in side panel [KDE Bug 440250]
......
/*
* spinbox2.cpp - spin box with extra pair of spin buttons
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2021 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2001-2022 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
......@@ -19,6 +19,7 @@
#include <QBrush>
#include <QApplication>
#include <QPixmap>
#include <QHBoxLayout>
#include <stdlib.h>
......@@ -59,26 +60,56 @@ inline QPixmap grabWidget(QWidget* w, QRect r = QRect())
}
int SpinBox2::mRightToLeft = -1;
/*===========================================================================*/
SpinBox2::SpinBox2(QWidget* parent)
: QFrame(parent)
: QWidget(parent)
, mSpinbox2(new SpinBox2p(this))
{
mSpinbox2 = new ExtraSpinBox(this);
mSpinbox = new MainSpinBox(this);
init();
// Can't call SpinBox2p methods until this widget is contructed
mSpinbox2->init();
}
SpinBox2::SpinBox2(int minValue, int maxValue, int pageStep, QWidget* parent)
: QFrame(parent)
: QWidget(parent)
, mSpinbox2(new SpinBox2p(this, minValue, maxValue))
{
mSpinbox2 = new ExtraSpinBox(minValue, maxValue, this);
mSpinbox = new MainSpinBox(minValue, maxValue, this);
setSteps(1, pageStep);
init();
// Can't call SpinBox2p methods until this widget is contructed
mSpinbox2->setSteps(1, pageStep);
mSpinbox2->init();
}
void SpinBox2::init()
{
auto layout = new QHBoxLayout;
layout->setContentsMargins(0, 0, 0, 0);
layout->setSpacing(0);
setLayout(layout);
layout->addWidget(mSpinbox2);
connect(mSpinbox2, &SpinBox2p::valueChanged, this, &SpinBox2::valueChanged);
}
/*===========================================================================*/
int SpinBox2p::mRightToLeft = -1;
SpinBox2p::SpinBox2p(SpinBox2* spinbox2, QWidget* parent)
: QFrame(parent)
{
mSpinbox2 = new ExtraSpinBox(this);
mSpinbox = new MainSpinBox(spinbox2, this);
}
SpinBox2p::SpinBox2p(SpinBox2* spinbox2, int minValue, int maxValue, QWidget* parent)
: QFrame(parent)
{
mSpinbox2 = new ExtraSpinBox(minValue, maxValue, this);
mSpinbox = new MainSpinBox(spinbox2, minValue, maxValue, this);
}
void SpinBox2p::init()
{
if (mRightToLeft < 0)
mRightToLeft = QApplication::isRightToLeft() ? 1 : 0;
......@@ -95,16 +126,16 @@ void SpinBox2::init()
mSpinMirror = new SpinMirror(mSpinbox2, mSpinbox, this);
mSpinbox->installEventFilter(this);
mSpinbox2->installEventFilter(this);
connect(mSpinbox, &QSpinBox::valueChanged, this, &SpinBox2::valueChange);
connect(mSpinbox, &QSpinBox::valueChanged, this, &SpinBox2::valueChanged);
connect(mSpinbox2, &SpinBox::stepped, this, &SpinBox2::stepPage);
connect(mSpinbox2, &ExtraSpinBox::painted, this, &SpinBox2::paintTimer);
connect(mSpinbox, &QSpinBox::valueChanged, this, &SpinBox2p::valueChange);
connect(mSpinbox, &QSpinBox::valueChanged, this, &SpinBox2p::valueChanged);
connect(mSpinbox2, &SpinBox::stepped, this, &SpinBox2p::stepPage);
connect(mSpinbox2, &ExtraSpinBox::painted, this, &SpinBox2p::paintTimer);
mShowUpdown2 = false; // ensure that setShowUpdown2(true) actually does something
setShowUpdown2(true);
}
void SpinBox2::setReadOnly(bool ro)
void SpinBox2p::setReadOnly(bool ro)
{
if (static_cast<int>(ro) != static_cast<int>(mSpinbox->isReadOnly()))
{
......@@ -114,7 +145,7 @@ void SpinBox2::setReadOnly(bool ro)
}
}
void SpinBox2::setReverseWithLayout(bool reverse)
void SpinBox2p::setReverseWithLayout(bool reverse)
{
if (reverse != mReverseWithLayout)
{
......@@ -124,7 +155,7 @@ void SpinBox2::setReverseWithLayout(bool reverse)
}
}
void SpinBox2::setEnabled(bool enabled)
void SpinBox2p::setEnabled(bool enabled)
{
QFrame::setEnabled(enabled);
mSpinbox->setEnabled(enabled);
......@@ -132,23 +163,23 @@ void SpinBox2::setEnabled(bool enabled)
updateMirror();
}
void SpinBox2::setWrapping(bool on)
void SpinBox2p::setWrapping(bool on)
{
mSpinbox->setWrapping(on);
mSpinbox2->setWrapping(on);
}
QRect SpinBox2::up2Rect() const
QRect SpinBox2p::up2Rect() const
{
return mShowUpdown2 ? mSpinbox2->upRect() : QRect();
}
QRect SpinBox2::down2Rect() const
QRect SpinBox2p::down2Rect() const
{
return mShowUpdown2 ? mSpinbox2->downRect() : QRect();
}
void SpinBox2::setSingleStep(int step)
void SpinBox2p::setSingleStep(int step)
{
mSingleStep = step;
if (reverseButtons())
......@@ -157,14 +188,14 @@ void SpinBox2::setSingleStep(int step)
mSpinbox->setSingleStep(step);
}
void SpinBox2::setSteps(int single, int page)
void SpinBox2p::setSteps(int single, int page)
{
mSingleStep = single;
mPageStep = page;
setSteps();
}
void SpinBox2::setSteps() const
void SpinBox2p::setSteps() const
{
if (reverseButtons() && mShowUpdown2)
{
......@@ -178,7 +209,7 @@ void SpinBox2::setSteps() const
}
}
void SpinBox2::setShiftSteps(int single, int page, int control, bool modControl)
void SpinBox2p::setShiftSteps(int single, int page, int control, bool modControl)
{
mSingleShiftStep = single;
mPageShiftStep = page;
......@@ -187,7 +218,7 @@ void SpinBox2::setShiftSteps(int single, int page, int control, bool modControl)
setShiftSteps();
}
void SpinBox2::setShiftSteps() const
void SpinBox2p::setShiftSteps() const
{
if (reverseButtons() && mShowUpdown2)
{
......@@ -205,7 +236,7 @@ void SpinBox2::setShiftSteps() const
mSpinbox->setSingleControlStep(mSingleControlStep, mModControlStep);
}
void SpinBox2::setButtonSymbols(QSpinBox::ButtonSymbols newSymbols)
void SpinBox2p::setButtonSymbols(QSpinBox::ButtonSymbols newSymbols)
{
if (mSpinbox->buttonSymbols() == newSymbols)
return;
......@@ -213,26 +244,26 @@ void SpinBox2::setButtonSymbols(QSpinBox::ButtonSymbols newSymbols)
mSpinbox2->setButtonSymbols(newSymbols);
}
int SpinBox2::bound(int val) const
int SpinBox2p::bound(int val) const
{
return (val < mMinValue) ? mMinValue : (val > mMaxValue) ? mMaxValue : val;
}
void SpinBox2::setMinimum(int val)
void SpinBox2p::setMinimum(int val)
{
mMinValue = val;
mSpinbox->setMinimum(val);
mSpinbox2->setMinimum(val);
}
void SpinBox2::setMaximum(int val)
void SpinBox2p::setMaximum(int val)
{
mMaxValue = val;
mSpinbox->setMaximum(val);
mSpinbox2->setMaximum(val);
}
void SpinBox2::valueChange()
void SpinBox2p::valueChange()
{
const int val = mSpinbox->value();
const bool blocked = mSpinbox2->signalsBlocked();
......@@ -246,12 +277,12 @@ void SpinBox2::valueChange()
* (At construction time, the spin button widths cannot be determined correctly,
* so we need to wait until now to definitively rearrange the widget.)
*/
void SpinBox2::showEvent(QShowEvent*)
void SpinBox2p::showEvent(QShowEvent*)
{
rearrange();
}
QSize SpinBox2::sizeHint() const
QSize SpinBox2p::sizeHint() const
{
getMetrics();
QSize size = mSpinbox->sizeHint();
......@@ -260,7 +291,7 @@ QSize SpinBox2::sizeHint() const
return size;
}
QSize SpinBox2::minimumSizeHint() const
QSize SpinBox2p::minimumSizeHint() const
{
getMetrics();
QSize size = mSpinbox->minimumSizeHint();
......@@ -269,32 +300,32 @@ QSize SpinBox2::minimumSizeHint() const
return size;
}
void SpinBox2::paintEvent(QPaintEvent* e)
void SpinBox2p::paintEvent(QPaintEvent* e)
{
QFrame::paintEvent(e);
if (mShowUpdown2)
QTimer::singleShot(0, this, &SpinBox2::updateMirrorFrame);
QTimer::singleShot(0, this, &SpinBox2p::updateMirrorFrame);
}
void SpinBox2::paintTimer()
void SpinBox2p::paintTimer()
{
if (mShowUpdown2)
QTimer::singleShot(0, this, &SpinBox2::updateMirrorButtons); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
QTimer::singleShot(0, this, &SpinBox2p::updateMirrorButtons); //NOLINT(clang-analyzer-cplusplus.NewDeleteLeaks)
}
void SpinBox2::updateMirrorButtons()
void SpinBox2p::updateMirrorButtons()
{
if (mShowUpdown2)
mSpinMirror->setButtonsImage();
}
void SpinBox2::updateMirrorFrame()
void SpinBox2p::updateMirrorFrame()
{
if (mShowUpdown2)
mSpinMirror->setFrameImage();
}
void SpinBox2::spinboxResized(QResizeEvent* e)
void SpinBox2p::spinboxResized(QResizeEvent* e)
{
if (mShowUpdown2)
{
......@@ -311,7 +342,7 @@ void SpinBox2::spinboxResized(QResizeEvent* e)
* Set the size of the second spin button widget.
* It is necessary to fix the size to avoid infinite recursion in arrange().
*/
void SpinBox2::setUpdown2Size()
void SpinBox2p::setUpdown2Size()
{
if (mShowUpdown2)
mSpinMirror->setButtonsImage();
......@@ -321,13 +352,13 @@ void SpinBox2::setUpdown2Size()
* Called when the extra pair of spin buttons has repainted after a style change.
* Updates the mirror image of the spin buttons.
*/
void SpinBox2::updateMirror()
void SpinBox2p::updateMirror()
{
mSpinMirror->setButtonsImage();
mSpinMirror->setFrameImage();
}
bool SpinBox2::eventFilter(QObject* obj, QEvent* e)
bool SpinBox2p::eventFilter(QObject* obj, QEvent* e)
{
if (obj == mSpinbox && e->type() == QEvent::StyleChange)
{
......@@ -396,7 +427,7 @@ bool SpinBox2::eventFilter(QObject* obj, QEvent* e)
}
}
if (updateButtons)
QTimer::singleShot(0, this, &SpinBox2::updateMirrorButtons);
QTimer::singleShot(0, this, &SpinBox2p::updateMirrorButtons);
return false;
}
......@@ -404,7 +435,7 @@ bool SpinBox2::eventFilter(QObject* obj, QEvent* e)
* Set up the widget's geometry. Called when the widget is about to be
* displayed, or when the style changes.
*/
void SpinBox2::rearrange()
void SpinBox2p::rearrange()
{
setUpdown2Size(); // set the new size of the second pair of spin buttons
arrange();
......@@ -418,7 +449,7 @@ void SpinBox2::rearrange()
/******************************************************************************
* Set the positions and sizes of all the child widgets.
*/
void SpinBox2::arrange()
void SpinBox2p::arrange()
{
QSize sz = mSpinbox->minimumSizeHint();
mSpinbox->setMinimumSize(sz);
......@@ -447,7 +478,7 @@ mSpinbox2->setAutoFillBackground(true);
mSpinbox->setGeometry(mRightToLeft ? 0 : spinboxOffset, 0, width() - spinboxOffset, height());
QRect rf(0, 0, mSpinbox->width() + spinboxOffset, height());
setGeometry(rf);
// qCDebug(KALARM_LOG) << "SpinBox2::getMetrics: mirrorRect="<<mirrorRect<<", mSpinbox2="<<mSpinbox2->geometry()<<", mSpinbox="<<mSpinbox->geometry()<<", width="<<width();
// qCDebug(KALARM_LOG) << "SpinBox2p::getMetrics: mirrorRect="<<mirrorRect<<", mSpinbox2="<<mSpinbox2->geometry()<<", mSpinbox="<<mSpinbox->geometry()<<", width="<<width();
mSpinMirror->resize(mirrorWidth, mSpinbox2->height());
mSpinMirror->setGeometry(mirrorRect);
......@@ -460,7 +491,7 @@ mSpinbox2->setAutoFillBackground(true);
* Calculate the width and position of the extra pair of spin buttons.
* Style-specific adjustments are made for a better appearance.
*/
void SpinBox2::getMetrics() const
void SpinBox2p::getMetrics() const
{
QStyleOptionSpinBox option;
mSpinbox->initStyleOption(option);
......@@ -489,7 +520,7 @@ void SpinBox2::getMetrics() const
: isMirrorStyle(udStyle) ? buttons2DrawRect.left() - buttons2Rect.left()
: frame2Rect.right() - buttons2DrawRect.right();
mButtonPos = QPoint(butx, buttons2Rect.top());
// qCDebug(KALARM_LOG) << "SpinBox2::getMetrics: mSpinbox2:"<<mSpinbox2->geometry()<<", buttons:"<<buttons2Rect<<", buttons draw:"<<buttons2DrawRect<<", edit:"<<spinBoxEditFieldRect(mSpinbox2)<<", frame:"<<frame2Rect<<", frame width:"<<wFrameWidth<<", border:"<<wBorderWidth<<, "wUpdown2="<<wUpdown2<<", wFrameWidth="<<wFrameWidth<<", frame right="<<mSpinbox2->width() - buttons2Rect.right() - 1<<", button Pos:"<<mButtonPos;
// qCDebug(KALARM_LOG) << "SpinBox2p::getMetrics: mSpinbox2:"<<mSpinbox2->geometry()<<", buttons:"<<buttons2Rect<<", buttons draw:"<<buttons2DrawRect<<", edit:"<<spinBoxEditFieldRect(mSpinbox2)<<", frame:"<<frame2Rect<<", frame width:"<<wFrameWidth<<", border:"<<wBorderWidth<<, "wUpdown2="<<wUpdown2<<", wFrameWidth="<<wFrameWidth<<", frame right="<<mSpinbox2->width() - buttons2Rect.right() - 1<<", button Pos:"<<mButtonPos;
}
/******************************************************************************
......@@ -497,7 +528,7 @@ void SpinBox2::getMetrics() const
* Normally this is a page step, but with a right-to-left language where the
* button functions are reversed, this is a line step.
*/
void SpinBox2::stepPage(int step, bool modified)
void SpinBox2p::stepPage(int step, bool modified)
{
if (abs(step) == mSpinbox2->singleStep() || modified)
mSpinbox->setValue(mSpinbox2->value());
......@@ -534,7 +565,7 @@ void SpinBox2::stepPage(int step, bool modified)
/******************************************************************************
* Set whether the second pair of spin buttons should be shown.
*/
void SpinBox2::setShowUpdown2(bool show) const
void SpinBox2p::setShowUpdown2(bool show) const
{
if (show != mShowUpdown2)
{
......@@ -548,18 +579,33 @@ void SpinBox2::setShowUpdown2(bool show) const
/*=============================================================================
= Class SpinBox2::MainSpinBox
= Class SpinBox2p::MainSpinBox
=============================================================================*/
QString SpinBox2p::MainSpinBox::textFromValue(int v) const
{
return owner->textFromValue(v);
}
int SpinBox2p::MainSpinBox::valueFromText(const QString& t) const
{
return owner->valueFromText(t);
}
QValidator::State SpinBox2p::MainSpinBox::validate(QString& text, int& pos) const
{
return owner->validate(text, pos);
}
/******************************************************************************
* Return the initial adjustment to the value for a shift step up or down, for
* the main (visible) spin box.
* Normally this is a line step, but with a right-to-left language where the
* button functions are reversed, this is a page step.
*/
int SpinBox2::MainSpinBox::shiftStepAdjustment(int oldValue, int shiftStep)
int SpinBox2p::MainSpinBox::shiftStepAdjustment(int oldValue, int shiftStep)
{
if (owner->mShowUpdown2 && owner->reverseButtons())
if (owner_p->mShowUpdown2 && owner_p->reverseButtons())
{
// The button pairs have the opposite function from normal.
// Page shift stepping - step up or down to a multiple of the
......
/*
* spinbox2.h - spin box with extra pair of spin buttons
* Program: kalarm
* SPDX-FileCopyrightText: 2001-2021 David Jarvie <djarvie@kde.org>
* SPDX-FileCopyrightText: 2001-2022 David Jarvie <djarvie@kde.org>
*
* SPDX-License-Identifier: GPL-2.0-or-later
*/
#pragma once
#include "spinbox.h"
#include <QFrame>
class QShowEvent;
class QResizeEvent;
class SpinMirror;
class ExtraSpinBox;
#include "spinbox2_p.h"
/**
* @short Spin box with a pair of spin buttons on either side.
......@@ -42,7 +35,7 @@ class ExtraSpinBox;
*
* @author David Jarvie <djarvie@kde.org>
*/
class SpinBox2 : public QFrame
class SpinBox2 : public QWidget
{
Q_OBJECT
public:
......@@ -62,141 +55,141 @@ public:
/** Sets whether the spin box can be changed by the user.
* @param readOnly True to set the widget read-only, false to set it read-write.
*/
virtual void setReadOnly(bool readOnly);
virtual void setReadOnly(bool readOnly) { return mSpinbox2->setReadOnly(readOnly); }
/** Returns true if the widget is read only. */
bool isReadOnly() const { return mSpinbox->isReadOnly(); }
bool isReadOnly() const { return mSpinbox2->isReadOnly(); }
/** Sets whether the spin box value text should be selected when its value is stepped. */
void setSelectOnStep(bool sel) { mSpinbox->setSelectOnStep(sel); }
void setSelectOnStep(bool sel) { mSpinbox2->setSelectOnStep(sel); }
/** Sets whether the spin button pairs should be reversed for a right-to-left language.
* The default is for them to be reversed.
*/
void setReverseWithLayout(bool reverse);
void setReverseWithLayout(bool reverse) { mSpinbox2->setReverseWithLayout(reverse); }
/** Returns whether the spin button pairs will be reversed for a right-to-left language. */
bool reverseButtons() const { return mRightToLeft && !mReverseWithLayout; }
bool reverseButtons() const { return mSpinbox2->reverseButtons(); }
/** Returns the spin box's text, including any prefix() and suffix(). */
QString text() const { return mSpinbox->text(); }
QString text() const { return mSpinbox2->text(); }
/** Returns the prefix for the spin box's text. */
QString prefix() const { return mSpinbox->prefix(); }
QString prefix() const { return mSpinbox2->prefix(); }
/** Returns the suffix for the spin box's text. */
QString suffix() const { return mSpinbox->suffix(); }
QString suffix() const { return mSpinbox2->suffix(); }
/** Sets the prefix which is prepended to the start of the displayed text. */
void setPrefix(const QString& text) { mSpinbox->setPrefix(text); }
void setPrefix(const QString& text) { mSpinbox2->setPrefix(text); }
/** Sets the suffix which is prepended to the start of the displayed text. */
void setSuffix(const QString& text) { mSpinbox->setSuffix(text); }
void setSuffix(const QString& text) { mSpinbox2->setSuffix(text); }
/** Returns the spin box's text with no prefix(), suffix() or leading or trailing whitespace. */
QString cleanText() const { return mSpinbox->cleanText(); }
QString cleanText() const { return mSpinbox2->cleanText(); }
/** Sets the special-value text which, if non-null, is displayed instead of a numeric
* value when the current value is equal to minimum().
*/
void setSpecialValueText(const QString& text) { mSpinbox->setSpecialValueText(text); }
void setSpecialValueText(const QString& text) { mSpinbox2->setSpecialValueText(text); }
/** Returns the special-value text which, if non-null, is displayed instead of a numeric
* value when the current value is equal to minimum().
*/
QString specialValueText() const { return mSpinbox->specialValueText(); }
QString specialValueText() const { return mSpinbox2->specialValueText(); }
/** Sets whether it is possible to step the value from the highest value to the
* lowest value and vice versa.
*/
void setWrapping(bool on);
void setWrapping(bool on) { mSpinbox2->setWrapping(on); }
/** Returns whether it is possible to step the value from the highest value to the
* lowest value and vice versa.
*/
bool wrapping() const { return mSpinbox->wrapping(); }
bool wrapping() const { return mSpinbox2->wrapping(); }
/** Set the text alignment of the widget */
void setAlignment(Qt::Alignment a) { mSpinbox->setAlignment(a); }
void setAlignment(Qt::Alignment a) { mSpinbox2->setAlignment(a); }
/** Sets the button symbols to use (arrows or plus/minus). */
void setButtonSymbols(QSpinBox::ButtonSymbols);
void setButtonSymbols(QSpinBox::ButtonSymbols s) { mSpinbox2->setButtonSymbols(s); }
/** Returns the button symbols currently in use (arrows or plus/minus). */
QSpinBox::ButtonSymbols buttonSymbols() const { return mSpinbox->buttonSymbols(); }
QSpinBox::ButtonSymbols buttonSymbols() const { return mSpinbox2->buttonSymbols(); }
/** Determine whether the current input is valid. */
virtual QValidator::State validate(QString&, int& /*pos*/) const { return QValidator::Acceptable; }
virtual QValidator::State validate(QString& s, int& pos) const { return mSpinbox2->validate(s, pos); }
QSize sizeHint() const override;
QSize minimumSizeHint() const override;
QSize sizeHint() const override { return mSpinbox2->sizeHint(); }
QSize minimumSizeHint() const override { return mSpinbox2->minimumSizeHint(); }
/** Returns the minimum value of the spin box. */
int minimum() const { return mMinValue; }
int minimum() const { return mSpinbox2->minimum(); }
/** Returns the maximum value of the spin box. */
int maximum() const { return mMaxValue; }
int maximum() const { return mSpinbox2->maximum(); }
/** Sets the minimum value of the spin box. */
virtual void setMinimum(int val);
virtual void setMinimum(int val) { mSpinbox2->setMinimum(val); }
/** Sets the maximum value of the spin box. */
virtual void setMaximum(int val);
virtual void setMaximum(int val) { mSpinbox2->setMaximum(val); }
/** Sets the minimum and maximum values of the spin box. */
void setRange(int minValue, int maxValue) { setMinimum(minValue); setMaximum(maxValue); }
void setRange(int minValue, int maxValue) { mSpinbox2->setRange(minValue, maxValue); }
/** Returns the current value of the spin box. */
int value() const { return mSpinbox->value(); }
int value() const { return mSpinbox2->value(); }
/** Returns the specified value clamped to the range of the spin box. */
int bound(int val) const;
int bound(int val) const { return mSpinbox2->bound(val); }
/** Returns the geometry of the right-hand "up" button. */
QRect upRect() const { return mSpinbox->upRect(); }
QRect upRect() const { return mSpinbox2->upRect(); }
/** Returns the geometry of the right-hand "down" button. */
QRect downRect() const { return mSpinbox->downRect(); }
QRect downRect() const { return mSpinbox2->downRect(); }
/** Returns the geometry of the left-hand "up" button.
* @return Button geometry, or invalid if left-hand buttons are not visible.
*/
QRect up2Rect() const;
QRect up2Rect() const { return mSpinbox2->up2Rect(); }
/** Returns the geometry of the left-hand "down" button.
* @return Button geometry, or invalid if left-hand buttons are not visible.
*/
QRect down2Rect() const;
QRect down2Rect() const { return mSpinbox2->down2Rect(); }
/** Returns the unshifted step increment for the right-hand spin buttons,
* i.e. the amount by which the spin box value changes when a right-hand
* spin button is clicked without the shift key being pressed.
*/
int singleStep() const { return mSingleStep; }
int singleStep() const { return mSpinbox2->singleStep(); }
/** Returns the shifted step increment for the right-hand spin buttons,
* i.e. the amount by which the spin box value changes when a right-hand
* spin button is clicked while the shift key is pressed.
*/
int singleShiftStep() const { return mSingleShiftStep; }
int singleShiftStep() const { return mSpinbox2->singleShiftStep(); }
/** Returns the unshifted step increment for the left-hand spin buttons,
* i.e. the amount by which the spin box value changes when a left-hand
* spin button is clicked without the shift key being pressed.
*/
int pageStep() const { return mPageStep; }
int pageStep() const { return mSpinbox2->pageStep(); }
/** Returns the shifted step increment for the left-hand spin buttons,
* i.e. the amount by which the spin box value changes when a left-hand
* spin button is clicked while the shift key is pressed.
*/
int pageShiftStep() const { return mPageShiftStep; }
int pageShiftStep() const { return mSpinbox2->pageShiftStep(); }