Ask Ubuntu is a question and answer site for Ubuntu users and developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

My app uses tabs, and one of them shows a web page using WebView. Now, I have a toolbar with one action button that I want to show a Dialog - but it's no go.

Instead I get this error message when pressing the action button:

file:///usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/Components/Popups/popupUtils.js:50: Error: Cannot assign QObject* to QQuickItem*

Showing in a tab whitout a WebView works fint with the same Component and Dialog. Why does it not work, and what should I do to make it possible? I'd really want this dialog there.

Here's part of my code:

            // Change coordinates dialog
            Component {
                 id: dialog
                 Dialog {
                     id: dialogue
                     title: "Save file"
                     text: "Are you sure that you want to save this file?"
                     // X
                     TextField {
                         id: xCoo
                         placeholderText: 'X'
                         text: xCurrent

                     // Y
                     TextField {
                         id: yCoo
                         placeholderText: 'Y'
                         text: yCurrent

                     Button {
                         id: 'goButton'
                         text: 'Go'
                         color: 'green'
                         onClicked: {
                             xCurrent = xCoo.text
                             yCurrent = yCoo.text

            WebView {
                    id: mapContent
                    anchors.fill: parent
                    url: "http://webpage.html"
                    smooth: true
                    scale: 1
                    visible: true

And the action:

                // Change coordinates
                Action {
                    id: coordinateAction
                    objectName: "action2"

                    iconSource: Qt.resolvedUrl("toolbarIcon.png")

                    onTriggered: {
              , coordinateAction)
share|improve this question
up vote 0 down vote accepted

Actually, it was really simple. What I did was that I changed the onTriggered signal to:, mapContent) where mapContent is the ID of the webview. Now the dialog works as it should!

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.