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.
  • sosunS Offline
    sosunS Offline
    sosun
    wrote on 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 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
      • sosunS Offline
        sosunS Offline
        sosun
        wrote on last edited by
        #3

        Aah, thanks! I was missing this functionality.

        1 Reply Last reply
        0
        • M Offline
          M Offline
          mcosta
          wrote on 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/)

          sosunS 1 Reply Last reply
          0
          • M mcosta

            Hi,

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

            sosunS Offline
            sosunS Offline
            sosun
            wrote on 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

            • Login

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