Line edit for QListWidgetItem?
-
@CJha said in Line edit for QListWidgetItem?:
Can I somehow get the display of QVariant data?
OK, found out that it actually does show a
QLineEdit
widget, but only for editing...
You could try a custom (QLineEdit
style) itemDelegate and set your wanted behavior there. Dunno if it will work.Edit:
Yeah, that's probably it.
Set a itemDelegate and use aQLineEdit
with someQValidator
or whatever you need, to validate your input... -
@Pl45m4 Thanks! No, you got it right.
The item itself is the "display" for QVariant data...
Can I somehow get the display of QVariant data? I just want to monitor as the user updates the text and change the color to red in case the user inputs a text that already exists. I cannot do that by changing the foreground of the item itself when the user is updating the text.
-
@CJha said in Line edit for QListWidgetItem?:
Can I somehow get the display of QVariant data?
OK, found out that it actually does show a
QLineEdit
widget, but only for editing...
You could try a custom (QLineEdit
style) itemDelegate and set your wanted behavior there. Dunno if it will work.Edit:
Yeah, that's probably it.
Set a itemDelegate and use aQLineEdit
with someQValidator
or whatever you need, to validate your input...