mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-23 10:22:55 +00:00
inverse the alignment of the line editor of QAbstractSpinBox
because that is how I want it to be Signed-off-by: Ivailo Monev <xakepa10@gmail.com>
This commit is contained in:
parent
9ead9c9837
commit
79236242c8
1 changed files with 11 additions and 6 deletions
|
@ -408,7 +408,6 @@ QAbstractSpinBox::CorrectionMode QAbstractSpinBox::correctionMode() const
|
|||
return d->correctionMode;
|
||||
}
|
||||
|
||||
|
||||
/*!
|
||||
\property QAbstractSpinBox::acceptableInput
|
||||
\brief whether the input satisfies the current validation
|
||||
|
@ -440,14 +439,12 @@ bool QAbstractSpinBox::hasAcceptableInput() const
|
|||
Qt::Alignment QAbstractSpinBox::alignment() const
|
||||
{
|
||||
Q_D(const QAbstractSpinBox);
|
||||
|
||||
return (Qt::Alignment)d->edit->alignment();
|
||||
return d->edit->alignment();
|
||||
}
|
||||
|
||||
void QAbstractSpinBox::setAlignment(Qt::Alignment flag)
|
||||
{
|
||||
Q_D(QAbstractSpinBox);
|
||||
|
||||
d->edit->setAlignment(flag);
|
||||
}
|
||||
|
||||
|
@ -601,7 +598,7 @@ void QAbstractSpinBox::stepBy(int steps)
|
|||
This function returns a pointer to the line edit of the spin box.
|
||||
*/
|
||||
|
||||
QLineEdit *QAbstractSpinBox::lineEdit() const
|
||||
QLineEdit* QAbstractSpinBox::lineEdit() const
|
||||
{
|
||||
Q_D(const QAbstractSpinBox);
|
||||
|
||||
|
@ -1442,7 +1439,15 @@ void QAbstractSpinBoxPrivate::init()
|
|||
{
|
||||
Q_Q(QAbstractSpinBox);
|
||||
|
||||
q->setLineEdit(new QLineEdit(q));
|
||||
QLineEdit* lineedit = new QLineEdit(q);
|
||||
// inverse alignment of QLineEdit to put the text next to the arrows and expand text in the
|
||||
// other direction
|
||||
if (q->layoutDirection() == Qt::RightToLeft) {
|
||||
lineedit->setAlignment(Qt::AlignLeft | Qt::AlignVCenter);
|
||||
} else {
|
||||
lineedit->setAlignment(Qt::AlignRight | Qt::AlignVCenter);
|
||||
}
|
||||
q->setLineEdit(lineedit);
|
||||
edit->setObjectName(QLatin1String("qt_spinbox_lineedit"));
|
||||
validator = new QSpinBoxValidator(q, this);
|
||||
edit->setValidator(validator);
|
||||
|
|
Loading…
Add table
Reference in a new issue