Changeset 8909 in ntrip


Ignore:
Timestamp:
Mar 22, 2020, 1:28:42 PM (3 months ago)
Author:
stuerze
Message:

try to reanimate map view using QWebEngineWidgets only

Location:
trunk/BNC/src
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/BNC/src/bncmain.cpp

    r8900 r8909  
    4444#include <QFile>
    4545#include <iostream>
     46#include <QNetworkProxy>
    4647
    4748#include "app.h"
     
    376377  }
    377378  else { // start non-gui Version
    378 
     379    //
    379380  }
    380381
     
    382383
    383384  bncSettings settings;
     385
     386  // Proxy Settings
     387  // --------------
     388  QString proxyHost = settings.value("proxyHost").toString();
     389  int     proxyPort = settings.value("proxyPort").toInt();
     390  if (!proxyHost.isEmpty()) {
     391    QNetworkProxy proxy;
     392    proxy.setType(QNetworkProxy::HttpProxy);
     393    proxy.setHostName(proxyHost);
     394    proxy.setPort(proxyPort);
     395    QNetworkProxy::setApplicationProxy(proxy);
     396  }
    384397
    385398  for (int ii = 1; ii < argc - 2; ii++) {
     
    410423
    411424    // Interactive Mode - open the main window
    412   // ---------------------------------------
     425  // -----------------------------------------
    413426  if (interactive) {
    414427
  • trunk/BNC/src/map/bncmapwin.cpp

    r8260 r8909  
    3535 * Created:    08-Jun-2013
    3636 *
    37  * Changes:
     37 * Changes:    A. Stuerze
    3838 *
    3939 * -----------------------------------------------------------------------*/
     
    5656  _currLon =  8.66496871; // BKG longitude
    5757
    58 #ifdef QT_WEBENGINE
    5958  _webView = new QWebEngineView(this);
    60 #else
    61   _webView = new QWebView(this);
    62 #endif
    6359
    6460  connect(_webView, SIGNAL(loadFinished(bool)), this, SLOT(slotInitMap(bool)));
     
    6864  bncSettings settings;
    6965  _staID = settings.value("PPP/plotCoordinates").toByteArray();
    70 
    71   // Proxy Settings
    72   // --------------
    73   QString proxyHost = settings.value("proxyHost").toString();
    74   int     proxyPort = settings.value("proxyPort").toInt();
    75   if (!proxyHost.isEmpty()) {
    76     QNetworkProxy proxy(QNetworkProxy::HttpProxy, proxyHost, proxyPort);
    77     _webView->page()->networkAccessManager()->setProxy(proxy);
    78   }
    7966
    8067  loadHtmlPage();
     
    141128  }
    142129  QString location = QString("%1, %2, %3, %4").arg(_currLat,0,'f',8).arg(_currLon,0,'f',8).arg(mapWinDotSize).arg(mapWinDotColor);
    143   _webView->page()->mainFrame()->evaluateJavaScript(QString("initialize( %1 )").arg(location));
     130  _webView->page()->runJavaScript(QString("gotoLocation( %1 )").arg(location));
    144131}
    145132
     
    168155
    169156  QString location = QString("%1, %2").arg(_currLat,0,'f',8).arg(_currLon,0,'f',8);
    170   _webView->page()->mainFrame()->evaluateJavaScript(QString("gotoLocation( %1 )").arg(location));
     157  _webView->page()->runJavaScript(QString("gotoLocation( %1 )").arg(location));
    171158}
    172159
  • trunk/BNC/src/map/bncmapwin.h

    r8264 r8909  
    2525#ifndef BNCMAPWIN_H
    2626#define BNCMAPWIN_H
    27 
    28 #ifdef QT_WEBENGINE
    29   #include <QWebEngineView>
    30   #include <QWebEnginePage>
    31 #else
    32   #include <QWebView>
    33   #include <QWebFrame>
    34 #endif
     27#include <QWebEngineView>
     28#include <QWebEnginePage>
    3529#include <QLabel>
    3630#include <QHBoxLayout>
    3731#include <QByteArray>
    3832#include <QDialog>
    39 #include <QNetworkProxy>
    4033#include <QVector>
    4134#include "bnctime.h"
     
    6356  void loadHtmlPage();
    6457  void gotoLocation(double lat, double lon);
    65 #ifdef QT_WEBENGINE
    6658  QWebEngineView*  _webView;
    67 #else
    68   QWebView*        _webView;
    69 #endif
    70   QLabel*    _statusLabel;
    71   double     _currLat;
    72   double     _currLon;
    73   QByteArray _staID;
     59  QWebEnginePage*  _webPage;
     60  QLabel*          _statusLabel;
     61  double           _currLat;
     62  double           _currLon;
     63  QByteArray       _staID;
    7464};
    7565
  • trunk/BNC/src/src.pri

    r8905 r8909  
    134134}
    135135
    136 # Check QtWebKit Library Existence
    137 # --------------------------------
    138 exists("$$[QT_INSTALL_LIBS]/*WebKit*") {
    139     DEFINES += QT_WEBKIT
    140     QT      += webkit webkitwidgets
    141     message("Configured with QtWebKit")
    142 }
    143 
     136# Check QtWebEngineWidges Library Existence
     137# -----------------------------------------
    144138exists("$$[QT_INSTALL_LIBS]/*WebEngineWidgets*") {
    145139    DEFINES += QT_WEBENGINE
     
    148142}
    149143
    150 contains(DEFINES, QT_WEBENGINE) | contains(DEFINES, QT_WEBKIT) {
     144contains(DEFINES, QT_WEBENGINE) {
    151145  HEADERS     += map/bncmapwin.h
    152146  SOURCES     += map/bncmapwin.cpp
     
    154148}
    155149else {
    156   message("Neither QtWebEngine nor QtWebKit is available")
     150  message("QtWebEngineWidges Library is not available")
    157151}
Note: See TracChangeset for help on using the changeset viewer.