I need to create QLineEdit with the search icon on the left side and i'm doing it in QtDesigner.
I've added my search_icon.svg to my resources.qrc file and assigned this qrc as a resource of my application using resource browser of QtDesigner. The contents of resources.qrc look like this:
<RCC>
<qresource prefix = "/icons">
<file alias = "search_icon.svg">search_icon.svg</file>
</qresource>
</RCC>
Then I referenced search_icon.svg in "Edit Style Sheet" window of QtDesigner using qss:
QLineEdit {
background-image: url(:/icons/search_icon.svg);
background-position: left;
padding: 2 2 2 25;
}
but search_icon.svg hadn't been displayed on QLineEdit.
QtDesigner's mainWindow.ui and resources.qrc as same as search_icon.svg are in the same directory.
Do I need to compile resources.qrc somehow so that search_icon.svg can be used in qss of "Edit Style Sheet" window of QtDesigner?