How to register .qml Singletone in cpp so we can directly use properties of that file using import theme 1.0
Let's get started
Create .qml file and the use
pragma Singleton// We indicate that this QML Type is a singletonimport QtQuick 2.15QtObject {readonlypropertybool isDarkMode: cSettings.isDark // this is the cpp contextProperty()readonlyproperty color footerBackground:"#0E0E0E"// isDarkMode ? "#0E0E0E" : "#FFFFFF"readonlyproperty color background: isDarkMode ?"#0E0E0E":"#F1F1F1"readonlyproperty color fontColor: isDarkMode ?"#FFFFFF":"#0E0E0E"/*Dashboard Propertes*/readonlyproperty color backgroundColor:"#17161c"readonlyproperty color footerColor:"#201f25"readonlyproperty color forgroundColor:"#201f25"readonlyproperty color buttonColor:"#2f2f39"readonlyproperty color labledBackColor:"#2c2c34"readonlyproperty color checkedIconColor:"#489eeb"readonlyproperty color unCheckedIconColor :"#777781"readonlyproperty color progressColor:"#2f2f39"readonlyproperty color tileColor :"#439df3"}