Results 1 to 2 of 2

Thread: How to keep a pushbutton be down unless if want to make it be up?

  1. #1
    Join Date
    Jul 2007
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Question How to keep a pushbutton be down unless if want to make it be up?

    Hi, everybody:

    I want keep a pushbutton be in a down state until I want to chang it in a up state. I use a qgroupbox as several pushbutton's parrent, I can use setDown(true) to make a pushbutton in a down state, but to my disappointed, when my mouse clicked in a QScrollArea window which is in the same program, the pushbutton in down state will automatically change to be in up state. Why?
    What i want is make a pushbutton always be in a down state until I make it be in up state?
    What can I do?
    Thanks lot.

  2. #2
    Join Date
    Jul 2007
    Posts
    6
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Smile Re: How to keep a pushbutton be down unless if want to make it be up?

    Oh, guys:
    I figure it out. In fact, very simple, I'm a begainer, sigh.
    only set those pushbutton to be checkable, and when a click on one of the pushbutton,
    you first check whether isDown() (Note: can't use isChecked() ) is true, if false, then call setChecked(true) on the clicked button, and set other buttons's check state of the groupbox to be false using setChecked(false) member function of QPushButton .
    Anyway , thanks you! Qt Center, you provide a good communication platform for programmer or developers using Qt.

Similar Threads

  1. Window OS make distclean && qmake && make one line
    By patrik08 in forum General Programming
    Replies: 4
    Last Post: 22nd March 2007, 10:43
  2. Compiling with Qmake/Make
    By VireX in forum Newbie
    Replies: 25
    Last Post: 22nd February 2007, 05:57
  3. Replies: 3
    Last Post: 19th October 2006, 22:13
  4. Qt/Embedded Installation error during make
    By mahe2310 in forum Installation and Deployment
    Replies: 5
    Last Post: 7th September 2006, 04:05
  5. Qt4.1.4 make errors.
    By impeteperry in forum Installation and Deployment
    Replies: 11
    Last Post: 1st July 2006, 17:27

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.