Skip to content

Commit 949abff

Browse files
author
florianlink
committed
fixed ugly problem with itemChange method
git-svn-id: http://svn.code.sf.net/p/pythonqt/code/trunk@381 ea8d5007-eb21-0410-b261-ccb3ea6e24a9
1 parent e558014 commit 949abff

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

generator/shellimplgenerator.cpp

+6
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,12 @@ void ShellImplGenerator::write(QTextStream &s, const AbstractMetaClass *meta_cla
174174
}
175175
s << " if (result) { Py_DECREF(result); } " << endl;
176176
s << " Py_DECREF(obj);" << endl;
177+
// ugly hack, we don't support QGraphicsScene* nor QGraphicsItem* QVariants in PythonQt...
178+
if (fun->name() == "itemChange" && fun->type()->isVariant()) {
179+
s << " if (change0 == QGraphicsItem::ItemParentChange || change0 == QGraphicsItem::ItemSceneChange) {\n";
180+
s << " returnValue = value1;\n";
181+
s << " } \n";
182+
}
177183
if (hasReturnValue) {
178184
s << " return returnValue;" << endl;
179185
}

generator/typesystem_webkit.xml

+7-3
Original file line numberDiff line numberDiff line change
@@ -32,9 +32,13 @@
3232
</enum-type>
3333
<enum-type name="QWebPage::ErrorDomain"/>
3434

35-
<value-type name="QWebElementCollection"/>
36-
37-
<object-type name="QGraphicsWebView"/>
35+
<value-type name="QWebElementCollection"/>
36+
37+
<object-type name="QGraphicsWebView">
38+
<extra-includes>
39+
<include file-name="QGraphicsScene" location="global"/>
40+
</extra-includes>
41+
</object-type>
3842
<object-type name="QWebView">
3943
</object-type>
4044
<object-type name="QWebFrame">

0 commit comments

Comments
 (0)