Skip to content
QtWS25 Last Chance
  • 0 Votes
    5 Posts
    1k Views
    T
    Tab problem is solved ! I don't think it is a Shortcut Event as StandardKey of QKeySequence does not map Tab key. I don't realy know how it is done inside Qt, I might search later. I actualy just overrode QLineEdit::focusNextPreviousChild to do a validation check: bool LineEdit::focusNextPrevChild(bool next) { if (hasAcceptableInput() == false) { FixInput(); return true; // To prevent searching for other widgets } return QLineEdit::focusNextPrevChild(next); } As a result, if input is invalid when the user press Tab the tooltip is shown but if the input is valid the next widget gain focus [image: 0c0e8ee3-eba1-4d16-aacd-506cecb3cc6c.png] Apparently I still need to have better accuracy for the position of the tooltip though EDIT: QWidget::mapToGlobal already include the position of the widget (should have been obvious) So I just changed mapToGlobal(pos()); to mapToGlobal(s_zero); with static const QPoint s_zero = QPoint(0, 0)
  • QLineEdit validator memory management

    Solved General and Desktop qvalidator
    5
    0 Votes
    5 Posts
    2k Views
    SGaistS
    No there's not, the QIntValidator gets the QLineEdit as parent and thus it will get deleted at the same time as the widget. No leak per se but indeed, if you start to change the validator frequently you'll have a bunch of unused objects lying around that will get deleted when the widget is destroyed. I'd recommend calling deleteLater so you ensure that if there are events pending nothing goes wrong.
  • QDoubleValidate Switching

    Solved General and Desktop qvalidator switch switching line edit
    7
    0 Votes
    7 Posts
    2k Views
    D
    @kshegunov Allright, thanks for the help.
  • QValidator manual validation.

    Unsolved General and Desktop qvalidator
    4
    0 Votes
    4 Posts
    2k Views
    Chris KawaC
    @Kaluss said: but do You maybe know whats that parameter really do? It's suppose to be "cursor position", but in case of regexp validator it's really a useless parameter to satisfy the interface of QValidator. It gets set to the length of the string if the regexp validator doesn't find a match.
  • 0 Votes
    5 Posts
    3k Views
    S
    Thank you for your help
  • 0 Votes
    6 Posts
    2k Views
    SGaistS
    I do :) However, you don't need to build Qt 5.5 to build it, you can use your current Qt version
  • 0 Votes
    7 Posts
    2k Views
    K
    @mrdebug If you are using only uppercase letters in QRegExp you should be fine. E.g. "[IO]{1,1}" shall match only an uppercase 'I' or an uppercase 'O'.