[PyQt] Empty style sheet changes QLineEdit

Mads Ipsen mpi at comxnet.dk
Fri Jun 12 07:32:16 BST 2009


Hi,

I can't seem to understand this. If I pass an empty stylesheet to a 
QLineEdit, the edit field changes property.

* Try to enter a 'g' in the example included below. The lower part of 
the 'g' will be invisible.
* Remove the call to setStyleSheet(). The lower part of the 'g' becomes 
visible.

Qt 4.5.1, PyQt 4.4.4, Ubuntu 8.04

Best regards,

Mads

import sys
from PyQt4 import QtCore, QtGui

if __name__ == "__main__":
    app = QtGui.QApplication(sys.argv)

    style_sheet = 'QLineEdit {}'

    line_edit = QtGui.QLineEdit()
    line_edit.setStyleSheet(QtCore.QString(style_sheet))
    line_edit.show()

    sys.exit(app.exec_())



More information about the PyQt mailing list