mirror of
https://github.com/thp/pyotherside.git
synced 2025-02-05 08:08:23 +08:00
Add test case for issue #46
This commit is contained in:
parent
2378495fa9
commit
cf8620502c
8
tests/test_qrc_crash/editor.py
Normal file
8
tests/test_qrc_crash/editor.py
Normal file
@ -0,0 +1,8 @@
|
||||
#!/usr/bin/env python
|
||||
# -*- coding: utf-8 -*-
|
||||
|
||||
import pyotherside
|
||||
|
||||
class Crasher:
|
||||
def __init__(self):
|
||||
pass
|
18
tests/test_qrc_crash/editor.qml
Normal file
18
tests/test_qrc_crash/editor.qml
Normal file
@ -0,0 +1,18 @@
|
||||
import QtQuick 2.1
|
||||
import QtQuick.Window 2.1
|
||||
import io.thp.pyotherside 1.5
|
||||
|
||||
Window {
|
||||
visible: true
|
||||
|
||||
Python {
|
||||
id: python
|
||||
Component.onCompleted: {
|
||||
addImportPath(Qt.resolvedUrl('.'));
|
||||
importModule('editor', function () {
|
||||
call('editor.Crasher', [], function () {
|
||||
});
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
6
tests/test_qrc_crash/editor.qrc
Normal file
6
tests/test_qrc_crash/editor.qrc
Normal file
@ -0,0 +1,6 @@
|
||||
<!DOCTYPE RCC><RCC version="1.0">
|
||||
<qresource>
|
||||
<file>editor.qml</file>
|
||||
<file>editor.py</file>
|
||||
</qresource>
|
||||
</RCC>
|
9
tests/test_qrc_crash/main.cpp
Normal file
9
tests/test_qrc_crash/main.cpp
Normal file
@ -0,0 +1,9 @@
|
||||
#include <QGuiApplication>
|
||||
#include <QQmlApplicationEngine>
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
QGuiApplication app(argc, argv);
|
||||
QQmlApplicationEngine engine(QUrl("qrc:/editor.qml"));
|
||||
return app.exec();
|
||||
}
|
8
tests/test_qrc_crash/test_qrc_crash.pro
Normal file
8
tests/test_qrc_crash/test_qrc_crash.pro
Normal file
@ -0,0 +1,8 @@
|
||||
TEMPLATE = app
|
||||
TARGET = test_qrc_crash
|
||||
INCLUDEPATH += .
|
||||
|
||||
QT += qml quick
|
||||
|
||||
SOURCES += main.cpp
|
||||
RESOURCES += editor.qrc
|
Loading…
x
Reference in New Issue
Block a user