VirtualBox

Ignore:
Timestamp:
Sep 17, 2019 2:03:02 PM (5 years ago)
Author:
vboxsync
Message:

FE/Qt: bugref:9335: Restorıng the cursor position instead of moving to end of the text

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/VBox/Frontends/VirtualBox/src/widgets/UIMediumSizeEditor.cpp

    r80859 r80861  
    4848    /* Prepare: */
    4949    prepare();
    50     QString strRegEx = QString("[^(\\d|%1)]").arg(uiCommon().decimalSep());
     50    QString strRegEx = QString("[^\\d%1]").arg(uiCommon().decimalSep());
    5151    m_regExNonDigitOrSeparator = QRegularExpression(strRegEx);
    5252}
     
    105105
    106106    m_pEditor->blockSignals(true);
     107    int iCursorPosition = m_pEditor->cursorPosition();
    107108    m_pEditor->setText(strSizeString);
    108     /* Reposition the cursor to the front of the size suffix (and 1 char for the space) */
    109     m_pEditor->setCursorPosition(strSizeString.length() - (gpConverter->toString(m_enmSizeSuffix).length() + 1));
     109    m_pEditor->setCursorPosition(iCursorPosition);
    110110    m_pEditor->blockSignals(false);
    111111
Note: See TracChangeset for help on using the changeset viewer.

© 2024 Oracle Support Privacy / Do Not Sell My Info Terms of Use Trademark Policy Automated Access Etiquette