Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. Trouble with QValidator and editingFinished()
Forum Updated to NodeBB v4.3 + New Features

Trouble with QValidator and editingFinished()

Scheduled Pinned Locked Moved General and Desktop
3 Posts 2 Posters 1.0k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • M Offline
    M Offline
    MisteKiste
    wrote on last edited by
    #1

    Hey,

    I got a QLineEdit Field connected with a editingFinished() signal. It should do an action when the QLineEdit field is empty. Thats works fine. But now i would like add a QValidator to the filed, like this:
    @
    v = new QIntValidator(0, 999, this);
    field->setValidator(v);
    @

    Now the problem is, when the field goes empty the editingFinished() won't called. Is there any way to do this with a QValidator?

    1 Reply Last reply
    0
    • E Offline
      E Offline
      ElboyQt
      wrote on last edited by
      #2

      Hey, try this
      @field->setValidator(new QRegExpValidator(QRegExp("\d{0,3}")));@

      1 Reply Last reply
      0
      • M Offline
        M Offline
        MisteKiste
        wrote on last edited by
        #3

        Yes that works perfectly. Thank you! :)

        1 Reply Last reply
        0

        • Login

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • Users
        • Groups
        • Search
        • Get Qt Extensions
        • Unsolved