I think I found out the reason. Apparently I called setbuddy before setting up the associated widget. Like this:
initiatorL->setBuddy(initiator);
QLabel *initiatorL = new QLabel("&initiator:", this);
initiatorL->setBuddy(initiator);
QLineEdit *initiator = new QLineEdit(this);
To copy to clipboard, switch view to plain text mode
Changing line 2 with 3 fixed the problem. Really should have noticed it...
But now I have a weird problem. This is the code:
initL
= new QLabel("&Initiator");
initL->setBuddy(init);
init->setValidator(new LSEdgeValidator(init));
ruleFL
= new QLabel("Production &F");
ruleFL->setBuddy(ruleF);
ruleF->setValidator(new LSEdgeValidator(ruleF));
rulefL
= new QLabel("Production &f");
rulefL->setBuddy(rulef);
rulef->setValidator(new LSEdgeValidator(rulef));
initL = new QLabel("&Initiator");
init = new QLineEdit();
initL->setBuddy(init);
init->setValidator(new LSEdgeValidator(init));
ruleFL = new QLabel("Production &F");
ruleF = new QLineEdit();
ruleFL->setBuddy(ruleF);
ruleF->setValidator(new LSEdgeValidator(ruleF));
rulefL = new QLabel("Production &f");
rulef = new QLineEdit();
rulefL->setBuddy(rulef);
rulef->setValidator(new LSEdgeValidator(rulef));
To copy to clipboard, switch view to plain text mode
And the problem is:
First: the underline won't show up unless I press the ALT key. Second: Once I do - the underline shows on every QLabel apart from initL - the first QLabel I set up in the code. If I change initL place in the code and put ruleFL first - then ruleFL won't show underlined.
I'm confused.
Bookmarks