Results 1 to 2 of 2

Thread: how to make one button to do two functions

  1. #1
    Join Date
    Dec 2010
    Location
    Lithuania
    Posts
    29
    Qt products
    Qt4
    Platforms
    Windows

    Default how to make one button to do two functions

    I have 2 push buttons. after clicking one buttons changes to setHidden(true) and and after clicking anoter setHidden(false).

    But I do now that it is possible to do that only with one button just like play/pause button?

  2. #2
    Join Date
    Jan 2006
    Location
    Belgium
    Posts
    1,938
    Thanked 268 Times in 268 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows
    Wiki edits
    20

    Default Re: how to make one button to do two functions

    You need to have a variable that keeps the current state of the button.

    Suggestion:
    A QPushButton subclass that defines a state variable in the private section.
    You can then create a statechanged signal.

Similar Threads

  1. Replies: 1
    Last Post: 15th December 2010, 13:20
  2. Replies: 2
    Last Post: 30th July 2010, 16:44
  3. Are there functions to make md5 hash
    By learning_qt in forum Qt Programming
    Replies: 8
    Last Post: 22nd July 2009, 04:21
  4. Replies: 13
    Last Post: 21st May 2009, 07:43
  5. How to make dropdown button bigger
    By Vadi in forum Qt Programming
    Replies: 1
    Last Post: 13th November 2008, 23:54

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.