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. About qdoublevalidation
Qt 6.11 is out! See what's new in the release blog

About qdoublevalidation

Scheduled Pinned Locked Moved General and Desktop
2 Posts 1 Posters 1.1k 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.
  • P Offline
    P Offline
    Project try
    wrote on last edited by
    #1

    Hey guys , I've been searching for a solution:

    @
    lineedit.>setValidator(new QDoubleValidator(0.00,100.00,2,this));
    @

    it works " this is an example " but I still can insert values greater than 100!!

    I searched and found this won't limit the line edit ,because the user can still enter a " . " to set the value , so what can I do to change this the user can only insert values between 0.0 to 100.0 ?

    1 Reply Last reply
    0
    • P Offline
      P Offline
      Project try
      wrote on last edited by
      #2

      Tried this:

      @

      VALID_DOUBLE = new QDoubleValidator;
      VALID_DOUBLE->setNotation(QDoubleValidator::StandardNotation);
      VALID_DOUBLE->setRange(0.00,100.00,2);

      @

      it doesn't really lets the max limit 100 or under but still better since you can't really go above 999 which is nice

      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