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. UNSELECTED WHEN CLICK OUTSIDE A MOUSEAREA
Forum Updated to NodeBB v4.3 + New Features

UNSELECTED WHEN CLICK OUTSIDE A MOUSEAREA

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
1 Posts 1 Posters 105 Views
  • 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.
  • T Offline
    T Offline
    ThaoNguyen
    wrote on last edited by
    #1

    hello, i have a button and i want i can unselected this button when i click anywhere outside its mousearea
    this is Short version my code

    Rectangle {
        id: actionButton
       //..........
       MouseArea {
            id: mouseArea
            anchors.fill: parent
            hoverEnabled: true
            onEntered: {
                actionButton.isHovered = true
            }
            onExited: {
                actionButton.isHovered = false
            }
            onClicked: {
                actionButtonClicked(actionButton.buttonId)
            }
        }
    }
    

    this is taskbar file,I have multiple button but just want this to happen with only the buttonMore

    Rectangle {
    id: taskbar
    
    //........some other  button
            ActionButton {
                id: buttonMore
                buttonId: "3"
                popupText: "View more apps"
                defaultImageSource: "../../../assets/Taskbar/icons/more.png"
                activeImageSource: "../../../assets/Taskbar/icons/more_on.png"
                notifyCount: 0
                isDraggable: false
                modeButton: 2
                buttonHeight: 56
                buttonWidth: parent.width
                onActionButtonClicked: {
                    isSelected = !isSelected
                    if (isSelected) {
                        console.log("More apps is selected!")
                    } else {
                        console.log("More apps is unselected!")
                    }
                }
            }
    }
    
    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