The first problem is that QLineEdit (or maybe QLocale) does auto spaces.
Qt Code:
  1. flags = 1048576;
  2. QLocale convert;
  3. ui->lineEditFlags->setText(convert.toString(flags));
To copy to clipboard, switch view to plain text mode 

And the result I get is:
Qt Code:
  1. 1 048 576
To copy to clipboard, switch view to plain text mode 
... with white spaces =/

The second problem is that:
Qt Code:
  1. QValidator *validator = new QIntValidator(this);
  2. ui->lineEditFlags->setValidator(validator);
To copy to clipboard, switch view to plain text mode 

It works fine until my program sets text to something like 1 048 576 (something that has whitespace). Then I can enter any character I want =/

Any way to fix these?