Navigation

    Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Search
    • Unsolved
    1. Home
    2. Tags
    3. qvalidator
    Log in to post

    • UNSOLVED QToolTip::showText not showing - Mouse event ?
      General and Desktop • mouse event qvalidator qtooltip • • TheFarman  

      5
      0
      Votes
      5
      Posts
      514
      Views

      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 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)
    • SOLVED QLineEdit validator memory management
      General and Desktop • qvalidator • • Eligijus  

      5
      0
      Votes
      5
      Posts
      1351
      Views

      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.
    • SOLVED QDoubleValidate Switching
      General and Desktop • line edit qvalidator switch switching • • Dan90  

      7
      0
      Votes
      7
      Posts
      1687
      Views

      @kshegunov Allright, thanks for the help.
    • UNSOLVED QValidator manual validation.
      General and Desktop • qvalidator • • Kaluss  

      4
      0
      Votes
      4
      Posts
      1413
      Views

      @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.
    • [SOLVED] Validate inputs using QValidator class
      General and Desktop • forms qvalidator • • sachi  

      5
      0
      Votes
      5
      Posts
      1928
      Views

      Thank you for your help
    • Not getting what I expected using a regex in QRegExpValidator.
      General and Desktop • regex qvalidator qregexpvalidato • • ealione  

      6
      0
      Votes
      6
      Posts
      1658
      Views

      I do :) However, you don't need to build Qt 5.5 to build it, you can use your current Qt version
    • QValidator, more than one in a one QLineEdit
      General and Desktop • qlineedit qvalidator • • mrdebug  

      7
      0
      Votes
      7
      Posts
      1804
      Views

      @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'.