A simple-to-use library used to interact with QML (Qt Meta-object Language) using the Ring programming language.
To build the extension from source, you need:
- Ring Programming Language
- Qt 5.15
- MSVC Compiler
- Good experience in C/C++ and Operating Systems.
To use the library in your projects:
- Ring Programming Language
- Good experience in general coding (Understanding scopes, functions, variables, and comments).
📱 Note: All Android applications have been tested using the Samsung Galaxy S25 Ultra.
You can install the package directly using the Ring Package Manager:
ringpm install ringqml from mohannad-aldulaimi- Download this repository.
- Load the library in your code from
lib/ringQML.ring. - Ensure the DLL is accessible. Use
loadlibto loadsrc/Build/RingQML.dll.
Here is a simple example showing how to load the library, create a Qt Application, and render a QML window with a green rectangle and text.
load 'guilib.ring' load 'ringQML.ring' new qApp { oQML = new RingQML(NULL) { loadContent(getMainQml()) } exec() } func getMainQml return " import QtQuick 2.15 import QtQuick.Controls 2.15 import QtQuick.Window 2.15 Window { visible: true width: 400 height: 400 title: 'Ring QML Loaded' Rectangle { anchors.fill: parent; id: myRedBoxRoot width: 500 height: 500 color: 'green' Text { id: myText text: 'Ring QML Is Loaded' font.pointSize: 20 } } } "
Because Ring defaults to Qt 5.15, you must download your preferred Qt 6 version yourself (e.g., Qt 6.10.2). You can then use the useQt6(path) function to point the library to your Qt 6 compiler path, and it will handle the rest:
load 'ringQML.ring' load 'ring_qt_qml.ring' // Point to your custom Qt 6 installation useQt6("C:\Qt\6.10.2\msvc2022_64") new qApp { oQML = new RingQML(NULL) { loadContent(getQt6SimpleCodeContent()) } exec() }
Detailed documentation and guides on how to use the library features are available in the DOCS folder:
- Getting Started Guide - Learn how to set up RingQML and load your first QML interface.
- RingQML Class Reference - A complete reference to every method available in the library such as
setWinIcon,shareImage, andNewComponent. - Interactivity and Data - Learn how to communicate bidirectionally with QML, including using direct native calls via
oQML.root. - Components and Snapshots - Explore advanced features like instantiating ad-hoc QML elements and taking visual widget snapshots.
- DOCS: Contains detailed Markdown documentation pages.
- libraries/RingQML: Contains
*.ringfiles (Ring library). - src: Contains C/C++ and Qt project files for the extension.
- bin: Contains
RingQML.dllfile. - samples: Contains usage samples files.
- tests: Contains simple
*.ringfiles for testing. - projects: Contains applications developed using the RingQML extension.
- QMLClasses: Contains
*.cffiles for the Ring code generator that generates code independent of theguilib.ringlibrary.
This project is licensed under the MIT License.
Mohannad Alayash
- E-Mail: mohannadazazalayash@gmail.com
- Website: https://mohannad-aldulaimi.github.io
