Make splash background transparent

parent 8209052e
...@@ -35,6 +35,7 @@ ...@@ -35,6 +35,7 @@
#include "mainwin.h" #include "mainwin.h"
#include <QFile> #include <QFile>
#include <QDir> #include <QDir>
#include <QPalette>
MainWin::MainWin(QFile &htmlfile) MainWin::MainWin(QFile &htmlfile)
: QWebView(0) : QWebView(0)
...@@ -43,8 +44,11 @@ MainWin::MainWin(QFile &htmlfile) ...@@ -43,8 +44,11 @@ MainWin::MainWin(QFile &htmlfile)
htmlFileName = QString::fromUtf8(htmlfile.readAll().constData()); htmlFileName = QString::fromUtf8(htmlfile.readAll().constData());
QUrl baseUrl = QUrl::fromLocalFile(QDir::current().absoluteFilePath("gui/dummy.html")); QUrl baseUrl = QUrl::fromLocalFile(QDir::current().absoluteFilePath("gui/dummy.html"));
QPalette pal = palette();
pal.setBrush(QPalette::Base, Qt::transparent);
setWindowFlags(Qt::FramelessWindowHint); setWindowFlags(Qt::FramelessWindowHint);
page()->setPalette(palette()); page()->setPalette(pal);
setAttribute(Qt::WA_TranslucentBackground, true); setAttribute(Qt::WA_TranslucentBackground, true);
setAttribute(Qt::WA_OpaquePaintEvent, false); setAttribute(Qt::WA_OpaquePaintEvent, false);
......
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