parent
f3ffdf9f28
commit
b0a065afd6
|
|
@ -617,7 +617,12 @@ protected:
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// clear focus widget while showing to keep global shortcuts working
|
// clear focus widget while showing to keep global shortcuts working
|
||||||
|
#ifdef WIN32
|
||||||
else if( event->type() == QEvent::Show ) {
|
else if( event->type() == QEvent::Show ) {
|
||||||
|
#else
|
||||||
|
else if( event->type() == QEvent::WindowActivate ) { // fixme hack hack: events order varies in OSes, QEvent::Show doesn't work in Linux
|
||||||
|
// QEvent::WindowActivate seems preferable for usability, but allows QLineEdit content selection w/o focusing it in WIN32
|
||||||
|
#endif
|
||||||
QTimer::singleShot( 0, [obj](){
|
QTimer::singleShot( 0, [obj](){
|
||||||
if( static_cast<QWidget*>( obj )->focusWidget() != nullptr )
|
if( static_cast<QWidget*>( obj )->focusWidget() != nullptr )
|
||||||
static_cast<QWidget*>( obj )->focusWidget()->clearFocus();
|
static_cast<QWidget*>( obj )->focusWidget()->clearFocus();
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user