Quantcast
Channel: Daz Script Developer Discussion - Daz 3D Forums
Viewing all articles
Browse latest Browse all 1039

[half solved] Is it possible to "connect" widgets "incrementally created"?

$
0
0

I'm making a script which should allow me to change for instance some numeric values on specific nodes properties in a scene via an interface. Since the elements in the scene are never the same, with never the same count, the interface I create first reads the scene nodes and stores in an array the interesting properties of each interesting node (node index, name, label, classname, values of given properties, etc, etc).

Then I display all this using widgets which are parented to a main DzVGroupBox using a DzGridLayout in order to organise the widgets display.

The first step of the creation of the interface works perfectly, it is done by a loop on the first array I initially created when collecting nodes (the one gathering the key properties I want to act on).

The worry I have is when I have to "connect" the signals of the edition of the sliders and color widgets to the functions they are supposed to launch. I cannot have them working at all. Depending on the way I wrote the script, either the functions I connect were applied as soon as the script launches "even when there should be no "EditEnd()" signal emitted" - I guess it is because there was a () at the end of the function I call), or they were totally inefficient.

I tested two ways to create the "incremental" widgets:

- first way using an incremental name for the widgets (wDialName = "wDial"+k where k is the scene index increment, followed by wDialName  = new DzFloatSlider(wMainGroup).

 - and the second way using an Array including the widgets aWidget[k] = new DzFloatSlider(wMainGroup).

In both cases the widget creation, initialisation (to current value for nodes in the scene), and display in the interface works fine, but the connection fails. Yet there is no error or warning in the console. When I debug, I see no particular issue neither.

This is why I come here to ask the question, is it possible, when widgets are created with loops (or in arrays) method to "connect" them afterwards? Is there a special way to do that ? I also had a look at the QtScript documentation, but I did not found any page about this specific case. So either I have not found out yet how to do this, or it is not possible.

 


Viewing all articles
Browse latest Browse all 1039

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>