Skip to content
Permalink
Browse files

Followup canvas focus commit

  • Loading branch information
nyalldawson committed Aug 21, 2017
1 parent a6b0c44 commit a2c9710a2da6a0e4b829aba8794ff804c011dcec
Showing with 6 additions and 5 deletions.
  1. +5 −4 src/app/qgisapp.cpp
  2. +1 −1 src/app/qgisapp.h
@@ -1234,7 +1234,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
}
#endif

connect( qApp, SIGNAL( focusChanged( QWidget*, QWidget* ) ), this, SLOT( onFocusChanged( QWidget*, QWidget* ) ) );
connect( qApp, &QApplication::focusChanged, this, &QgisApp::onFocusChanged );
} // QgisApp ctor

QgisApp::QgisApp()
@@ -8792,10 +8792,11 @@ void QgisApp::userRotation()
mMapCanvas->refresh();
}

void QgisApp::onFocusChanged( QWidget* /*old*/, QWidget* now )
void QgisApp::onFocusChanged( QWidget *oldWidget, QWidget *newWidget )
{
// If nothing has focus even though the window is active, ensure map canvas receives it
if ( !now && isActiveWindow() )
Q_UNUSED( oldWidget );
// If nothing has focus even though this window is active, ensure map canvas receives it
if ( !newWidget && isActiveWindow() )
{
mapCanvas()->setFocus();
}
@@ -1510,7 +1510,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow

void updateCrsStatusBar();

void onFocusChanged( QWidget* old, QWidget* now );
void onFocusChanged( QWidget *oldWidget, QWidget *newWidget );

signals:

0 comments on commit a2c9710

Please sign in to comment.
You can’t perform that action at this time.