
Originally Posted by
nish
no. focus methods are only for widgets which are currently visible. You are doing it in the right way.
Thanks Nish, but what about this 2 methods:
previousInFocusChain (), nextInFocusChain ()
previousInFocusChain (), nextInFocusChain ()
To copy to clipboard, switch view to plain text mode
This 2 methods return Widget*. When I use them like this:
ui->stackedWidget->setCurrentWidget(ui->stackedWidget->previousInFocusChain());
ui->stackedWidget->setCurrentWidget(ui->stackedWidget->previousInFocusChain());
To copy to clipboard, switch view to plain text mode
But I get the following Application Output:
QStackedWidget::setCurrentWidget: widget 0x3eb2d8 not contained in stack

My main purpose is that I need a more general way of achieving this type of operations, instead of hard-coating the WidgetNames. Please help.
Bookmarks