![]() Registered Member ![]()
|
Hello,
I have a really annoying problem and I can't figure out how to get around it. On my settings dialog, I have a QLineEdit, which is used to add items to a list. Naturally, when you type in an item, you press Enter. However, when enter is pressed, instead of just triggering a signal to add the item, it closes the whole dialog. Is there a way to prevent it from closing by itself? I've tried doing "parent->setDefaultButton(KDialog::None)" and KDialog::NoDefault in createConfigurationInterfce(), but it does not help ![]() I've also found no way to make the line edit to swallow the key-press. Thanks in advance! ![]() Edit: Found it: You can either use KLineEdit with setTrapReturnKey(), or override keyPressEvent().
Get problems solved faster - get reply notifications through Jabber!
|
Registered users: bartoloni, Bing [Bot], Evergrowing, Google [Bot]