Results 1 to 9 of 9

Thread: how to apply stylesheet defined in .qss file to qt application

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    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 apply stylesheet defined in .qss file to qt application

    Quote Originally Posted by namita View Post
    Hi,

    Thanks a lot...
    Now i'm able to apply external stylesheet to the qt application.


    Regards,
    Namita
    Hi. Im also using qss file. Are u adding Q_INIT_RESOURCES in ur main(), inorder to initialise qss?

    Thanx.
    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
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to apply stylesheet defined in .qss file to qt application

    QSS and Q_INIT_RESOURCES have nothing to do with each other.

  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 apply stylesheet defined in .qss file to qt application

    Quote Originally Posted by wysota View Post
    QSS and Q_INIT_RESOURCES have nothing to do with each other.
    As far my understand I think qss(qt Style sheet) is also a resources and Q_INIT_RESOURCES is required to initialise all resources. So i asked this. I also posted this inforum http://www.qtcentre.org/forum/f-qt-p...rce-12508.html But i didnt get any reply. So i asked this.
    Cheers,
    Phillip



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

  4. #4
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to apply stylesheet defined in .qss file to qt application

    Quote Originally Posted by phillip_Qt View Post
    As far my understand I think qss(qt Style sheet) is also a resources
    That's not true.
    and Q_INIT_RESOURCES is required to initialise all resources.
    That's not true as well.

    "Qt resources" is a virtual filesystem, nothing more, nothing less. Stylesheets have nothing to do with files and in this particular case the stylesheet is loaded from an external and real file.

    Q_INIT_RESOURCES is only needed if you want to initialize resources that are embedded int a static library on some of the platforms. It' required to link them to the filesystem already existing in the application.

  5. #5
    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 apply stylesheet defined in .qss file to qt application

    Quote Originally Posted by wysota View Post
    That's not true.

    That's not true as well.

    "Qt resources" is a virtual filesystem, nothing more, nothing less. Stylesheets have nothing to do with files and in this particular case the stylesheet is loaded from an external and real file.

    Q_INIT_RESOURCES is only needed if you want to initialize resources that are embedded int a static library on some of the platforms. It' required to link them to the filesystem already existing in the application.
    Thank you very much
    But i ve a doubt, can i use Q_INIT_RESOURCE macro in a dll.?
    Cheers,
    Phillip



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

  6. #6
    Join Date
    Jan 2006
    Location
    Warsaw, Poland
    Posts
    33,368
    Thanks
    3
    Thanked 5,018 Times in 4,794 Posts
    Qt products
    Qt3 Qt4 Qt5 Qt/Embedded
    Platforms
    Unix/X11 Windows Android Maemo/MeeGo
    Wiki edits
    10

    Default Re: how to apply stylesheet defined in .qss file to qt application

    Do you need the macro? Yes, you can use it, but you probably don't have to.

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.