splashpage moved to dedicated class

parent fdb2bfb9
SOURCES = src/main.cpp
SOURCES = src/main.cpp src/splashpage.cpp src/skylivex.h
QT += network webkitwidgets widgets
OTHER_FILES += \
......
......@@ -34,39 +34,20 @@
* to load plugins and make them communicate.
*
*/
#include <QWebView>
#include <QWebFrame>
#include <QDesktopWidget>
#include <QApplication>
#include <QFile>
#include <QUrl>
#include <QDir>
#include "skylivex.h"
int main(int argc, char *argv[])
{
QApplication skylivex(argc, argv);
QWebView splashwin;
QFile loadinghtml("gui/splash.html");
loadinghtml.open(QIODevice::ReadOnly);
QString splashFile = QString::fromUtf8(loadinghtml.readAll().constData());
QUrl baseUrl = QUrl::fromLocalFile(QDir::current().absoluteFilePath("gui/dummy.html"));
splashwin.setWindowFlags(Qt::FramelessWindowHint);
QPalette palette = splashwin.palette();
palette.setBrush(QPalette::Base, Qt::transparent);
splashwin.page()->setPalette(palette);
splashwin.setAttribute(Qt::WA_TranslucentBackground, true);
splashwin.setAttribute(Qt::WA_OpaquePaintEvent, false);
//splashwin.setGeometry(0, 0, QApplication::desktop()->size().width(), QApplication::desktop()->size().height());
splashwin.setHtml(splashFile, baseUrl);
splashwin.resize(300,200);
QFile splashfile("gui/splash.html");
SplashPage splashwin(splashfile);
splashwin.show();
return skylivex.exec();
}
......
......@@ -32,3 +32,23 @@
* Purpose:
*
*/
#ifndef SKYLIVEX_H
#define SKYLIVEX_H
#include <QWebView>
#include <QUrl>
#include <QFile>
#include <QString>
class SplashPage : public QWebView
{
QUrl baseurl;
QFile splash_html;
QString splashFile;
public:
SplashPage(QFile &splash_html);
~SplashPage();
};
#endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment