Line edit for QListWidgetItem?
-
@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
QLineEditwidget, but only for editing...
You could try a custom (QLineEditstyle) itemDelegate and set your wanted behavior there. Dunno if it will work.Edit:
Yeah, that's probably it.
Set a itemDelegate and use aQLineEditwith someQValidatoror whatever you need, to validate your input... -
Hi, is there a way I could get the
QLineEditforQListWidgetItemwhen it is being edited?
For example, for aQComboBoxI can get theQLineEdit(if theQComboBoxis editable) like this:ui.comboBox->lineEdit(). -
I dont think
QListWidgetItem"includes" aQLineEdit. The item itself is the "display" forQVariantdata...
Or did I get your question wrong?!@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.
-
@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
QLineEditwidget, but only for editing...
You could try a custom (QLineEditstyle) itemDelegate and set your wanted behavior there. Dunno if it will work.Edit:
Yeah, that's probably it.
Set a itemDelegate and use aQLineEditwith someQValidatoror whatever you need, to validate your input... -
@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
QLineEditwidget, but only for editing...
You could try a custom (QLineEditstyle) itemDelegate and set your wanted behavior there. Dunno if it will work.Edit:
Yeah, that's probably it.
Set a itemDelegate and use aQLineEditwith someQValidatoror whatever you need, to validate your input... -
@Pl45m4 Thanks! I thought it would be as easy as accessing the
QLineEditfor editableQComboBox. I will have a look atQItemDeligate.