summaryrefslogtreecommitdiffstats
path: root/examples
diff options
context:
space:
mode:
authorSzabolcs David <davidsz@inf.u-szeged.hu>2018-03-29 15:27:06 +0200
committerSzabolcs David <davidsz@inf.u-szeged.hu>2018-05-09 09:22:22 +0000
commitf8898170a77593e314d3cd187f259223e9bff0f8 (patch)
tree4a3a4eccd7699394702df07b7661b749b6e61ebb /examples
parent9b03a98ffb807f49d1e79fffad141a3634474d8a (diff)
Remove hardcoded size from QWebEngineView::sizeHint()
800x600 takes more space than expected when building a layout which contains QWebEngineView. Now this function does exactly the same as QWidget::sizeHint(). Add an auto test and update examples which were depending on this hardcoded size. Change-Id: I3b34b7d37cc99a8d6a49100d6c4b66b5b6a1c999 Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
Diffstat (limited to 'examples')
-rw-r--r--examples/webenginewidgets/contentmanipulation/main.cpp1
-rw-r--r--examples/webenginewidgets/cookiebrowser/main.cpp1
-rw-r--r--examples/webenginewidgets/maps/main.cpp1
-rw-r--r--examples/webenginewidgets/stylesheetbrowser/mainwindow.ui56
-rw-r--r--examples/webenginewidgets/videoplayer/main.cpp1
5 files changed, 54 insertions, 6 deletions
diff --git a/examples/webenginewidgets/contentmanipulation/main.cpp b/examples/webenginewidgets/contentmanipulation/main.cpp
index 5645f9b9..e816079d 100644
--- a/examples/webenginewidgets/contentmanipulation/main.cpp
+++ b/examples/webenginewidgets/contentmanipulation/main.cpp
@@ -63,6 +63,7 @@ int main(int argc, char * argv[])
else
url = QUrl("http://www.google.com/ncr");
MainWindow *browser = new MainWindow(url);
+ browser->resize(1024, 768);
browser->show();
return app.exec();
}
diff --git a/examples/webenginewidgets/cookiebrowser/main.cpp b/examples/webenginewidgets/cookiebrowser/main.cpp
index ae208c82..0ae5433b 100644
--- a/examples/webenginewidgets/cookiebrowser/main.cpp
+++ b/examples/webenginewidgets/cookiebrowser/main.cpp
@@ -57,6 +57,7 @@ int main(int argc, char *argv[])
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
QApplication app(argc, argv);
MainWindow window(QUrl("http://qt.io"));
+ window.resize(1024, 768);
window.show();
return app.exec();
}
diff --git a/examples/webenginewidgets/maps/main.cpp b/examples/webenginewidgets/maps/main.cpp
index f6251827..cad9c7ea 100644
--- a/examples/webenginewidgets/maps/main.cpp
+++ b/examples/webenginewidgets/maps/main.cpp
@@ -57,6 +57,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow mainWindow;
+ mainWindow.resize(1024, 768);
mainWindow.show();
return app.exec();
diff --git a/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui b/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui
index f9c1af96..bc68c16b 100644
--- a/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui
+++ b/examples/webenginewidgets/stylesheetbrowser/mainwindow.ui
@@ -18,11 +18,47 @@
</property>
<widget class="QWidget" name="centralWidget">
<layout class="QHBoxLayout" name="horizontalLayout">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
<item>
<widget class="QWidget" name="webContentsWidget" native="true">
<layout class="QVBoxLayout" name="verticalLayout_3">
+ <property name="spacing">
+ <number>0</number>
+ </property>
+ <property name="leftMargin">
+ <number>0</number>
+ </property>
+ <property name="topMargin">
+ <number>0</number>
+ </property>
+ <property name="rightMargin">
+ <number>0</number>
+ </property>
+ <property name="bottomMargin">
+ <number>0</number>
+ </property>
<item>
<widget class="QWidget" name="urlBarWidget" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Fixed">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLineEdit" name="urlBar"/>
@@ -32,13 +68,13 @@
<property name="text">
<string/>
</property>
- <property name="shortcut">
- <string>Ctrl+R</string>
- </property>
<property name="icon">
<iconset resource="stylesheetbrowser.qrc">
<normaloff>:/view-refresh.png</normaloff>:/view-refresh.png</iconset>
</property>
+ <property name="shortcut">
+ <string>Ctrl+R</string>
+ </property>
</widget>
</item>
<item>
@@ -52,8 +88,14 @@
</widget>
</item>
<item>
- <widget class="QWebEngineView" name="webEngineView">
- <property name="url">
+ <widget class="QWebEngineView" name="webEngineView" native="true">
+ <property name="sizePolicy">
+ <sizepolicy hsizetype="Preferred" vsizetype="Preferred">
+ <horstretch>0</horstretch>
+ <verstretch>0</verstretch>
+ </sizepolicy>
+ </property>
+ <property name="url" stdset="0">
<url>
<string>about:blank</string>
</url>
@@ -84,6 +126,8 @@
<header location="global">QtWebEngineWidgets/QWebEngineView</header>
</customwidget>
</customwidgets>
- <resources/>
+ <resources>
+ <include location="stylesheetbrowser.qrc"/>
+ </resources>
<connections/>
</ui>
diff --git a/examples/webenginewidgets/videoplayer/main.cpp b/examples/webenginewidgets/videoplayer/main.cpp
index f6251827..cad9c7ea 100644
--- a/examples/webenginewidgets/videoplayer/main.cpp
+++ b/examples/webenginewidgets/videoplayer/main.cpp
@@ -57,6 +57,7 @@ int main(int argc, char *argv[])
QApplication app(argc, argv);
MainWindow mainWindow;
+ mainWindow.resize(1024, 768);
mainWindow.show();
return app.exec();