Page 2 of 2 FirstFirst 12
Results 21 to 28 of 28

Thread: QPushbutton background color

  1. #21
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPushbutton background color

    Quote Originally Posted by spirit View Post
    rebuild Qt and try again


    I use Qt4.2.2

  2. #22
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPushbutton background color

    maybe it's a bug in this version. anyway, did you try to run this code on another version of Qt?

  3. #23
    Join Date
    Oct 2008
    Posts
    70
    Thanks
    1
    Thanked 9 Times in 9 Posts

    Default Re: QPushbutton background color

    omega36, Do you have a chance to try Qt 4.3 or 4.4?

  4. #24
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPushbutton background color

    Quote Originally Posted by spirit View Post
    maybe it's a bug in this version. anyway, did you try to run this code on another version of Qt?
    ....

    No I can't, I must use Qt4.2.2

  5. #25
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPushbutton background color

    in this case, it is not necessary to create an image using an image editor and then load it. you can create an QPixmap in your program and then use it.

  6. #26
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPushbutton background color

    Quote Originally Posted by omega36 View Post
    even if the above code is correct, but... nothing happend

    and this is my solution : I create a red .png - for exemple - with "MacromediaFireWorks" ,
    I convert it to .ico and it's work with this code :

    ui.pushButton->setIcon(QIcon("./icon/28.ico"));

    thanks to all

    yes.. done

    thank u very much

  7. #27
    Join Date
    Aug 2008
    Location
    Ukraine, Krivoy Rog
    Posts
    1,963
    Thanked 370 Times in 336 Posts
    Qt products
    Qt3 Qt4 Qt5
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: QPushbutton background color

    I'm talking about this
    Qt Code:
    1. ....
    2. QPixmap pixmap(width, height);
    3. pixmap.fill(Qt::red);
    4. QIcon icon(pixmap);
    5. ...
    To copy to clipboard, switch view to plain text mode 

  8. #28
    Join Date
    Jul 2008
    Posts
    40
    Thanks
    1
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QPushbutton background color

    sorry I read it quickly
    ok that is better

Similar Threads

  1. Change background color of QPushButton
    By gtthang in forum Qt Programming
    Replies: 3
    Last Post: 26th November 2013, 10:23
  2. Change QPushButton Background Color, Qt4.3
    By Rayven in forum Qt Programming
    Replies: 5
    Last Post: 4th July 2009, 07:14
  3. How to change color of a QPushButton?
    By vishal.chauhan in forum Qt Programming
    Replies: 6
    Last Post: 5th March 2008, 13:22
  4. Change background color for a QPushButton?
    By Harvey West in forum Qt Programming
    Replies: 6
    Last Post: 5th January 2007, 14:23
  5. QLabel background color
    By munna in forum Newbie
    Replies: 3
    Last Post: 1st May 2006, 15:36

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
  •  
Qt is a trademark of The Qt Company.