I have quick and dirty solution (you can certainly optimise this):
Code:
bool FindReplace::HasFocus2()
{
return ui.cbReplace->lineEdit()->hasFocus();
}
...
Code:
void FindReplace::SetCodeViewIfNeeded()
{
bool has_focus = HasFocus();
if (has_focus) {
// give the current tab CodeView Tab the focus
ui.cbFind->lineEdit()->clearFocus();
ui.cbReplace->lineEdit()->clearFocus();
ContentTab * current_tab = m_MainWindow->GetCurrentContentTab();
if (current_tab) current_tab->setFocus();
}
bool has_focus2 = HasFocus2();
if (has_focus2) {
// give the current tab CodeView Tab the focus
ui.cbReplace->lineEdit()->clearFocus();
ContentTab * current_tab = m_MainWindow->GetCurrentContentTab();
if (current_tab) current_tab->setFocus();
}
}