Originally Posted by
boblatino
So how can I solve the problem
First determine what exactly happens. It could be you are not letting the events be processed and something doesn't know it should release (or gain) focus, i.e. you can't have a focus on a widget which is hidden, so if you do:
widget->show();
widget->setFocus(Qt::OtherFocusReason);
widget->show();
widget->setFocus(Qt::OtherFocusReason);
To copy to clipboard, switch view to plain text mode
it will probably not work but this might:
widget->show();
widget->setFocus(Qt::OtherFocusReason);
widget->show();
QCoreApplication::processEvents();
widget->setFocus(Qt::OtherFocusReason);
To copy to clipboard, switch view to plain text mode
Bookmarks