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. Best Practices: Nest elements inside MouseArea or nest MouseArea inside element?
Forum Updated to NodeBB v4.3 + New Features

Best Practices: Nest elements inside MouseArea or nest MouseArea inside element?

Scheduled Pinned Locked Moved QML and Qt Quick
3 Posts 2 Posters 779 Views 1 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.
  • B Offline
    B Offline
    boogerlad
    wrote on last edited by
    #1

    As the title says. What are the pros and cons of each way?

    1 Reply Last reply
    0
    • p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      Hi,

      Can you give simple examples of what you want to say ?

      157

      1 Reply Last reply
      0
      • B Offline
        B Offline
        boogerlad
        wrote on last edited by
        #3

        @
        MouseArea
        {
        width: 400
        height: 100
        Rectangle
        {
        anchors.fill: parent
        color: "red"
        Text
        {
        text: "btn"
        }
        }
        onClicked:
        {
        console.log("hi I've been clicked")
        }
        }
        @
        vs
        @
        Rectangle
        {
        width: 400
        height: 100
        color: "red"
        Text
        {
        text: "btn"
        }
        MouseArea
        {
        anchors.fill: parent
        onClicked:
        {
        console.log("hi I've been clicked")
        }
        }
        }
        @

        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