Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. International
  3. India
  4. QML MouseArea
Forum Updated to NodeBB v4.3 + New Features

QML MouseArea

Scheduled Pinned Locked Moved India
12 Posts 2 Posters 5.5k 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.
  • sierdzioS Offline
    sierdzioS Offline
    sierdzio
    Moderators
    wrote on last edited by
    #2

    Just add a Text element and make it's "visible" property conditional depending on your mouse enter and leave events.

    (Z(:^

    1 Reply Last reply
    1
    • A Offline
      A Offline
      actionking
      wrote on last edited by
      #3

      Thank you very much.Could you please tell me in an example

      1 Reply Last reply
      0
      • A Offline
        A Offline
        actionking
        wrote on last edited by
        #4

        Within a mouseArea how will we add text concept..I have tried it out,but it is showing error..Please help me

        1 Reply Last reply
        0
        • sierdzioS Offline
          sierdzioS Offline
          sierdzio
          Moderators
          wrote on last edited by
          #5

          Show me your code, then. Do you expect me to write your app for you?

          A quick example:
          @
          Image {
          id: yourImage

          MouseArea {
          id: mouseArea
          hoverEnabled: true
          anchors.fill: parent

          onEntered: myText.visible = true;
          onExited: myText.visible = false; 
          

          }

          Text {
          id: myText
          // [...]
          }
          }
          @

          (Z(:^

          1 Reply Last reply
          1
          • A Offline
            A Offline
            actionking
            wrote on last edited by
            #6

            @import QtQuick 1.0
            Image{
            width:1300
            height:800
            id:original
            source:"img/originalblue.png"
            anchors.fill:parent
            Image{
            id:view
            width:350
            height:60
            source:"img/g5.png"
            anchors.top:parent.top
            anchors.topMargin: 10
            anchors.horizontalCenter: parent.horizontalCenter
            Text {
            id: view1
            text: qsTr("View/Modify Speciality")
            font.pixelSize: 30
            anchors.centerIn: parent
            }
            }
            Image{
            id:delete1
            source:"img/deleticon.png"
            width:80
            height:80
            anchors.left:parent.left
            anchors.leftMargin: 70
            anchors.bottom:parent.bottom
            anchors.bottomMargin: 60
            MouseArea{
            id:del
            hoverEnabled: true
            anchors.fill:parent
            onEntered:
            {
            delete1.width=80
            delete1.height=100
            }
            onExited:
            {
            delete1.width=80
            delete1.height=80
            }
            }
            }
            }@

            1 Reply Last reply
            0
            • sierdzioS Offline
              sierdzioS Offline
              sierdzio
              Moderators
              wrote on last edited by
              #7

              Use '@' tags and format your code so that it's readable.

              You just need to anchor the Text element properly (like anchors.bottom: parent.bottom) and it will work.

              (Z(:^

              1 Reply Last reply
              0
              • A Offline
                A Offline
                actionking
                wrote on last edited by
                #8

                boss i just need to know,can we use text inside the mouse event....

                1 Reply Last reply
                0
                • A Offline
                  A Offline
                  actionking
                  wrote on last edited by
                  #9

                  when i enters the deleticon.png , i want to show the delete name below the deleticon..please tell me in code.i will be so much thankful to you

                  1 Reply Last reply
                  0
                  • sierdzioS Offline
                    sierdzioS Offline
                    sierdzio
                    Moderators
                    wrote on last edited by
                    #10

                    Yes, I have already shown you how in my first snippet.

                    (Z(:^

                    1 Reply Last reply
                    0
                    • sierdzioS Offline
                      sierdzioS Offline
                      sierdzio
                      Moderators
                      wrote on last edited by
                      #11

                      @
                      Text {
                      id: view2
                      text: qsTr("Delete")
                      font.pixelSize: 30
                      anchors.top: delete1.bottom
                      anchors.horizontalCenter: delete1.horizontalCenter
                      }
                      @

                      (Z(:^

                      1 Reply Last reply
                      1
                      • A Offline
                        A Offline
                        actionking
                        wrote on last edited by
                        #12

                        Thank you very much bosss...Almost its worked...
                        With regards,
                        mohanakannan

                        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