summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-06-19 17:28:01 +0200
committerJocelyn Turcotte <jocelyn.turcotte@digia.com>2013-06-19 17:30:31 +0200
commit918b071488d51014ef68f23f5f9acfd9b7ddfc17 (patch)
tree484cebda101db2673c70d5cd4f2c0ef47dc01008
parent057b7fd01d503127eb4b65331943aad4c9f70e5e (diff)
Use QStackedLayout instead of QVBoxLayout.
When navigating a page, a new RenderWidgetHostViewQtDelegate will be added to our layout to swap the current one out. This leads QVBoxLayout to momentarily split-layout both views in the container, causing a resize of the views and triggering an unneeded BackingStore creation and re-paint.
-rw-r--r--lib/qwebcontentsview.cpp7
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/qwebcontentsview.cpp b/lib/qwebcontentsview.cpp
index 27abffe1f..0d637ae7c 100644
--- a/lib/qwebcontentsview.cpp
+++ b/lib/qwebcontentsview.cpp
@@ -51,7 +51,7 @@
#include "web_contents_view_qt.h"
#include "web_engine_context.h"
-#include <QVBoxLayout>
+#include <QStackedLayout>
#include <QUrl>
@@ -61,9 +61,8 @@ QWebContentsView::QWebContentsView()
d_ptr->q_ptr = this;
Q_D(QWebContentsView);
- QVBoxLayout *layout = new QVBoxLayout;
- layout->setContentsMargins(0, 0, 0, 0);
- setLayout(layout);
+ // This causes the child RenderWidgetHostViewQtDelegateWidgets to fill this widget.
+ setLayout(new QStackedLayout);
WebContentsDelegateQt* delegate = d->webContentsDelegate.get();
connect(delegate, SIGNAL(titleChanged(const QString&)), this, SIGNAL(titleChanged(const QString&)));