开发者

PyQt lineEdit with colors

开发者 https://www.devze.com 2022-12-16 06:41 出处:网络
I\'m trying to format a Qt lineEdit text with colors. def __init__(self): QtGui.QMainWindow.__init__(self)

I'm trying to format a Qt lineEdit text with colors.

 def __init__(self):
        QtGui.QMainWindow.__init__(self)
        self.ui = Ui_MainWindow()
        self.ui.setupUi(self)
        self.ui.lineEdit.setText("here be colors")

I searched a lot but only found custom开发者_运维问答ized drawing widgets with monstrous amounts of code. Is there any easier way to format the lineEdit box than customizing the whole?


Maybe use a QTextEdit, and limit it to one line.

0

精彩评论

暂无评论...
验证码 换一张
取 消