Results 1 to 3 of 3

Thread: Color od pushbutton can not be changed

  1. #1
    Join Date
    Jul 2018
    Posts
    26
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Color od pushbutton can not be changed

    I have to put pushbutton and the rest to different colors. I cannot do that. I have picked from component properties
    Style Sheet, and click on … . I got pop-up windows with "Edit Style Sheet - Qt Designer", with 4 options: Add Resources, Add Gradient, Add Color and Add Font. I selected "Add Color", from there I have selected desired Color. Pressed Ok, and got message "invalid style sheet". The same happened for any color…

    I am working on MSVC VC++ with qt as add on. What I am doing wrong?
    here is screenshot:

    Capture3.jpg
    Last edited by Pereubu2018; 6th July 2018 at 16:15.

  2. #2
    Join Date
    Jan 2008
    Location
    Alameda, CA, USA
    Posts
    5,230
    Thanks
    302
    Thanked 864 Times in 851 Posts
    Qt products
    Qt5
    Platforms
    Windows

    Default Re: Color od pushbutton can not be changed

    Simply adding the color does not create a valid style sheet. You need actual CSS / QSS:

    Qt Code:
    1. QPushButton:pressed { \
    2. background-color: rgb(224, 0, 0); \
    3. border-style: inset; \
    4. }
    To copy to clipboard, switch view to plain text mode 
    <=== The Great Pumpkin says ===>
    Please use CODE tags when posting source code so it is more readable. Click "Go Advanced" and then the "#" icon to insert the tags. Paste your code between them.

  3. #3
    Join Date
    Jul 2018
    Posts
    26
    Thanks
    1
    Qt products
    Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Color od pushbutton can not be changed

    That was it. I have direction where to go.

Similar Threads

  1. How to change Pushbutton color with QPalette
    By GeneCode in forum Newbie
    Replies: 6
    Last Post: 25th September 2017, 03:50
  2. QTabBar one color line can't be changed
    By Alundra in forum Qt Programming
    Replies: 4
    Last Post: 9th June 2014, 16:59
  3. Replies: 3
    Last Post: 11th December 2012, 17:32
  4. QTextEdit contents changed highlight the color
    By sujan.dasmahapatra in forum Qt Programming
    Replies: 3
    Last Post: 8th June 2011, 18:31
  5. Splitter Color changed when referesh?
    By rajeshs in forum Qt Programming
    Replies: 1
    Last Post: 11th July 2007, 09:10

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.