Share color values and other read-only values across multiple QML files
问题 I'm looking for a simple way to share read-only values across multiple QML files, for instance; lets say I have a label element: Label { id: titleLabel text: listView.currentItem ? listView.currentItem.text : "IDEAL Networks" font.pixelSize: 20 elide: Label.ElideRight horizontalAlignment: Qt.AlignLeft verticalAlignment: Qt.AlignVCenter Layout.fillWidth: true color: red; padding: { left: 14 } } The color and padding values need to be used in other QML files and other areas of the same file.