{
stepBy(1);
}
{
// ...
selectAll();
}
{
// ...
d->setSelected(d->currentSectionIndex);
}
void QDateTimeEditPrivate::setSelected(int sectionIndex, bool forward)
{
if (specialValue()) {
edit->selectAll();
} else {
// ...
if (forward) {
edit->setSelection(sectionPos(node), size);
} else {
edit->setSelection(sectionPos(node) + size, -size);
}
}
}
void QAbstractSpinBox::stepUp()
{
stepBy(1);
}
void QAbstractSpinBox::stepBy(int steps)
{
// ...
selectAll();
}
void QDateTimeEdit::stepBy(int steps)
{
// ...
d->setSelected(d->currentSectionIndex);
}
void QDateTimeEditPrivate::setSelected(int sectionIndex, bool forward)
{
if (specialValue()) {
edit->selectAll();
} else {
// ...
if (forward) {
edit->setSelection(sectionPos(node), size);
} else {
edit->setSelection(sectionPos(node) + size, -size);
}
}
}
To copy to clipboard, switch view to plain text mode
Unfortunately setSelected() is in private part of the QDateTimeEdit implementation, so you can't use it directly.
Bookmarks