I have set property to QLineEdit as
self.ui.txtName.setProperty('rules', 'required')
I want to remove this property dynamically, is there any way to do so,
Docs say:
...
A property can be removed from an instance by passing the property name and an invalid QVariant value to QObject::setProperty(). The default constructor for QVariant constructs an invalid QVariant.
and this works for PyQt:
self.ui.txtName.setProperty("rules", QtCore.QVariant())
#or
self.ui.txtName.setProperty("rules", None)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.