> On Mon, Jul 20, 2009 at 7:29 PM, Yuen Hoe Lim <yuenho...@gmail.com> wrote: > >> Yep, it doesn't seem to accept regular expressions - but a string >> containing every permitted character.. >> >> >> http://api.kde.org/4.x-api/kdelibs-apidocs/kdeui/html/classKRestrictedLine.html#f30d883fc60f67be39e8ffa039842cd6 >> >> I've tried, and it actually does allow me to type every character in >> the expression (like '[' and '$') =/ It doesn't seem like a pretty >> thing to do 'qwertyQWERTY012345etcetc' so maybe we could try a regular >> KLineEdit and do some form of validation? > > > For that we've to find out what characters make a valid project name (if > there is a restriction as such, say, on name of a Plasmoid). > Help wanted from others. Guys? >
Sorry but yesterday morning I was @ university, and in the evening I compiled KDE 4.4 =P By the way today I had a look to the code, fixed ( seems it works fine, however tell me if something is wrong ) and committed. The key point ( imo ) is that by typing: QRegExpValidator *pluginname_validator = new QRegExpValidator(ui->projectName); you are simply telling to pluginname_validator "Hey, your parent is a QObject reference called projectName"; but also a QWidget could be a valid parent, or a QString. It doesn't know how to parse a regular expression with a given QObject reference, that's up to us. However, I removed all QRegExp* statement from setupWidgets(), and connected signals from projectName to a slot I created to parse the text and find unwanted characters. Let me know if it works ! P.S.: after upgrading to KDE4.4, PlasMate menu has changed: now it shows entries like "Game", "Edit", "Move", "View", "Go", and "Bookmarks", "Tools" O.o The same problem appears with KTorrent.
_______________________________________________ Plasma-devel mailing list Plasma-devel@kde.org https://mail.kde.org/mailman/listinfo/plasma-devel