Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /*** main.qml ***/
- import QtQuick 1.0
- Rectangle {
- property variant theme: defaulttheme
- DefaultTheme {
- id: defaulttheme
- }
- DefaultTheme {
- id: crazyTheme
- fontColor: "yellow"
- backgroundColor: "red"
- }
- width: 360
- height: 360
- color: theme.backgroundColor
- Text {
- anchors.centerIn: parent
- text: "Hello World"
- color: theme.fontColor
- }
- MouseArea {
- anchors.fill: parent
- onClicked: {
- theme = crazyTheme
- }
- }
- }
- /*** DefaultTheme.qml ***/
- import QtQuick 1.0
- QtObject {
- property string backgroundColor: "steelblue"
- property string fontColor: "white"
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement