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. Hover
Qt 6.11 is out! See what's new in the release blog

Hover

Scheduled Pinned Locked Moved Solved QML and Qt Quick
3 Posts 3 Posters 663 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.
  • ? Offline
    ? Offline
    A Former User
    wrote on last edited by
    #1

    Can we hover a image, like there is image and when mouse pointer goes over that image, the image color should change, like a icon.

    J.HilkJ 1 Reply Last reply
    0
    • mrjjM Offline
      mrjjM Offline
      mrjj
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi
      You could apply an effect to it
      http://doc.qt.io/qt-5/qtgraphicaleffects-qmlmodule.html

      but i wonder what you mean by color change like icon.

      1 Reply Last reply
      1
      • ? A Former User

        Can we hover a image, like there is image and when mouse pointer goes over that image, the image color should change, like a icon.

        J.HilkJ Offline
        J.HilkJ Offline
        J.Hilk
        Moderators
        wrote on last edited by
        #3

        @Bhushan99

        out of the top of my head, -> untested

        Item{
           property string sourceN: "imgsource.png"
           property string sourceO: "OtherSource.png"
        
           Image{
             id: img
              anchors.fill:parent
              source: sourceN
           }
        
           MouseArea{
                id:mAre
                anchors.fill: parent
        
                hoverEnabled: true
                onEntered: img.source = sourceO
                onExited: img.source = sourceN
           }
        }
        

        Be aware of the Qt Code of Conduct, when posting : https://forum.qt.io/topic/113070/qt-code-of-conduct


        Q: What's that?
        A: It's blue light.
        Q: What does it do?
        A: It turns blue.

        1 Reply Last reply
        3

        • Login

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