Skip to content

Instantly share code, notes, and snippets.

@leonardus
Created October 23, 2019 03:22
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save leonardus/fa8fd89fa00199abfa6a59489fb43dac to your computer and use it in GitHub Desktop.
Save leonardus/fa8fd89fa00199abfa6a59489fb43dac to your computer and use it in GitHub Desktop.
using System;
using Qml.Net;
using Qml.Net.Runtimes;
namespace QmlNetTesting
{
public class CSharp
{
public static void TestMethod()
{
Console.WriteLine("Called C#");
}
}
class Program
{
static int Main(string[] args)
{
RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();
var app = new QGuiApplication(args);
var engine = new QQmlApplicationEngine();
Qml.Net.Qml.RegisterType<CSharp>("customtype");
engine.Load("QML/Main.qml");
return app.Exec();
}
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment