I have been following this tutorial on creating an rqt plugin.
I have designed the .ui file of the plugin in 'QT 4 Designer', and created the resources there. My custom plugin contains a button with a background-image, styled as follows:
background: url(:/buttons/img/myImg.png) no-repeat center center fixed;
background-color:#1F1E24;
The image shows up in qt designer, but when I run it with rosrun rqt_my_plugin rqt_my_plugin
the image does not show up.
The background color does however load, so the stylesheet is applied somehow.
When I enter an absolute path for the background url it works just fine, the generated relative path however does not.
Does anyone know the solution to this problem?
Thanks in advance!
File structure
src
└── (contents omitted)
srcipts
└── (contents omitted)
resource
├── myImages.qrc
├── myPlugin.ui
└── img
└── myImg.png
myImages.qrc
<RCC>
<qresource prefix="/buttons">
<file>img/myImg.png</file>
</qresource>
</RCC>
myPlugin.ui (generated by QT 4 designer)
<property name="styleSheet">
<string notr="true">background: url(:/buttons/img/myImg.png) no-repeat center center fixed;
background-color:#1F1E24;
</string>
</property>
Originally posted by Isha Dijcks on ROS Answers with karma: 85 on 2019-01-17
Post score: 0