Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Qt Creator and other tools
  4. line edit only numbers with int64

line edit only numbers with int64

Scheduled Pinned Locked Moved Solved Qt Creator and other tools
2 Posts 2 Posters 731 Views
  • 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
    MrLibya
    wrote on last edited by
    #1

    hello
    i want make a line edit only accept numbers , so i used :

    ui->barcode->setValidator(new QIntValidator(0, 999999999999, this));
    

    but i keep getting convery from int64 to int 32
    so how i can use int64 ? or use unsinged int

    1 Reply Last reply
    0
    • Chris KawaC Offline
      Chris KawaC Offline
      Chris Kawa
      Lifetime Qt Champion
      wrote on last edited by
      #2

      You can't use int64 or unsigned int with QIntValidator. You'll need to create your own validator for that by subclassing QValidator and implementing fixup() and validate().

      1 Reply Last reply
      3

      • Login

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