Results 1 to 2 of 2

Thread: QSS problem

  1. #1
    Join Date
    Feb 2010
    Location
    Russia, Omsk
    Posts
    28
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default QSS problem

    I use a qss file in my application like
    Qt Code:
    1. QFile qss(".\\resources\\styles.qss");
    2. qss.open(QFile::ReadOnly);
    3. a.setStyleSheet(qss.readAll());
    4. qss.close();
    To copy to clipboard, switch view to plain text mode 
    It works well and has applied styles when I start the application from QtCreator or VS2010. But if I try starting the application directly from a folder clicking exe-file, the one looks like styles were not applied.

    I don't know the reason of such behavior.

    Thanks

  2. #2
    Join Date
    Feb 2010
    Location
    Russia, Omsk
    Posts
    28
    Thanks
    4
    Qt products
    Qt4
    Platforms
    Windows

    Default Re: QSS problem

    Resolved.
    I placed qss reference to the qrc-file
    Qt Code:
    1. <file>resources/styles.qss</file>
    To copy to clipboard, switch view to plain text mode 
    and in my application did something like
    Qt Code:
    1. QFile qss(":/resources/styles.qss");
    To copy to clipboard, switch view to plain text mode 

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.