Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

line edit only numbers with int64



  • 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


  • Moderators

    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().


Log in to reply