Skip to content

Commit a2c9710

Browse files
committed
Followup canvas focus commit
1 parent a6b0c44 commit a2c9710

File tree

2 files changed

+6
-5
lines changed

2 files changed

+6
-5
lines changed

src/app/qgisapp.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1234,7 +1234,7 @@ QgisApp::QgisApp( QSplashScreen *splash, bool restorePlugins, bool skipVersionCh
12341234
}
12351235
#endif
12361236

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

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

8795-
void QgisApp::onFocusChanged( QWidget* /*old*/, QWidget* now )
8795+
void QgisApp::onFocusChanged( QWidget *oldWidget, QWidget *newWidget )
87968796
{
8797-
// If nothing has focus even though the window is active, ensure map canvas receives it
8798-
if ( !now && isActiveWindow() )
8797+
Q_UNUSED( oldWidget );
8798+
// If nothing has focus even though this window is active, ensure map canvas receives it
8799+
if ( !newWidget && isActiveWindow() )
87998800
{
88008801
mapCanvas()->setFocus();
88018802
}

src/app/qgisapp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1510,7 +1510,7 @@ class APP_EXPORT QgisApp : public QMainWindow, private Ui::MainWindow
15101510

15111511
void updateCrsStatusBar();
15121512

1513-
void onFocusChanged( QWidget* old, QWidget* now );
1513+
void onFocusChanged( QWidget *oldWidget, QWidget *newWidget );
15141514

15151515
signals:
15161516

0 commit comments

Comments
 (0)