<div dir="ltr">Hi <br><br>Now i am getting this error on following code <br><br><b>Error : Could not parse stylesheet of widget 0x9743b58</b><br><br>Code :<br><br>#!/usr/bin/python<br>import os ,sys<br>from PyQt4.QtCore import * <br>
from PyQt4.QtGui import *<br>file_path = QString("./css_file.css")<br>app =QApplication(sys.argv)<br>label = QLabel("message")<br>label.setStyleSheet(file_path)<br>label.show()<br>app.exec_()<br><br>Css File <br>
<br>QLabel#label {<br> color: red;<br> padding: 3px;<br> }<br>#label {<br> color: red;<br> padding: 3px;<br> }<br>label {<br> color: red;<br> padding: 3px;<br> }<br>
.label {<br> color: red;<br> padding: 3px; <br> }<br><br>Can anyone please help me in it :(<br><br><br><div class="gmail_quote">On Tue, Nov 29, 2011 at 8:11 PM, uahmed <span dir="ltr"><<a href="mailto:gleam.uahmed@gmail.com">gleam.uahmed@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin: 0pt 0pt 0pt 0.8ex; border-left: 1px solid rgb(204, 204, 204); padding-left: 1ex;"><div dir="ltr">Hi , <br><br>I want to include a css file to pyqt application , i wrote the following code , but it is not effecting the properties of label <br>
<br>my python code is this<br><br>#!/usr/bin/python<br>import os ,sys<br>
from PyQt4.QtCore import *<br>from PyQt4.QtGui import *<br>file_path = QString("css_file.qss")<br>app =QApplication(sys.argv)<br>label =QLabel("message")<br>label.setStyleSheet(file_path)<br>label.show()<br>
app.exec_()<br><br>and "css_file.qss" containing this text<br><br>.QLabel {<br>font-weight: bold;<br>font-size: 15px;<br>color : green;<br>}<br><br></div>
</blockquote></div><br></div>