Comment 1 for bug 1555548

Revision history for this message
Tim Peeters (tpeeters) wrote : Re: Dialog has no attached theme property

Workaround:

import QtQuick 2.4
import Ubuntu.Components 1.3
import Ubuntu.Components.Popups 1.3
MainView {
    width: units.gu(40)
    height: units.gu(71)

    applicationName: "subthemed"

    // make sure the main theme is Ambiance
    theme.name: "Ubuntu.Components.Themes.Ambiance"

    Component {
        id: dialogComponent
        Dialog {
            id: dialog
            title: "Input dialog"
            // the dialog and its children will use SuruDark
            ThemeSettings {
  id: tset
                name: "Ubuntu.Components.Themes.SuruDark"
            }
            TextField {
                placeholderText: "enter text"
            }
            Button {
                text: "Close"
                onClicked: PopupUtils.close(dialog)
            }
     Component.onCompleted: {
  __foreground.theme = tset;
     }
        }
    }

    Button {
        text: "Open dialog"
        onClicked: PopupUtils.open(dialogComponent)
    }
}