This is the failure scenario.

This commit is contained in:
Paul Knopf 2018-07-18 23:23:33 -04:00
parent 6fa14724c8
commit df55652c18
2 changed files with 16 additions and 11 deletions

View file

@ -12,11 +12,19 @@ namespace Qt.NetCore.Sandbox
[Signal("testSignal", NetVariantType.String)]
public class TestQmlImport
{
public void TestMethod()
readonly AnotherType _anotherType = new AnotherType();
public AnotherType GetSharedInstance()
{
Console.WriteLine("Invoked method!");
return _anotherType;
}
}
[Signal("testSignal", NetVariantType.String)]
public class AnotherType
{
}
static int Main()
{

View file

@ -8,24 +8,21 @@ ApplicationWindow {
width: 640
height: 480
title: qsTr("Hello World")
Item {
Timer {
interval: 1000; running: true; repeat: true
onTriggered: {
test.testSignal("test")
test.TestMethod()
var o = test.GetSharedInstance()
o.testSignal.connect(function(message) {
console.log("Signal was raised: " + message)
})
var o2 = test.GetSharedInstance()
o2.testSignal("Hello")
}
}
}
TestQmlImport {
id: test
Component.onCompleted : {
testSignal.connect(function(o) {
console.log("Signal raised: " + o)
})
console.log("Connected signal")
}
}
}