Results 1 to 3 of 3

Thread: style sheet issue.

  1. #1
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default style sheet issue.

    Hi,

    Is there a way to apply style sheet only to parent widget and not to the child widget.
    Actually, i need to draw a frame for the parent widget and not for the chile widget.
    i am using setStyleSheet() function to apply style sheet.

    Regards.
    GK

  2. #2
    Join Date
    Oct 2006
    Location
    New Delhi, India
    Posts
    2,467
    Thanks
    8
    Thanked 334 Times in 317 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: style sheet issue.

    You may use the class name in style sheet.
    In that way you can specify the frame for your parent widget.
    Like -
    MyClass { border:2px }

  3. #3
    Join Date
    Jun 2008
    Posts
    89
    Thanks
    1
    Qt products
    Qt4
    Platforms
    MacOS X Windows

    Default Re: style sheet issue.

    .....But the problem persists...http://www.qtcentre.org/forum/images...s/confused.png


    I have a stacked widget and i want the border on this widget but i do not want the style to apply to child widgets.

    i am using the statement myDialog->setStyleSheet("QStackedWidget { border:2px}")

    but all the widgets inside the stacked widget are getting the style.

    help.

Similar Threads

  1. Style Sheet speed
    By ^NyAw^ in forum Qt Programming
    Replies: 1
    Last Post: 24th January 2008, 18:40
  2. Style Sheet on QWizard
    By desch in forum Qt Programming
    Replies: 2
    Last Post: 6th December 2007, 17:12
  3. QToolButton and Style sheet
    By desch in forum Qt Programming
    Replies: 8
    Last Post: 1st December 2007, 08:38
  4. Qt 4.3 Style sheet, new features
    By Angelo Moriconi in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2007, 15:22
  5. Setting a Style Issue
    By forrestfsu in forum Qt Programming
    Replies: 5
    Last Post: 28th March 2007, 21:32

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.