Results 1 to 3 of 3

Thread: Making a QPushButton style-pressed not only when clicked !!!

  1. #1
    Join Date
    Sep 2011
    Posts
    51
    Thanks
    2
    Qt products
    Qt4

    Default Making a QPushButton style-pressed not only when clicked !!!

    Good morning i'm new in Qt programming and for my project i have to use old QT 4.2.3

    Problem is that.
    When i click on QPushButton i changed the text color and background, and i want the button remains with this style untill i press the button again..

    i try to make some examples :
    first simple case : a button that when clicked remains whith a new stylesheet:


    Using stylesheet (QPushButtonressed) the button remain in the new style only when pressed, but after pressed it returns in its initial state...

    How can set the style for a button when clicked, that remains also after clicked ??

    Thanks Gabriele

    .

  2. #2
    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: Making a QPushButton style-pressed not only when clicked !!!

    Set the button's "checkable" property to true.
    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.


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

    gab74 (12th September 2011)

  4. #3
    Join Date
    Sep 2011
    Posts
    51
    Thanks
    2
    Qt products
    Qt4

    Default Re: Making a QPushButton style-pressed not only when clicked !!!

    Thanks for the quick answer !!!

    I will "transform" the button from Designer and enable checkable !!!

Similar Threads

  1. Replies: 3
    Last Post: 8th September 2011, 16:45
  2. Removing pressed effect from a QPushButton
    By Luc4 in forum Qt Programming
    Replies: 3
    Last Post: 14th August 2010, 12:43
  3. Raise key pressed event when button is clicked?
    By newstead in forum Qt Programming
    Replies: 7
    Last Post: 5th June 2009, 14:12
  4. Delay Loop until a QPushButton pressed
    By ljshap in forum Newbie
    Replies: 6
    Last Post: 17th January 2009, 17:30
  5. Replies: 3
    Last Post: 26th September 2006, 13: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.