Results 1 to 4 of 4

Thread: How to deal with continuously pressed state of the button image in QML?

  1. #1
    Join Date
    Apr 2011
    Posts
    231
    Thanks
    141
    Thanked 6 Times in 5 Posts

    Default How to deal with continuously pressed state of the button image in QML?

    QML:

    I wish to keep the button image "pressed" for a minute and I want to perform a incremental calculation in that minute.

    I can deal with a single click and release, but how to go about the "continuously pressed" state of the button image?

    I had heard about animations and transitions in qml. Do they have something to do here?
    Last edited by TheIndependentAquarius; 9th December 2013 at 11:23.

  2. #2
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to deal with continuously pressed state of the button image in QML?

    Assuming you mean QtQuick.Controls Button: make it a toggle button, i.e. set "checkable" to true. Reset the "checked" property to false once your calculation is done.

    Optionally make untoggling the button stop the calculation

    Cheers,
    _

  3. #3
    Join Date
    Apr 2011
    Posts
    231
    Thanks
    141
    Thanked 6 Times in 5 Posts

    Default Re: How to deal with continuously pressed state of the button image in QML?

    I don't want that.

    BTW, has the transitions/animations to do something with the "continuously pressed" state?

  4. #4
    Join Date
    Jan 2006
    Location
    Graz, Austria
    Posts
    8,416
    Thanks
    37
    Thanked 1,544 Times in 1,494 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: How to deal with continuously pressed state of the button image in QML?

    Quote Originally Posted by Anisha Kaul View Post
    I don't want that.
    Then you'll have to rephrase your question. My interpretation was that you wanted a button to stay down/pressed until some trigger returns it to up/unpressed.

    Cheers,
    _

Similar Threads

  1. do something while a button is pressed
    By saman_artorious in forum Qt Programming
    Replies: 11
    Last Post: 12th November 2013, 15:39
  2. Replies: 6
    Last Post: 4th October 2010, 03:19
  3. QML button from irregular svg image - hover state
    By thomasfreedy in forum Qt Programming
    Replies: 0
    Last Post: 5th May 2010, 03:13
  4. Raise key pressed event when button is clicked?
    By newstead in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2009, 13:12
  5. Getting the row for button pressed
    By steg90 in forum Qt Programming
    Replies: 2
    Last Post: 28th November 2007, 15:45

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.