From: Tarmo Johannes <tarmo@ot...> - 2012-02-06 17:13:29
> Ah! I remember now... I don't use this feature and it's not really
> The thing is that you must prepend "QCS_" to the property name. Things
> should work then. However, if I remember correctly there are still some
> threading issues, and CsoundQt may crash when you change the properties.
> I'm very interested in knowing how things work for you.
All right, that was it!
I have seen in the console output (every time the properties dialog is opened)
("QCS_x", "QCS_y", "QCS_uuid", "QCS_visible", "QCS_midichan", "QCS_midicc", "QCS_minimum", "QCS_maximum", "QCS_value", "QCS_mode", "QCS_mouseControl", "QCS_mouseControlAct", "QCS_resolution", "QCS_randomizable", "QCS_randomizableGroup", "QCS_objectName", "QCS_width", "QCS_height")
At the first attempt now setWidgetProperties worked very well (with a slider), no crashes.
The only thing, if to change "QCS_x" or "QCS_y", the widget disappears, perhaps there should be some redraw function somewhere.
I will test it more thouroghly later and will let you know. And I try to help with preparing with the documentation.
As I said before, I feel, it is an important side of CsoundQt and would be nice to make it usable for everybody.
> The thing is I am using the property system of Qt to store this
> information, and I think it's not thread safe. So I probably need to add
> some locking somewhere.
> Re: setWidgetsText // setWidgetProperty
> Tarmo Johannes <tarmo.johannes@...>
> Andres Cabrera <mantaraya36@...>
> Today 15:30:44
> I can report that SetWidgetsText works flawlessly - that's very nice!
> I tried to find out why setWidgetProperty does not function but could not. It
> would be very useful to have it to fine tune any of the properties after
> creating a widget from script or python interpreter.
> In short - if you set a property, nothing changes. Like
> The only porperty that has some effect is <visible>
> I compiled PythonQt and CsoundQt with debug option and tried to understand
> what is going on in the WidgetLayout::setWidgetProperty method
> The furtherst where I could step into was
> bool setProperty(const char *name, const QVariant &value); in qobject.h
> but it did not go on further into qobject.cpp to see what is the
> QObject::setProperty really doing
> I am sure you have a good overview about it and can track down the issue.
> Another strange thing: using getWidgetProperty sometimes works, sometimes not.
> with a slider I got results:
> and so its with most of the properties
> seting a breakpoint in CsoundQt::getWidgetProperty
> shows that in the first case
> the value of
> value = documentPages[index]->getWidgetProperty(channel, property);
> gets assigned -
> value 5 QVariant(int)
> and in second case not:
> value (invalid) QVariant(invalid)
> like some of the properties would not have been declared or cannot be reached.
> Hope it turns useful - I belive that getting the widget creation and control
> work adds very much to the flexibilty of CsoundQt as a user interface of a
> csound piece.
> best greetings,
> On Thursday 02 February 2012 21:16:03 you wrote:
> > Hi Tarmo,
> > Just wanted to let you know setWidgetsText has now been implemented. I
> > haven't tested it, but if you can please try it.
> > Cheers,
> > Andrés