Important: Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

CWD of the stylesheet file



  • What is the current working directory of the stylesheet file?

    i create a QTabWidget and set following style

    @QTabBar::close-button
    {
    image: url(closetab.png);
    subcontrol-position: right;
    background: darkgray;
    }@

    the gray box does appear but i cannot see the closebutton. I tried the same path as the stylesheet and the application bin dir.

    If i set an absolute path like c:\images\closetab.png and copy the file there it works fine.



  • [quote author="wamo" date="1319722676"]What is the current working directory of the stylesheet file?[/quote]The directory from which you start your app.

    You can create folder with name "icons" in folder with your application executable. Then: image: url(icons/closetab.png);

    Or just use "qrc":http://doc.qt.nokia.com/latest/resources.html



  • [quote author="RazrFalcon" date="1319723510"][quote author="wamo" date="1319722676"]What is the current working directory of the stylesheet file?[/quote]The directory from which you start your app.

    You can create folder with name "icons" in folder with your application executable. Then: image: url(icons/closetab.png);

    Or just use "qrc":http://doc.qt.nokia.com/latest/resources.html[/quote]

    I found this solution. My ide has a different default CWD path. It was home instead the appdir.
    Thank you


Log in to reply