Pārlūkot izejas kodu

Add stretch attribute to web view

Neal Wilson 7 gadus atpakaļ
vecāks
revīzija
a62e3c2d3f
1 mainītis faili ar 6 papildinājumiem un 1 dzēšanām
  1. 6
    1
      src/webview.w

+ 6
- 1
src/webview.w Parādīt failu

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

Notiek ielāde…
Atcelt
Saglabāt