|
|
@ -73,7 +73,7 @@ UBAbstractWidget::UBAbstractWidget(const QUrl& pWidgetUrl, QWidget *parent) |
|
|
|
|
|
|
|
|
|
|
|
connect(QWebView::page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared())); |
|
|
|
connect(QWebView::page()->mainFrame(), SIGNAL(javaScriptWindowObjectCleared()), this, SLOT(javaScriptWindowObjectCleared())); |
|
|
|
connect(QWebView::page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SIGNAL(geometryChangeRequested(const QRect&))); |
|
|
|
connect(QWebView::page(), SIGNAL(geometryChangeRequested(const QRect&)), this, SIGNAL(geometryChangeRequested(const QRect&))); |
|
|
|
connect(QWebView::page(), SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool))); |
|
|
|
connect(this, SIGNAL(loadFinished(bool)), this, SLOT(mainFrameLoadFinished (bool))); |
|
|
|
|
|
|
|
|
|
|
|
setMouseTracking(true); |
|
|
|
setMouseTracking(true); |
|
|
|
} |
|
|
|
} |
|
|
@ -121,6 +121,7 @@ UBAbstractWidget::~UBAbstractWidget() |
|
|
|
|
|
|
|
|
|
|
|
void UBAbstractWidget::loadMainHtml() |
|
|
|
void UBAbstractWidget::loadMainHtml() |
|
|
|
{ |
|
|
|
{ |
|
|
|
|
|
|
|
mInitialLoadDone = false; |
|
|
|
QWebView::load(mMainHtmlUrl); |
|
|
|
QWebView::load(mMainHtmlUrl); |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
@ -400,21 +401,21 @@ void UBAbstractWidget::paintEvent(QPaintEvent * event) |
|
|
|
QPainter p(this); |
|
|
|
QPainter p(this); |
|
|
|
p.drawPixmap(0, 0, mSnapshot); |
|
|
|
p.drawPixmap(0, 0, mSnapshot); |
|
|
|
} |
|
|
|
} |
|
|
|
else if(mIsTakingSnapshot || (mInitialLoadDone && !mLoadIsErronous)) |
|
|
|
else |
|
|
|
{ |
|
|
|
{ |
|
|
|
QWebView::paintEvent(event); |
|
|
|
QWebView::paintEvent(event); |
|
|
|
} |
|
|
|
} |
|
|
|
else |
|
|
|
if (!mInitialLoadDone || mLoadIsErronous) |
|
|
|
{ |
|
|
|
{ |
|
|
|
QPainter p(this); |
|
|
|
QPainter p(this); |
|
|
|
QString message = tr("Loading ..."); |
|
|
|
QString message = tr("Loading ..."); |
|
|
|
|
|
|
|
|
|
|
|
// this is the right way of doing but we receive two callback and the one return always that the
|
|
|
|
// this is the right way of doing but we receive two callback and the one return always that the
|
|
|
|
// load as failed... to check
|
|
|
|
// load as failed... to check
|
|
|
|
// if (mLoadIsErronous)
|
|
|
|
if (mInitialLoadDone && mLoadIsErronous) |
|
|
|
// message = tr("Cannot load content");
|
|
|
|
message = tr("Cannot load content"); |
|
|
|
// else
|
|
|
|
else |
|
|
|
// message = tr("Loading ...");
|
|
|
|
message = tr("Loading ..."); |
|
|
|
|
|
|
|
|
|
|
|
p.setFont(QFont("Arial", 12)); |
|
|
|
p.setFont(QFont("Arial", 12)); |
|
|
|
|
|
|
|
|
|
|
|