Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. How to implement multiple actions on onClicked [SOLVED]
Forum Updated to NodeBB v4.3 + New Features

How to implement multiple actions on onClicked [SOLVED]

Scheduled Pinned Locked Moved QML and Qt Quick
mouseareaqmlsignal
5 Posts 3 Posters 4.8k Views 2 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • S Offline
    S Offline
    sosun
    wrote on 29 Apr 2015, 13:20 last edited by sosun
    #1

    I want to implement multiple actions at once. For instance, we have the following snippet:

    MouseArea {
        onClicked: textField.text = "test"
    }
    

    I want the following functionality:

    MouseArea {
        onClicked {
            textField.text = "test"
            myImage.source = "http//....."    
        }
    }
    

    Is it possible?

    1 Reply Last reply
    0
    • T Offline
      T Offline
      t3685
      wrote on 29 Apr 2015, 13:26 last edited by
      #2

      Yes but you need to write with a colon**:**

          onClicked: {
              textField.text = "test"
              myImage.source = "http//....."    
          }
      }
      1 Reply Last reply
      1
      • S Offline
        S Offline
        sosun
        wrote on 29 Apr 2015, 13:29 last edited by
        #3

        Aah, thanks! I was missing this functionality.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on 29 Apr 2015, 14:12 last edited by
          #4

          Hi,

          I can't try now but I think is possible.
          You can execute any kind of Javascript code in a slot

          Once your problem is solved don't forget to:

          • Mark the thread as SOLVED using the Topic Tool menu
          • Vote up the answer(s) that helped you to solve the issue

          You can embed images using (http://imgur.com/) or (http://postimage.org/)

          S 1 Reply Last reply 29 Apr 2015, 14:15
          0
          • M mcosta
            29 Apr 2015, 14:12

            Hi,

            I can't try now but I think is possible.
            You can execute any kind of Javascript code in a slot

            S Offline
            S Offline
            sosun
            wrote on 29 Apr 2015, 14:15 last edited by
            #5

            @mcosta Actually, my problem is solved. Thanks to @t3685 for the solution. I've just forgot to mark it as SOLVED. Anyway, thanks ;)

            1 Reply Last reply
            0

            1/5

            29 Apr 2015, 13:20

            • Login

            • Login or register to search.
            1 out of 5
            • First post
              1/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved