Results 1 to 7 of 7

Thread: Problem using style sheet in hierarchy

  1. #1
    Join Date
    Oct 2009
    Posts
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Problem using style sheet in hierarchy

    Hi,

    I have a problem using style sheet can any one help me please.


    If we have widget which is child of some other widget then style properties of the parent is inherited. How can we stop this ?

    I want my child widget to take the default style which qt provides.

    For ex if i have a widget A with background red .
    Widget B is child of A even widget B gets background red but i want B to look like native. What should i do ?
    I can set style sheet for B it has to be some default like what we get when widget is created with out setting any style sheet for the first time.

  2. #2
    Join Date
    Oct 2009
    Posts
    18
    Thanked 1 Time in 1 Post
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows

    Default Re: Problem using style sheet in hierarchy

    I think we can't set any style sheet to look native .

  3. #3
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Problem using style sheet in hierarchy

    Regarding this post, any ideas could be very helpfull.

  4. #4
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem using style sheet in hierarchy

    How about B.setStyleSheet("") ?

  5. #5
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Problem using style sheet in hierarchy

    I've tried it before but has no effect

  6. #6
    Join Date
    Jan 2009
    Location
    Germany
    Posts
    387
    Thanks
    101
    Thanked 15 Times in 15 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows

    Default Re: Problem using style sheet in hierarchy

    If you are using the ID Selector or the Property Selector (see http://doc.trolltech.com/4.5/stylesheet-syntax.html), is the style still inherited by the children?

  7. #7
    Join Date
    Dec 2008
    Location
    Istanbul, TURKEY
    Posts
    537
    Thanks
    14
    Thanked 13 Times in 13 Posts
    Qt products
    Qt4
    Platforms
    Windows Android

    Default Re: Problem using style sheet in hierarchy

    Hımm..let me try it and make you aware of the result

Similar Threads

  1. QToolButton + style sheet problem
    By John82 in forum Qt Programming
    Replies: 6
    Last Post: 22nd August 2015, 19:37
  2. Problems with Gradient style used through Style sheet on ARM platform
    By puneet.narsapur in forum Qt for Embedded and Mobile
    Replies: 0
    Last Post: 25th January 2010, 12:48
  3. Memory usage problem when setting style sheet
    By DiamonDogX in forum Qt Programming
    Replies: 12
    Last Post: 18th November 2009, 15:52
  4. Style Sheet Problem
    By zgulser in forum Qt Tools
    Replies: 8
    Last Post: 17th February 2009, 08:27
  5. QToolBox qss style sheet problem
    By eskil in forum Qt Programming
    Replies: 1
    Last Post: 17th August 2007, 17:45

Tags for this Thread

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.