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 notify a widget for mouse event?
Forum Updated to NodeBB v4.3 + New Features

How to notify a widget for mouse event?

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

    hi,
    i want to create a class that when i bring my mouse to a widget(e.g. qPushButton or qLabel etc.) its color changes or its text becomes bold...
    please help me how can i do that?
    tnx :)

    1 Reply Last reply
    0
    • Y Offline
      Y Offline
      Yasser Sobhy
      wrote on last edited by
      #2

      do you want a Qwidgets or Qml components

      if Qml components

      @
      Rectangle
      {
      id: button

      width: 30
      height:20
      
          Text {
              id: string
              text: "click me!"
              font.pointSize: 12
              font.family: "KacstBook"
          }
      
      MouseArea
      {
          id:itemmousearea
          anchors.fill: parent
          hoverEnabled: true
          onEntered:{ button.color = "lightblue"}
          onExited: { button.color = "white"}
      }
      

      }
      @

      1 Reply Last reply
      0
      • M Offline
        M Offline
        mohamaddanesh44
        wrote on last edited by
        #3

        that helps thank you :) but could you post Qwidgets???

        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