QT >= 5.8 stop ride summary stealing focus

.. its annoying!
This commit is contained in:
Mark Liversedge
2017-09-01 12:20:21 +01:00
parent 2139fb41ee
commit f70ab21104
3 changed files with 17 additions and 4 deletions

View File

@@ -144,6 +144,10 @@ LTMWindow::LTMWindow(Context *context) :
QFont defaultFont; // mainwindow sets up the defaults.. we need to apply
#ifdef NOWEBKIT
dataSummary = new QWebEngineView(this);
#if QT_VERSION >= 0x050800
// stop stealing focus!
dataSummary->settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
#endif
//XXXdataSummary->setEnabled(false); // stop grabbing focus
if (dpiXFactor > 1) {
// 80 lines per page on hidpi screens (?)

View File

@@ -37,6 +37,8 @@
#ifdef NOWEBKIT
#include <QtWebChannel>
#include <QWebEngineView>
#include <QWebEngineSettings>
#endif
// overlay helper
@@ -121,6 +123,10 @@ RideMapWindow::RideMapWindow(Context *context, int mapType) : GcChartWindow(cont
#ifdef NOWEBKIT
view = new QWebEngineView(this);
#if QT_VERSION >= 0x050800
// stop stealing focus!
view->settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
#endif
#else
view = new QWebView();
#endif

View File

@@ -91,12 +91,15 @@ RideSummaryWindow::RideSummaryWindow(Context *context, bool ridesummary) :
vlayout->setSpacing(0);
vlayout->setContentsMargins(10,10,10,10);
#ifdef NOWEBKIT
#ifdef NOWEBKIT
rideSummary = new QWebEngineView(this);
//XXX steals focus rideSummary->setEnabled(false);
#else
#if QT_VERSION >= 0x050800
// stop stealing focus!
rideSummary->settings()->setAttribute(QWebEngineSettings::FocusOnNavigationEnabled, false);
#endif
#else
rideSummary = new QWebView(this);
#endif
#endif
rideSummary->setContentsMargins(0,0,0,0);
rideSummary->page()->view()->setContentsMargins(0,0,0,0);