Results 1 to 4 of 4

Thread: QPushButton question...

  1. #1
    Join Date
    Jan 2007
    Posts
    81
    Thanks
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default QPushButton question...

    I have a bunch of qpushbuttons...when the user has clicked one, I want to set it down using setDown(true) ....which I do....the problem is: until the user has clicked another qpushbutton, the last qpushbutton should be shown as down.
    This is not the case because as soon as I move the scroll bars with the mouse wheel or click somewhere on the qgraphicsscene which I have, the qpushbutton pops up. It seems to be when the mouse leaves the widget....and is used with any buttons.

    anyone have some ideas?


    Thanks,
    Jonathan

    edit://want to try something with QButtonGroup....just saw this class now...
    Last edited by JonathanForQT4; 26th April 2007 at 14:47.

  2. #2
    Join Date
    Feb 2006
    Location
    Romania
    Posts
    2,744
    Thanks
    8
    Thanked 541 Times in 521 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: QPushButton question...

    Use a QButtonGroup with setExclusive( true ) and QToolButtons.
    I never tried it with QPushButton, but it might work if you set the QPushButtons setToggleButton( true ) and then use toggle when you want a button to remain pressed.

    Regards

  3. The following user says thank you to marcel for this useful post:

    JonathanForQT4 (26th April 2007)

  4. #3
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: QPushButton question...

    Maybe an exclusive QButtonGroup of checkable QPushButtons would do it for you?
    J-P Nurmi

  5. The following user says thank you to jpn for this useful post:

    JonathanForQT4 (26th April 2007)

  6. #4
    Join Date
    Jan 2007
    Posts
    81
    Thanks
    17
    Thanked 3 Times in 3 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPushButton question...

    ahhh, I hate when this happens (me finding something just as I post) .... if only this were the case with the GraphicsScene problems....thanks in any case guys!

    edit://thanking you both cause I'm a nice guy
    Last edited by JonathanForQT4; 26th April 2007 at 16:28.

Similar Threads

  1. Adding Image to QPushButton
    By Seema Rao in forum Qt Programming
    Replies: 3
    Last Post: 18th November 2011, 09:06
  2. Access to QSqlTableModel::isDirty Question.
    By patrik08 in forum Qt Programming
    Replies: 3
    Last Post: 12th April 2007, 17:49
  3. Question regarding how to paint after zoom.
    By JonathanForQT4 in forum Qt Programming
    Replies: 2
    Last Post: 26th January 2007, 15:34
  4. Replies: 3
    Last Post: 26th September 2006, 12:16
  5. QT4 layout of complex dialog is very slow
    By cboles in forum Qt Programming
    Replies: 15
    Last Post: 28th April 2006, 19:57

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.