aboutsummaryrefslogtreecommitdiffstats
path: root/tests/QtDeclarative/bug_1029.py
blob: 3cc343f58955fa931a47c72df3ffe3e3a66d9436 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
from PySide.QtCore import *
from PySide.QtGui import *
from PySide.QtDeclarative import *

import sys
import gc

def register_qml_types():
    class TestClass(QDeclarativeItem):
        def __init__(self, parent = None):
            QDeclarativeItem.__init__(self, parent)

    qmlRegisterType(TestClass, "UserTypes", 1, 0, "TestClass")

def main():
    app = QApplication([])

    # reg qml types here
    register_qml_types()

    # force gc to run
    gc.collect()

    view = QDeclarativeView()
    url = QUrl(__file__.replace(".py", ".qml"))
    view.setSource(url)

if __name__ == "__main__":
    main()