The code creates a QLineEdit with the background gradient running from top to bottom. How to make the gradient to go from side to side (essentially turn the Vertical to Horizontal gradient used as background)?
line = QtGui.QLineEdit()
gradient = QtGui.QLinearGradient( QtCore.QRectF(line.rect()).topRight(), QtCore.QRectF(line.rect()).bottomRight() ) # top bottm
gradient = QtGui.QLinearGradient( QtCore.QRectF(line.rect()).topLeft(), QtCore.QRectF(line.rect()).topRight() ) # top bottm
gradient.setColorAt(0.0, QtGui.QColor("blue"))
gradient.setColorAt(1.0, QtGui.QColor("red"))
brush = QtGui.QBrush(gradient)
palette = line.palette()
palette.setBrush(QtGui.QPalette.Base, brush)
line.setPalette(palette)
line.show()