Results 1 to 5 of 5

Thread: Ignore stylesheet for one dialog

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Ignore stylesheet for one dialog

    Hi,

    My application uses a stylesheet which is applied on the QApplication object. However, for the file dialogs (QFileDialog), I would like the default non-stylesheet look. Is there a way to turn off the stylesheet for those dialogs?

    Thanks

  2. #2
    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: Ignore stylesheet for one dialog

    Give your QFileDialogs a default style sheet so that they don't inherit it from QApplication or any other parents. Or give style sheets one by one for every type of your widget like;

    QPushButton{....}
    QFrame{...}
    and so on

  3. #3
    Join Date
    Mar 2009
    Posts
    9
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows

    Default Re: Ignore stylesheet for one dialog

    > Give your QFileDialogs a default style sheet so that they don't inherit it from QApplication or any other parents.

    How can I give them a 'default' stylesheet? Do you mean creating a new styleheet that looks like the 'default look' or is there an easier way to do this?

  4. #4
    Join Date
    Jan 2006
    Location
    Germany
    Posts
    4,380
    Thanks
    19
    Thanked 1,005 Times in 913 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11 Windows Symbian S60
    Wiki edits
    5

    Default Re: Ignore stylesheet for one dialog

    Don't give your QFileDialog a parent. Then nothing can be inherited. Or set an empty style sheet.

  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: Ignore stylesheet for one dialog

    How can I give them a 'default' stylesheet? Do you mean creating a new styleheet that looks like the 'default look' or is there an easier way to do this?
    Yes. That's exactly what I said.

Similar Threads

  1. Ignore-double post
    By Meastaway in forum Newbie
    Replies: 0
    Last Post: 19th November 2009, 18:51
  2. Replies: 4
    Last Post: 14th May 2009, 00:43
  3. Some Signal Ignore
    By nicolas1 in forum Qt Programming
    Replies: 2
    Last Post: 31st December 2008, 02:07
  4. QGraphicsItem event->ignore()
    By fres in forum Qt Programming
    Replies: 1
    Last Post: 25th October 2007, 14:56

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.