PDA

View Full Version : where is propertyChanged() ?



larry.liu.china
14th May 2010, 11:23
Hi!
In the Qt Creator, when i change a value of Property Editor ,the PropertyEditor(class) will emit propertyValueChanged, and the class of QDesignerIntegration has a slot, that is
connect(designerPropertyEditor, SIGNAL(propertyValueChanged(QString,QVariant,bool) ), this, SLOT(updateProperty(QString,QVariant,bool)));
and then ,the updateProperty() will emit propertyChanged(), that is

signals:
void propertyChanged(QDesignerFormWindowInterface *formWindow, const QString &name, const QVariant &value);

problem: i can not find a slot which accepts the propertyChanged ?

wysota
14th May 2010, 11:46
The signal is for your own plugins so that they can react on changes in properties by implementing slots accepting this signature.

larry.liu.china
15th May 2010, 03:07
The signal is for your own plugins so that they can react on changes in properties by implementing slots accepting this signature.

Thanks,wysota!
But the codes i said are the source codes of Qt, not mine. I just want to know how realizes the propertyChanged() for a QWidget in the Qt's source codes, for example the QPushButton.

wysota
15th May 2010, 03:30
I don't understand what you mean. QWidget doesn't have such signal. This signal, as I said, is specifically for Qt Designer plugins implementing things such as Designer's property editor extensions. You can't use this signal in regular Qt applications.

larry.liu.china
15th May 2010, 05:32
I don't understand what you mean. QWidget doesn't have such signal. This signal, as I said, is specifically for Qt Designer plugins implementing things such as Designer's property editor extensions. You can't use this signal in regular Qt applications.
yeah, you are right.
you know ,when i change a property's value of a Widget in the right of the Qt Creator, the PropertyEditor will emit the perprotyChanged, i just want to know, who has a slot accepting the signal.

wysota
15th May 2010, 10:02
I already told you that twice. If you still are not convinced I'm right, grep Qt sources for the signature and see what (if anything) implements a slot with such a signature.

larry.liu.china
17th May 2010, 03:02
Anyway,Thanks a lots.
I know! You mean that this signal is just for the Qt Designer plugins.
And if i select a QWidget(for example QPushButton, who belong to Qt, not a plugins) in the UI designer of Qt Creator, and then, i chang a value of the QWidget in its PropertyEditor where is in the lower right corner of the Qt Creator.What's happen now? Who to respond to this change?
Once again, thank you!

wysota
17th May 2010, 08:39
Do you really want me to say this for the third time? You can write a Deisgner plugin that will do something when a property of a particular widget changes its value.