Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. Mobile and Embedded
  4. Button fokus onPress
Qt 6.11 is out! See what's new in the release blog

Button fokus onPress

Scheduled Pinned Locked Moved Unsolved Mobile and Embedded
2 Posts 1 Posters 639 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.
  • B Offline
    B Offline
    blurry333
    wrote on last edited by
    #1

    Hello,

    I want my button to change its appearance when pressed. Like a focus. How would the syntax look ? The following wouldn't work:

        Button {
            id: button1
            x: 40
            y: 103
            width: 120
            height: 70
            text: qsTr("1")
    
            MouseArea {
                onPressed: {activeFocusOnPress = true}
            }
    
        }
    
    1 Reply Last reply
    0
    • B Offline
      B Offline
      blurry333
      wrote on last edited by
      #2

      Maybe this works.

          Button {
              id: button1
              x: 40
              y: 103
              width: 120
              height: 70
              text: qsTr("1")
              activeFocusOnPress :true
          }
      
      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