Results 1 to 13 of 13

Thread: How to disable pushbutton after clicking it

  1. #1
    Join Date
    Apr 2011
    Posts
    2
    Qt products
    Qt/Embedded

    Default How to disable pushbutton after clicking it

    I created lots of pushbutton in a buttongroup and add slot and signal to them with` QT DESIGNER`. What I want to do is; after clicking any of the pushbuttons some operation will be done and after all finished the pushbutton should be disabled. How can I disable it(All I know is I can do it with isEnabled and setEnabled and we do not know which button is clicked)

  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: How to disable pushbutton after clicking it

    and we do not know which button is clicked
    QObject::sender()
    ==========================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.

  3. #3
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to disable pushbutton after clicking it

    in a slot, you can use the "sender()"-method to obtain the object which emitted the signal.

    edit: *arg* less text and I would have been faster than high_flyer
    Last edited by FelixB; 19th April 2011 at 13:32.

  4. #4
    Join Date
    Sep 2009
    Location
    UK
    Posts
    2,447
    Thanks
    6
    Thanked 348 Times in 333 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to disable pushbutton after clicking it

    Or even high_flyer, which is who replied before you, not wysota

  5. #5
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to disable pushbutton after clicking it

    oh yes, I always mix them up because of the "certified developer"-logo

  6. #6
    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: How to disable pushbutton after clicking it

    I think wysota will mind more to be mixed up with me, then I am with him
    ==========================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.

  7. #7
    Join Date
    Apr 2011
    Posts
    2
    Qt products
    Qt/Embedded

    Default Re: How to disable pushbutton after clicking it

    Quote Originally Posted by FelixB View Post
    in a slot, you can use the "sender()"-method to obtain the object which emitted the signal.
    I do not know how to use
    Last edited by wysota; 19th April 2011 at 15:03.

  8. #8
    Join Date
    Oct 2010
    Location
    Berlin, Germany
    Posts
    358
    Thanks
    18
    Thanked 68 Times in 66 Posts
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: How to disable pushbutton after clicking it

    then read the link high_flyer posted. or show us what you tried so far...

  9. #9
    Join Date
    Aug 2009
    Location
    coimbatore,India
    Posts
    314
    Thanks
    37
    Thanked 47 Times in 43 Posts
    Qt products
    Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows

    Default Re: How to disable pushbutton after clicking it

    hi,
    I do not know how to use
    use qobject_cast to cast the sender();

    Bala

  10. #10
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to disable pushbutton after clicking it

    Quote Originally Posted by high_flyer View Post
    I think wysota will mind more to be mixed up with me, then I am with him
    Naaa... all stays in the family Besides, I'd like to participate in a lets-go-to-mars project too, so I don't mind
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  11. #11
    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: How to disable pushbutton after clicking it

    I'd like to participate in a lets-go-to-mars project too, so I don't mind
    really??
    I am sure we can find something for you to chew on!
    ==========================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.

  12. #12
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,359
    Thanks
    3
    Thanked 5,015 Times in 4,792 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: How to disable pushbutton after clicking it

    Quote Originally Posted by high_flyer View Post
    I am sure we can find something for you to chew on!
    If it involves coding Qt and not speaking German then bring it on!
    Your biological and technological distinctiveness will be added to our own. Resistance is futile.

    Please ask Qt related questions on the forum and not using private messages or visitor messages.


  13. #13
    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: How to disable pushbutton after clicking it

    We do all our non embedded coding in Qt.
    Project language is English.
    Once we get RTEMS running on our hardware depending on time and how much sense it will make we might try to port Qt to RTEMS.
    At the moment there is not much to do that I can't do on my own in a relaxed time span.
    But as we get nearer to launch (end 2013) we will need quite a bit of work done for the ground station -> Qt Desktop - and then help will be much appreciated.
    I'll contact you then again.
    ==========================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. Replies: 8
    Last Post: 1st October 2015, 07:23
  2. Clicking on QwtPlot
    By orignihn in forum Qwt
    Replies: 1
    Last Post: 14th April 2011, 16:37
  3. Replies: 2
    Last Post: 3rd April 2011, 12:48
  4. How to add Treewidget Items when clicking on PushButton
    By mkkguru in forum Qt Programming
    Replies: 7
    Last Post: 11th February 2010, 13:48
  5. disable transition on Vista pushButton
    By Lele in forum Qt Programming
    Replies: 3
    Last Post: 18th February 2008, 18:22

Tags for this Thread

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.