Unsolved QWebView: Specific Website isn’t displayed anymore
-
QWebView specific Website isn’t displayed anymore
Hello together,
I have created a simple Application that shoes a timetable with real-time data of a railway station.
Sins a view weeks the widget keeps being white. So I think there were some changes on the web server making it incompatible for QWebView.
Even the start page (www.vrsinfo.de) cannot be displayed anymore.Is there a possibility to get the reason, why the loading of the website fails?
Regards,
JensQString link1="http://www.vrsinfo.de/fahrplan/abfahrtsmonitor/anzeige/vrs_info/Departuremonitor/show/vrs_info-showid/YRmV28WCZkFFTpqwToLyUbb894PCkyj0.html"; this->webView0->load(QUrl(link1));
-
@nonesense These pages work fine here, please provide minimal example of C++ project that is broken for you and can be built stand-alone.
-
Hello Konstantin,
Thank you for your reply.
Hm, basic C++. I am not an expert, just using Qt Creators assistant.
Let my try:QT += core gui webkit webkitwidgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets TARGET = VrsViewWin TEMPLATE = app SOURCES += main.cpp\ mainwindow.cpp HEADERS += mainwindow.h FORMS += mainwindow.ui
main.cpp
#include "mainwindow.h" #include <QApplication> int main(int argc, char *argv[]){ QApplication a(argc, argv); MainWindow w; w.show(); return a.exec(); }
mainwindow.h
#ifndef MAINWINDOW_H #define MAINWINDOW_H #include <QMainWindow> namespace Ui { class MainWindow; } class MainWindow : public QMainWindow { Q_OBJECT public: explicit MainWindow(QWidget *parent = 0); ~MainWindow(); private: Ui::MainWindow *ui; }; #endif // MAINWINDOW_H
mainwindow.cpp
#include "mainwindow.h" #include "ui_mainwindow.h" MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow){ ui->setupUi(this); ui->webView->setUrl(QUrl("http://www.vrsinfo.de")); //ui->webView->setUrl(QUrl("http://www.google.de")); // Works fine } MainWindow::~MainWindow(){ delete ui; }
mainwindow.ui
<?xml version="1.0" encoding="UTF-8"?> <ui version="4.0"> <class>MainWindow</class> <widget class="QMainWindow" name="MainWindow"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>1024</width> <height>768</height> </rect> </property> <property name="windowTitle"> <string>MainWindow</string> </property> <widget class="QWidget" name="centralWidget"> <widget class="QWebView" name="webView"> <property name="geometry"> <rect> <x>0</x> <y>0</y> <width>1024</width> <height>768</height> </rect> </property> <property name="url"> <url> <string>about:blank</string> </url> </property> </widget> </widget> </widget> <layoutdefault spacing="6" margin="11"/> <customwidgets> <customwidget> <class>QWebView</class> <extends>QWidget</extends> <header>QtWebKitWidgets/QWebView</header> </customwidget> </customwidgets> <resources/> <connections/> </ui>