October 27, 2011

wamo wamo
Lab Rat
21 posts

CWD of the stylesheet file

 

What is the current working directory of the stylesheet file?

i create a QTabWidget and set following style

  1. QTabBar::close-button
  2. {
  3.  image: url(closetab.png);
  4.  subcontrol-position: right;
  5.  background: darkgray;
  6. }

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.

2 replies

October 27, 2011

RazrFalcon RazrFalcon
Lab Rat
114 posts

wamo wrote:
What is the current working directory of the stylesheet file?
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 [doc.qt.nokia.com]

 Signature 

QT != Qt
Gentoo + KDE

October 28, 2011

wamo wamo
Lab Rat
21 posts

RazrFalcon wrote:
wamo wrote:
What is the current working directory of the stylesheet file?
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 [doc.qt.nokia.com]

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

 
  ‹‹ [Solved]Eclipse qwidget properties tab missing/empty      [Moved] Using Qt Creator with 4.8 RC1 ››

You must log in to post a reply. Not a member yet? Register here!