<div dir="ltr">Hello,<div>I'm writing a custom widget with a plugin for Designer in PyQt 5.7.</div><div>What I wanted to do is to enable/disable certain properties (almost like the "checked" property for QPushButton, which is disabled if "checkable" is not checked). Since I wasn't able to find a way to obtain this, I tried another approach, by using QDesignerPropertySheetExtension's setVisible.</div><div>My implementation connects the formEditor.propertyEditor().propertyChanged signal to a custom slot. In the slot I access the extension like this:</div><div><br></div><div><div> propertySheet = self.manager.extension(widget, 'org.qt-project.Qt.Designer.PropertySheet')</div><div> propertySheet = sip.cast(propertySheet, QtDesigner.QPyDesignerPropertySheetExtension)</div><div> index = propertySheet.indexOf('showMSecsTrailingZeros')</div><div> QtDesigner.QPyDesignerPropertySheetExtension.setProperty(propertySheet, index, False)<br></div><div> propertySheet.setVisible(index, False)</div></div><div><br></div><div><br></div><div>Unfortunally, it seems that there's a problem in the pyqt implementation, since property() and setProperty() do not behave as described in the documentation (accepting the index argument), and the setVisible() function does nothing at all.</div><div>As further confirmation of this, if I look in the help for QDesignerPropertySheetExtension.property(), the description is the same as any other QObject: property(self, str) -> any. I can see the same in PyQt 5.9 on windows.</div><div><br></div><div>I'd like to know if I'm doing something wrong (I'm pretty new to writing custom widgets) or if there is actually a bug.</div><div><br></div><div>Thank you,</div><div>Maurizio<br clear="all"><div><br></div>-- <br><div class="gmail_signature">È difficile avere una convinzione precisa quando si parla delle ragioni del cuore. - "Sostiene Pereira", Antonio Tabucchi<br><a href="http://www.jidesk.net" target="_blank">http://www.jidesk.net</a></div>
</div></div>