PageThumbnailer: Delay creating thumbnail by 1 sec after loaded

remotes/origin/falkon
David Rosca 11 years ago
parent db888e2b2f
commit 20c7b3f57b
  1. 9
      src/lib/tools/pagethumbnailer.cpp
  2. 2
      src/lib/tools/scripts.cpp

@ -17,7 +17,7 @@
* ============================================================ */
#include "pagethumbnailer.h"
#include <QPainter>
#include <QTimer>
#include <QApplication>
#include <QWebEngineView>
@ -91,9 +91,10 @@ void PageThumbnailer::createThumbnail(bool status)
return;
}
m_title = m_view->title().trimmed();
emit thumbnailCreated(m_view->grab().scaled(m_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
QTimer::singleShot(1000, this, [this]() {
m_title = m_view->title().trimmed();
emit thumbnailCreated(m_view->grab().scaled(m_size, Qt::IgnoreAspectRatio, Qt::SmoothTransformation));
});
}
PageThumbnailer::~PageThumbnailer()

@ -38,7 +38,7 @@ QString Scripts::setupWebChannel()
{
QString source = QL1S("(function() {"
"%1"
"var channel = new QWebChannel(qt.webChannelTransport, function(channel) {"
"new QWebChannel(qt.webChannelTransport, function(channel) {"
" window.external = channel.objects.qz_object;"
" if (window.external) {"
" var event = new Event('qz_external_created');"

Loading…
Cancel
Save