Browse Source

Add stretch attribute to web view

Neal Wilson 6 years ago
parent
commit
a62e3c2d3f
1 changed files with 6 additions and 1 deletions
  1. 6
    1
      src/webview.w

+ 6
- 1
src/webview.w View File

191
                         QStack<QLayout *> *layoutStack)
191
                         QStack<QLayout *> *layoutStack)
192
 {
192
 {
193
 	TypicaWebView *view = new TypicaWebView;
193
 	TypicaWebView *view = new TypicaWebView;
194
+	int stretch = 0;
194
 	if(element.hasAttribute("id"))
195
 	if(element.hasAttribute("id"))
195
 	{
196
 	{
196
 		view->setObjectName(element.attribute("id"));
197
 		view->setObjectName(element.attribute("id"));
197
 	}
198
 	}
199
+	if(element.hasAttribute("stretch"))
200
+	{
201
+        stretch = element.attribute("stretch").toInt();
202
+	}
198
 	QBoxLayout *layout = qobject_cast<QBoxLayout *>(layoutStack->top());
203
 	QBoxLayout *layout = qobject_cast<QBoxLayout *>(layoutStack->top());
199
-	layout->addWidget(view);
204
+	layout->addWidget(view, stretch);
200
 }
205
 }
201
 
206
 
202
 @ Prototypes must be provided for these functions.
207
 @ Prototypes must be provided for these functions.

Loading…
Cancel
Save