Skip to content
Snippets Groups Projects
Commit c951ccbd authored by Van Herck, Walter's avatar Van Herck, Walter
Browse files

Links in GUI Welcome screen are now handled by external browser

parent ef949b54
No related branches found
No related tags found
No related merge requests found
...@@ -5,11 +5,14 @@ ...@@ -5,11 +5,14 @@
#include <QComboBox> #include <QComboBox>
#include <QVBoxLayout> #include <QVBoxLayout>
#include <QtWebKit> #include <QtWebKit>
#include <QDesktopServices>
WelcomeView::WelcomeView(QWidget *parent) WelcomeView::WelcomeView(QWidget *parent)
: QWebView(parent) : QWebView(parent)
{ {
load(QUrl("http://apps.jcns.fz-juelich.de/doku/sc/bornagain")); load(QUrl("http://apps.jcns.fz-juelich.de/doku/sc/bornagain"));
connect(this, SIGNAL(linkClicked(const QUrl &)), this, SLOT(onWebLinkClicked(const QUrl &)));
page()->setLinkDelegationPolicy( QWebPage::DelegateAllLinks );
// QGroupBox *configGroup = new QGroupBox(tr("Server configuration")); // QGroupBox *configGroup = new QGroupBox(tr("Server configuration"));
// QLabel *serverLabel = new QLabel(tr("Server:")); // QLabel *serverLabel = new QLabel(tr("Server:"));
...@@ -34,3 +37,7 @@ WelcomeView::WelcomeView(QWidget *parent) ...@@ -34,3 +37,7 @@ WelcomeView::WelcomeView(QWidget *parent)
// setLayout(mainLayout); // setLayout(mainLayout);
} }
void WelcomeView::onWebLinkClicked(const QUrl &url)
{
QDesktopServices::openUrl(url);
}
#ifndef WELCOMEMANAGER_H #ifndef WELCOMEVIEW_H
#define WELCOMEMANAGER_H #define WELCOMEVIEW_H
#include <QWebView> #include <QWebView>
class WelcomeView : public QWebView class WelcomeView : public QWebView
{ {
Q_OBJECT
public: public:
WelcomeView(QWidget *parent = 0); WelcomeView(QWidget *parent = 0);
public slots:
void onWebLinkClicked(const QUrl &url);
}; };
#endif // WELCOMEMANAGER_H #endif // WELCOMEVIEW_H
...@@ -4,7 +4,7 @@ ...@@ -4,7 +4,7 @@
# #
#------------------------------------------------- #-------------------------------------------------
QT += core gui webkit designer designercomponents QT += core gui webkit designer designercomponents
greaterThan(QT_MAJOR_VERSION, 4): QT += widgets greaterThan(QT_MAJOR_VERSION, 4): QT += widgets
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment