PDA

View Full Version : how to setFocus to button, in widget from QMainWindow



Usernаme
19th May 2010, 17:56
In widget:

...
void setup()
{
button->setFocus();
}
...



in QMainWindow

...
widget->setup();
setCentralWidget(widget);
...


but focus are not on button, only if I press tab..
How can I do that focus will be on button?

Lykurg
19th May 2010, 18:50
Try
setCentralWidget(widget);
widget->setup();