Re: [Qutecsound-users] setWidgetsText // setWidgetProperty

classic Classic list List threaded Threaded
1 message Options
Reply | Threaded
Open this post in threaded view
|

Re: [Qutecsound-users] setWidgetsText // setWidgetProperty

tarmoj
Hello,

> >
> Ah! I remember now... I don't use this feature and it's not really
> documented...
> 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)

QuteWidget::createPropertiesDialog()---Dynamic Properties:
 ("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.

greetings,
tarmo

>
> 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.
>
> Cheers,
> Andrés
>
-------
older posts:

> Re: setWidgetsText // setWidgetProperty
> From:
> Tarmo Johannes <[hidden email]>
>   To:
> Andres Cabrera <[hidden email]>
>   Date:
> Today 15:30:44
>    
> Hello,
>
> 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
> q.setWidgetProperty("decay","x",300)
>
> The only porperty that has some effect is <visible>
> q.setWidgetProperty("decay","visible","false")
>
>
> 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:
> q.getWidgetProperty("slider1","x")
> 5
>  but
> q.getWidgetProperty("slider1","maximum")
> nothing
> 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,
> tarmo
>
>
>
>
>
> 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


------------------------------------------------------------------------------
Try before you buy = See our experts in action!
The most comprehensive online learning library for Microsoft developers
is just $99.99! Visual Studio, SharePoint, SQL - plus HTML5, CSS3, MVC3,
Metro Style Apps, more. Free future releases when you subscribe now!
http://p.sf.net/sfu/learndevnow-dev2
_______________________________________________
Qutecsound-users mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/qutecsound-users