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. Image blinking

Image blinking

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
7 Posts 2 Posters 2.3k 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.
  • S Offline
    S Offline
    satyanarayana143
    wrote on last edited by
    #1

    i want button image blinking when i clicked button and again clicked button stop blinking image in qml .can anybody give solution about this.

    ODБOïO 1 Reply Last reply
    0
    • S satyanarayana143

      i want button image blinking when i clicked button and again clicked button stop blinking image in qml .can anybody give solution about this.

      ODБOïO Offline
      ODБOïO Offline
      ODБOï
      wrote on last edited by ODБOï
      #2

      @satyanarayana143 hi

       Rectangle{
              id:btn
              color: "blue"
              height: 60
              width: 60
      
              property bool blink : false
      
              MouseArea{
                  anchors.fill: parent
                  onClicked: btn.blink = !btn.blink
              }
      
              ColorAnimation on color{
                  from : btn.color
                  to: Qt.lighter(btn.color)            
                  duration: 200
                  running: btn.blink
                  loops : Animation.Infinite
                  onRunningChanged: if(!running){btn.color = "blue"} // reset 
              }
          }
      

      you can use same approach to apply a color overlay if this is for an image

      ODБOïO 1 Reply Last reply
      0
      • S Offline
        S Offline
        satyanarayana143
        wrote on last edited by
        #3

        not colour change image blinking

        1 Reply Last reply
        0
        • ODБOïO ODБOï

          @satyanarayana143 hi

           Rectangle{
                  id:btn
                  color: "blue"
                  height: 60
                  width: 60
          
                  property bool blink : false
          
                  MouseArea{
                      anchors.fill: parent
                      onClicked: btn.blink = !btn.blink
                  }
          
                  ColorAnimation on color{
                      from : btn.color
                      to: Qt.lighter(btn.color)            
                      duration: 200
                      running: btn.blink
                      loops : Animation.Infinite
                      onRunningChanged: if(!running){btn.color = "blue"} // reset 
                  }
              }
          

          you can use same approach to apply a color overlay if this is for an image

          ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by ODБOï
          #4

          @LeLev said in Image blinking:

          you can use same approach to apply a color overlay if this is for an image

              
              Item {
                  width: 300
                  height: 300
                  MouseArea{
                      anchors.fill: parent
                      onClicked:  img.blink = !img.blink                        
                  }
          
                  Image {
                      id: img
                      source: "info.png"
                      sourceSize: Qt.size(parent.width, parent.height)
                      smooth: true
                      visible: false
                      property bool blink : false
                  }
          
                  ColorOverlay {
                      id:co
                      anchors.fill: img
                      source: img
                      color: "#80000000"
          
                      ColorAnimation on color{
                          from:"#00080000"
                          to:"#80000000"
                          duration: 200
                          running: img.blink
                          loops : Animation.Infinite
                          onRunningChanged: if(!running){co.color = "#00080000"} // reset
                      }
          
                  }
              }
          
          1 Reply Last reply
          1
          • S Offline
            S Offline
            satyanarayana143
            wrote on last edited by
            #5

            again u given ColorOverlay and ColorAnimation i am asking image should blink and stop not color image

            like voice recorder in windows when click start it will blink and we stop it will stop like that

            ODБOïO 1 Reply Last reply
            0
            • S satyanarayana143

              again u given ColorOverlay and ColorAnimation i am asking image should blink and stop not color image

              like voice recorder in windows when click start it will blink and we stop it will stop like that

              ODБOïO Offline
              ODБOïO Offline
              ODБOï
              wrote on last edited by ODБOï
              #6

              @satyanarayana143 ok, no idea what do you mean then..

              1 Reply Last reply
              0
              • S Offline
                S Offline
                satyanarayana143
                wrote on last edited by
                #7

                when we click and stop on windows voice recorder like that functionality in qml

                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