Results 1 to 4 of 4

Thread: how to set stylesheet for two QWidget

  1. #1
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default how to set stylesheet for two QWidget

    Hi all
    I ve a problen. i need help.
    if ill write like
    ui.m_pLowerStatusBar->setStyleSheet("QWidget#widget {background-color: yellow}; QWidget#widget_2 {background-color: white"); its not workinf fine.

    if iwill write like
    ui.m_pLowerStatusBar->setStyleSheet("QWidget#widget {background-color: yellow}");
    ui.m_pLowerStatusBar->setStyleSheet("QWidget#widget_2 {background-color: white");
    its also not working fine.
    Can any body tell me how to fill the back ground of both widget at a time
    Attached Files Attached Files
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  2. #2
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    5,372
    Thanks
    28
    Thanked 976 Times in 912 Posts
    Qt products
    Qt3 Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to set stylesheet for two QWidget

    Quote Originally Posted by phillip_Qt View Post
    ui.m_pLowerStatusBar->setStyleSheet("QWidget#widget {background-color: yellow}; QWidget#widget_2 {background-color: white"); its not workinf fine.
    Isn't there "}" missing?

  3. #3
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to set stylesheet for two QWidget

    Quote Originally Posted by jacek View Post
    Isn't there "}" missing?
    That i ve corrected
    ui.m_pLowerStatusBar->setStyleSheet("QWidget#widget {background-color: yellow}; QWidget#widget_2 {background-color: white}");
    but color is not getting changed.
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

  4. #4
    Join Date
    Oct 2007
    Posts
    201
    Thanks
    19
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: how to set stylesheet for two QWidget

    Ya its working now. i did like following

    ui.m_pLowerStatusBar->setStyleSheet("QWidget#widget {background-color: yellow} QWidget#widget_2 {background-color: white}");
    Cheers,
    Phillip



    --- Please post the solution you got to solve your problem. It may help others.

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.