Results 1 to 2 of 2

Thread: setChecked(false); does not work with QPushButton

  1. #1
    Join Date
    May 2010
    Posts
    39
    Thanks
    11
    Thanked 1 Time in 1 Post
    Qt products
    Qt3 Qt4

    Default setChecked(false); does not work with QPushButton

    I have some QPushButton, with setCheckable(true), I can do
    button.setChecked(true);
    The button is checked now.

    After some time I call
    button.setChecked(false);
    But it has no effect!
    Button is checked always!

    i need to do this:
    button.setCheckable(false);
    button.setCheckable(true);
    now button is uncheked.

    Why??

  2. #2
    Join Date
    Jan 2006
    Location
    Munich, Germany
    Posts
    4,714
    Thanks
    21
    Thanked 418 Times in 411 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: setChecked(false); does not work with QPushButton

    you have some design error in your code, but with out seeing your code, we can't tell you where it is.
    ==========================signature=============== ==================
    S.O.L.I.D principles (use them!):
    https://en.wikipedia.org/wiki/SOLID_...iented_design)

    Do you write clean code? - if you are TDD'ing then maybe, if not, your not writing clean code.

Similar Threads

  1. set enable QPushButton doesn't work.
    By HelloDan in forum Qt Programming
    Replies: 5
    Last Post: 5th March 2009, 01:31
  2. setVisible(false) doesn't work
    By sepehr in forum Qt Programming
    Replies: 2
    Last Post: 4th February 2009, 16:20
  3. setchecked( true) of the radio button doesn't work
    By richardander in forum Qt Programming
    Replies: 9
    Last Post: 28th January 2009, 17:54
  4. mainwindow menubar setChecked
    By hvw59601 in forum Qt Programming
    Replies: 1
    Last Post: 31st October 2007, 18:11
  5. Replies: 3
    Last Post: 26th September 2006, 12:16

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.