From ef949b5424b282cf8da865ae2e82287d0714006e Mon Sep 17 00:00:00 2001 From: Walter Van Herck <w.van.herck@fz-juelich.de> Date: Thu, 7 Mar 2013 13:33:24 +0100 Subject: [PATCH] Make welcome page of GUI link to BornAgain website using Qt WebKit --- GUI/coregui/Views/WelcomeView.cpp | 40 ++++++++++++++------------- GUI/coregui/Views/WelcomeView.h | 5 ++-- GUI/coregui/coregui.pro | 2 +- GUI/coregui/mainwindow/mainwindow.cpp | 2 +- 4 files changed, 25 insertions(+), 24 deletions(-) diff --git a/GUI/coregui/Views/WelcomeView.cpp b/GUI/coregui/Views/WelcomeView.cpp index 865b9bc96ec..17be874e405 100644 --- a/GUI/coregui/Views/WelcomeView.cpp +++ b/GUI/coregui/Views/WelcomeView.cpp @@ -4,31 +4,33 @@ #include <QLabel> #include <QComboBox> #include <QVBoxLayout> +#include <QtWebKit> WelcomeView::WelcomeView(QWidget *parent) - : QWidget(parent) + : QWebView(parent) { - QGroupBox *configGroup = new QGroupBox(tr("Server configuration")); + load(QUrl("http://apps.jcns.fz-juelich.de/doku/sc/bornagain")); +// QGroupBox *configGroup = new QGroupBox(tr("Server configuration")); - QLabel *serverLabel = new QLabel(tr("Server:")); - QComboBox *serverCombo = new QComboBox; - serverCombo->addItem(tr("Qt (Australia)")); - serverCombo->addItem(tr("Qt (Germany)")); - serverCombo->addItem(tr("Qt (Norway)")); - serverCombo->addItem(tr("Qt (People's Republic of China)")); - serverCombo->addItem(tr("Qt (USA)")); +// QLabel *serverLabel = new QLabel(tr("Server:")); +// QComboBox *serverCombo = new QComboBox; +// serverCombo->addItem(tr("Qt (Australia)")); +// serverCombo->addItem(tr("Qt (Germany)")); +// serverCombo->addItem(tr("Qt (Norway)")); +// serverCombo->addItem(tr("Qt (People's Republic of China)")); +// serverCombo->addItem(tr("Qt (USA)")); - QHBoxLayout *serverLayout = new QHBoxLayout; - serverLayout->addWidget(serverLabel); - serverLayout->addWidget(serverCombo); +// QHBoxLayout *serverLayout = new QHBoxLayout; +// serverLayout->addWidget(serverLabel); +// serverLayout->addWidget(serverCombo); - QVBoxLayout *configLayout = new QVBoxLayout; - configLayout->addLayout(serverLayout); - configGroup->setLayout(configLayout); +// QVBoxLayout *configLayout = new QVBoxLayout; +// configLayout->addLayout(serverLayout); +// configGroup->setLayout(configLayout); - QVBoxLayout *mainLayout = new QVBoxLayout; - mainLayout->addWidget(configGroup); - mainLayout->addStretch(1); - setLayout(mainLayout); +// QVBoxLayout *mainLayout = new QVBoxLayout; +// mainLayout->addWidget(configGroup); +// mainLayout->addStretch(1); +// setLayout(mainLayout); } diff --git a/GUI/coregui/Views/WelcomeView.h b/GUI/coregui/Views/WelcomeView.h index aef62217ed1..f0d4e900e86 100644 --- a/GUI/coregui/Views/WelcomeView.h +++ b/GUI/coregui/Views/WelcomeView.h @@ -1,13 +1,12 @@ #ifndef WELCOMEMANAGER_H #define WELCOMEMANAGER_H -#include <QWidget> +#include <QWebView> -class WelcomeView : public QWidget +class WelcomeView : public QWebView { public: WelcomeView(QWidget *parent = 0); - }; #endif // WELCOMEMANAGER_H diff --git a/GUI/coregui/coregui.pro b/GUI/coregui/coregui.pro index c1931ac89af..81b106abf4a 100644 --- a/GUI/coregui/coregui.pro +++ b/GUI/coregui/coregui.pro @@ -4,7 +4,7 @@ # #------------------------------------------------- -QT += core gui designer designercomponents +QT += core gui webkit designer designercomponents greaterThan(QT_MAJOR_VERSION, 4): QT += widgets diff --git a/GUI/coregui/mainwindow/mainwindow.cpp b/GUI/coregui/mainwindow/mainwindow.cpp index 3021b7ee198..85c0ebba2aa 100644 --- a/GUI/coregui/mainwindow/mainwindow.cpp +++ b/GUI/coregui/mainwindow/mainwindow.cpp @@ -98,7 +98,7 @@ Instrument *MainWindow::createDefaultInstrument() Instrument *p_result = new Instrument; p_result->setBeamParameters(0.1*Units::nanometer, 0.4*Units::degree, 0.0); p_result->setBeamIntensity(1e7); - p_result->setDetectorParameters(100, 0.0, 6.0*Units::degree, + p_result->setDetectorParameters(100, 0.0, 3.0*Units::degree, 100, 0.0, 3.0*Units::degree); return p_result; } -- GitLab