Qml.Net alternatives and similar packages
Based on the "GUI" category.
Alternatively, view Qml.Net alternatives based on common mentions on social networks and blogs.
-
Avalonia
Develop Desktop, Embedded, Mobile and WebAssembly apps with C# and XAML. The most popular .NET Foundation community project. -
MaterialDesignInXamlToolkit
Google's Material Design in XAML & WPF, for C# & VB.Net. -
MahApps.Metro
A framework that allows developers to cobble together a better UI for their own WPF applications with minimal effort. -
UWP Community Toolkit
The Windows Community Toolkit is a collection of helpers, extensions, and custom controls. It simplifies and demonstrates common developer tasks building .NET apps with UWP and the Windows App SDK / WinUI 3 for Windows 10 and Windows 11. The toolkit is part of the .NET Foundation. -
Windows UI Library
Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications -
MaterialSkin
Theming .NET WinForms, C# or VB.Net, to Google's Material Design Principles. -
Eto.Forms
Cross platform GUI framework for desktop and mobile applications in .NET -
DockPanelSuite
DockPanel Suite - The Visual Studio inspired docking library for .NET WinForms -
metroframework-modern-ui
My humble attempt to bring the new Modern UI alias Metro UI of Windows 8 to .NET Windows Forms applications. -
AvalonEdit
The WPF-based text editor component used in SharpDevelop -
FastColoredTextBox
Fast Colored TextBox for Syntax Highlighting. The text editor component for .NET. -
Ooui
A small cross-platform UI library that brings the simplicity of native UI development to the web -
XWT
A cross-platform UI toolkit for creating desktop applications with .NET and Mono -
AdonisUI
Lightweight UI toolkit for WPF applications offering classic but enhanced windows visuals -
Neutronium
🚀 Build .NET desktop applications using HTML, CSS and javascript. -
ScintillaNET
A Windows Forms control, wrapper, and bindings for the Scintilla text editor. -
Ookii.Dialogs.Wpf
Awesome dialogs for Windows Desktop applications built with Microsoft .NET (WPF) -
WinApi
A simple, direct, ultra-thin CLR library for high-performance Win32 Native Interop -
Gtk#
Gtk# is a Mono/.NET binding to the cross platform Gtk+ GUI toolkit and the foundation of most GUI apps built with Mono -
Callisto
A control toolkit for Windows 8 XAML applications. Contains some UI controls to make it easier to create Windows UI style apps for the Windows Store in accordance with Windows UI guidelines. -
Ookii.Dialogs.WinForms
Awesome dialogs for Windows Desktop applications built with Microsoft .NET (WinForms) -
SciterSharp
Create .NET cross-platform desktop apps using not just HTML, but all features of Sciter engine: CSS3, SVG, scripting, AJAX, <video>... Sciter is free for commercial use -
Lara
Lara Web Engine is a lightweight C# framework for web user interface development. -
ObjectListView
git clone of https://objectlistview.svn.sourceforge.net/svnroot/objectlistview/cs/trunk -
Bunifu UI Framework
Social App dark UI built with Bunifu UI Framework Ultimate Bundle
Tired of breaking your main and manually rebasing outdated pull requests?
* Code Quality Rankings and insights are calculated and provided by Lumnify.
They vary from L1 to L5 with "L5" being the highest.
Do you think we are missing an alternative of Qml.Net or a related project?
README
A Qt/Qml integration with .NET
Supported platforms/runtimes:
- Runtimes:
- .NET Framework
- .NET Core
- Mono
- Operating systems
- Linux
- OSX
- Windows
First look
Elevator pitch
- Proven in production.
- Established GUI/control framework, used in many industries, from desktop to embedded.
- Excellent community with many open-sourced controls available.
- Native rendering, done in native code. No expensive PInvoke calls for rendering/animations/etc. The only interop between .NET and Qt is the data models used to drive the GUI.
Documentation
WIP: https://qmlnet.github.io/
Getting started
dotnet add package Qml.Net
dotnet add package Qml.Net.WindowsBinaries
dotnet add package Qml.Net.OSXBinaries
dotnet add package Qml.Net.LinuxBinaries
Note for Linux users: Package libc6-dev
is required to be installed because it contains libdl.so
that is needed.
Examples
Checkout the examples on how to do many things with Qml.Net.
Quick overview
Define a .NET type (POCO)
//QmlType.cs
using Qml.Net;
using System.Threading.Tasks;
namespace QmlQuickOverview
{
[Signal("customSignal", NetVariantType.String)] // You can define signals that Qml can listen to.
public class QmlType
{
/// <summary>
/// Properties are exposed to Qml.
/// </summary>
[NotifySignal("stringPropertyChanged")] // For Qml binding/MVVM.
public string StringProperty { get; set; }
/// <summary>
/// Methods can return .NET types.
/// The returned type can be invoked from Qml (properties/methods/events/etc).
/// </summary>
/// <returns></returns>
public QmlType CreateNetObject()
{
return new QmlType();
}
/// <summary>
/// Qml can pass .NET types to .NET methods.
/// </summary>
/// <param name="parameter"></param>
public void TestMethod(QmlType parameter)
{
}
/// <summary>
/// Async methods can be invoked with continuations happening on Qt's main thread.
/// </summary>
public async Task<string> TestAsync()
{
// On the UI thread
await Task.Run(() =>
{
// On the background thread
});
// On the UI thread
return "async result!";
}
/// <summary>
/// Qml can also pass Qml/C++ objects that can be invoked from .NET
/// </summary>
/// <param name="qObject"></param>
public void TestMethodWithQObject(dynamic o)
{
string result = o.propertyDefinedInCpp;
o.methodDefinedInCpp(result);
// You can also listen to signals on QObjects.
var qObject = o as INetQObject;
var handler = qObject.AttachSignal("signalName", parameters => {
// parameters is a list of arguements passed to the signal.
});
handler.Dispose(); // When you are done listening to signal.
// You can also listen to when a property changes (notify signal).
handler = qObject.AttachNotifySignal("property", parameters => {
// parameters is a list of arguements passed to the signal.
});
handler.Dispose(); // When you are done listening to signal.
}
/// <summary>
/// .NET can activate signals to send notifications to Qml.
/// </summary>
public void ActivateCustomSignal(string message)
{
this.ActivateSignal("customSignal", message);
}
}
}
Register your new type with Qml.
//QmlExample.cs
using Qml.Net;
using Qml.Net.Runtimes;
namespace QmlQuickOverview
{
class QmlExample
{
static int Main(string[] args)
{
RuntimeManager.DiscoverOrDownloadSuitableQtRuntime();
using (var app = new QGuiApplication(args))
{
using (var engine = new QQmlApplicationEngine())
{
// Register our new type to be used in Qml
Qml.Net.Qml.RegisterType<QmlType>("test", 1, 1);
engine.Load("Main.qml");
return app.Exec();
}
}
}
}
}
Use the .NET type in Qml
//Main.qml
import QtQuick 2.7
import QtQuick.Controls 2.0
import QtQuick.Layouts 1.0
import test 1.1
ApplicationWindow {
visible: true
width: 640
height: 480
title: qsTr("Hello World")
QmlType {
id: test
Component.onCompleted: function() {
// We can read/set properties
console.log(test.stringProperty)
test.stringPropertyChanged.connect(function() {
console.log("The property was changed!")
})
test.stringProperty = "New value!"
// We can return .NET types (even ones not registered with Qml)
var netObject = test.createNetObject();
// All properties/methods/signals can be invoked on "netObject"
// We can also pass the .NET object back to .NET
netObject.testMethod(netObject)
// We can invoke async tasks that have continuation on the UI thread
var task = netObject.testAsync()
// And we can await the task
Net.await(task, function(result) {
// With the result!
console.log(result)
})
// We can trigger signals from .NET
test.customSignal.connect(function(message) {
console.log("message: " + message)
})
test.activateCustomSignal("test message!")
}
function testHandler(message) {
console.log("Message - " + message)
}
}
}
Currently implemented
- [x] Support for all the basic Qml types and the back-and-forth between them (
DateTime
,string
, etc). - [x] Reading/setting properties on .NET objects.
- [x] Invoking methods on .NET obejcts.
- [x] Declaring and activating signals on .NET objects.
- [x]
async
andawait
with support for awaiting and getting the result from Qml. - [x] Passing dynamic javascript objects to .NET as
dynamic
. - [x] Custom V8 type that looks like an array, but wraps a .NET
IList<T>
instance, for modification of list in Qml, and performance. - [x] Dynamically compiled delegates for increased performance.
- [x] Passing
QObject
types to .NET with support for interacting with signals/slots/properties on them.
There aren't really any important features missing that are needed for prime-time. This product is currently used on embedded devices in the medical industry.
Running Unit Tests
The unit tests can be found in [src/native/Qml.Net.Tests](src/net/Qml.Net.Tests).
They can be run directly from Visual Studio, or by using the dotnet test
command line tool.
Since the tests rely on the native QmlNet library, you have to ensure the library is in the PATH
(on Windows) or otherwise discoverable. If you are trying to run tests against the native library built from the same repository, you can put the src/native/output
folder into your PATH
or LD_LIBRARY_PATH
after running the build.bat
or build.sh
script.
Contributors ✨
Thanks goes to these wonderful people!
<!-- ALL-CONTRIBUTORS-LIST:START - Do not remove or modify this section --> <!-- prettier-ignore --> Michael Lamers💻 TripleWhy💻 Max💻 📖 💵 geigertom💻 James Davila💻 Andy Fillebrown💻 Vadim Peretokin📖 Linus Juhlin📖
<!-- ALL-CONTRIBUTORS-LIST:END -->