View Single Post
Berserk's Avatar
Posts: 199 | Thanked: 156 times | Joined on May 2010 @ Holland
#144
Originally Posted by D-Iivil View Post
Code:
// tell user he's bad


Originally Posted by D-Iivil View Post
Code:
QRegExp regexer("\\#[0-9a-fA-F]{6,6}");
I think you need to make it this way:
Code:
QRegExp regexer("^\\#[0-9a-fA-F]{6,6}$");
^ = from the start of the string
(.. your characters ..)
$ = until the end of the string

Also, you might consider this:
Code:
ui->line_edit_font1->setValidator(new QRegExpValidator(regexer, ui->line_edit_font1);
I think the parent is wrong, you have it on "this", which is the whole class, I think you need to put it on the QLineEdits specifically.
Edit: this way, you don't have to make "actualvalidator".
__________________
Wallpaeper - Desktop background manager (in Extras!)
Config Reader - Export all Gconf to an HTML file + compare feature (Extras-testing)
Even though these programs are available for free, I would appreciate any donations

Last edited by Berserk; 2010-09-30 at 10:47.