Hello Developer Community,
i’ve been working on some funny projects recently, and i have made a fully functioning Qt XML Parser which translates into a functioning graphical interface using my work in progress Library WinUI.
What is WinUI?
WinUI is a window emulator which makes a windows 10 style popup interface which can be written to with several translation layers, like the one im showcasing here named QtUtils.
What is Qt?
Qt is a cross-platform application framework which is used primarily for building desktop software with graphical user interfaces (GUIs)
It is also used by many windows in for example Roblox Studio, which uses many Qt Windows and Libraries, alltough many other applications also use it.
Disclaimer: We translate XML Style Qt Designer code to WinUI (.ui files)
Showcase
The example snippet here shows the input, and what i received using the WinUI Graphical Renderer.
Input Code (xml,lua)
local ReplicatedStorage = game:GetService("ReplicatedStorage")
local QtUtils = require(ReplicatedStorage:WaitForChild("QtUtils"))
local WinLib = require(ReplicatedStorage:WaitForChild("WinLib"))
local xmlOne = [[
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SmallNotice</class>
<widget class="QDialog" name="SmallNotice">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>420</width>
<height>180</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>420</width>
<height>180</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>420</width>
<height>180</height>
</size>
</property>
<property name="windowTitle">
<string>Quick Notice</string>
</property>
<layout class="QVBoxLayout" name="rootLayout">
<item>
<widget class="QLabel" name="noticeLabel">
<property name="text">
<string>Everything is running normally.</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="buttonRow">
<item>
<spacer name="leftSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="okButton">
<property name="text">
<string>OK</string>
</property>
</widget>
</item>
<item>
<spacer name="rightSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
]]
local xmlTwo = [[
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>ToolPanel</class>
<widget class="QDialog" name="ToolPanel">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>620</width>
<height>320</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>620</width>
<height>320</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>620</width>
<height>320</height>
</size>
</property>
<property name="windowTitle">
<string>Tool Panel</string>
</property>
<layout class="QGridLayout" name="gridLayout">
<property name="margin">
<number>8</number>
</property>
<property name="spacing">
<number>6</number>
</property>
<item row="0" column="0">
<widget class="QFrame" name="leftFrame">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<layout class="QVBoxLayout" name="leftLayout">
<item>
<widget class="QLabel" name="leftTitle">
<property name="text">
<string>Assets</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="searchBox">
<property name="placeholderText">
<string>Search...</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="refreshButton">
<property name="text">
<string>Refresh</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item row="0" column="1">
<widget class="QFrame" name="rightFrame">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<layout class="QVBoxLayout" name="rightLayout">
<item>
<widget class="QLabel" name="rightLabel">
<property name="text">
<string>Preview area</string>
</property>
<property name="alignment">
<set>Qt::AlignCenter</set>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="insertButton">
<property name="text">
<string>Insert</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
]]
local xmlThree = [[
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>SettingsDialog</class>
<widget class="QDialog" name="SettingsDialog">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>900</width>
<height>540</height>
</rect>
</property>
<property name="minimumSize">
<size>
<width>900</width>
<height>540</height>
</size>
</property>
<property name="maximumSize">
<size>
<width>900</width>
<height>540</height>
</size>
</property>
<property name="windowTitle">
<string>Settings</string>
</property>
<layout class="QVBoxLayout" name="rootLayout">
<item>
<widget class="QFrame" name="topFrame">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<layout class="QHBoxLayout" name="topLayout">
<item>
<widget class="QLabel" name="title">
<property name="text">
<string>Application Settings</string>
</property>
</widget>
</item>
<item>
<spacer name="topSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="applyButton">
<property name="text">
<string>Apply</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="mainLayout">
<item>
<widget class="QFrame" name="sidebar">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<layout class="QVBoxLayout" name="sidebarLayout">
<item>
<widget class="QPushButton" name="generalButton">
<property name="text">
<string>General</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="graphicsButton">
<property name="text">
<string>Graphics</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="audioButton">
<property name="text">
<string>Audio</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QStackedWidget" name="pages">
<widget class="QWidget" name="generalPage">
<layout class="QVBoxLayout" name="generalLayout">
<item>
<widget class="QLabel" name="generalLabel">
<property name="text">
<string>General settings page.</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="graphicsPage">
<layout class="QVBoxLayout" name="graphicsLayout">
<item>
<widget class="QLabel" name="graphicsLabel">
<property name="text">
<string>Graphics settings page.</string>
</property>
</widget>
</item>
</layout>
</widget>
<widget class="QWidget" name="audioPage">
<layout class="QVBoxLayout" name="audioLayout">
<item>
<widget class="QLabel" name="audioLabel">
<property name="text">
<string>Audio settings page.</string>
</property>
</widget>
</item>
</layout>
</widget>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QFrame" name="bottomFrame">
<property name="frameShape">
<enum>QFrame::Box</enum>
</property>
<layout class="QHBoxLayout" name="bottomLayout">
<item>
<widget class="QLabel" name="statusLabel">
<property name="text">
<string>Ready.</string>
</property>
</widget>
</item>
<item>
<spacer name="bottomSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="closeButton">
<property name="text">
<string>Close</string>
</property>
</widget>
</item>
</layout>
</widget>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>
]]
QtUtils.Render(xmlOne, WinLib)
QtUtils.Render(xmlTwo, WinLib)
QtUtils.Render(xmlThree, WinLib)
What WinUI Displays:
Disclaimer: The WinUI Engine is still very early in development. The Qt Language Layer is perfectly fine but WinUI does not offer any elements yet for example Buttons or other instances. It is only the frame and simple Instances without much modification.
What’s planned for the future:
- Accurate Windows 10 UI
- Including different operating system styles
- Open source?
I hope you like my work, you might wanna check out my other posts!
