As I mentioned in previous page we need to connect some of the controls to others for having access by MEL. For this, you need to connect them by hand. QT is not like MEL. in MEL you can assign a string text from one control to an integer variable as long as that text contains just numbers but, in QT it's not possible.
Now hit "F4" to go to "edit signals/Slots" mode (or you can choose it under edit menu). In this mode you can't move controllers around but you can connect them with each other with similar attributes. Now select the spin box and drag it to line edit. As you can see a red line will appear with an arrow at the end. In picture below I dragged dial control to spin box (if you want to use dial control you can't connect it to double spin box because double spin box will receive just double values and dial will send integers so you need to connect it to spin box.)

Now a new window will pop up. Pay attension that i checked "show signals and slots inherited from QWidget". Keep this setting on because some of the attributes will be hidden by normal settings (like setVisible).

The left hand list is your driver list and the right hand one is your driven. Now select valueChanged(int) from left list and setValue(int) from right side and hit OK. Now drag spin box over line edit and select valueChanged(QString) from left and setText(Qstring) from right. As you see spin box can output bot QString and int values (the attribute below in list) so if you want to connect a spin box to a slider you should choose the one that has int in it's name. Now hit OK. Now hit "F3" to go back to design mode.
The next thing we need to do is to give our push button and horizontal slider action in Maya. Select push button and in property editor (right side bar of QT designer) hit the plus button and select string from menu. In the opened window type -c (as you remember it's a flag for button command of maya, you can add as many flags as you need like this.)


Now you have a dynamic attribute and you can type anything in it. Now qnother line edit at left side of the slider. in property editor change the objectName to slider_view. Change it's enabled attribute and uncheck it. Now select the horizontal slider and add a dynamic attribute. Type -dc (for dragCommand flag of inSlider). Now move down the list to see your attribute and type "textField -e -tx #1 slider_view" (with " marks!). the #1 in this command will return the value of the same controller (slider in this case).
Now save the project from file menu in your script folder of maya as test.ui . In next page we will import this UI in Maya.
Now hit "F4" to go to "edit signals/Slots" mode (or you can choose it under edit menu). In this mode you can't move controllers around but you can connect them with each other with similar attributes. Now select the spin box and drag it to line edit. As you can see a red line will appear with an arrow at the end. In picture below I dragged dial control to spin box (if you want to use dial control you can't connect it to double spin box because double spin box will receive just double values and dial will send integers so you need to connect it to spin box.)

Now a new window will pop up. Pay attension that i checked "show signals and slots inherited from QWidget". Keep this setting on because some of the attributes will be hidden by normal settings (like setVisible).

The left hand list is your driver list and the right hand one is your driven. Now select valueChanged(int) from left list and setValue(int) from right side and hit OK. Now drag spin box over line edit and select valueChanged(QString) from left and setText(Qstring) from right. As you see spin box can output bot QString and int values (the attribute below in list) so if you want to connect a spin box to a slider you should choose the one that has int in it's name. Now hit OK. Now hit "F3" to go back to design mode.
The next thing we need to do is to give our push button and horizontal slider action in Maya. Select push button and in property editor (right side bar of QT designer) hit the plus button and select string from menu. In the opened window type -c (as you remember it's a flag for button command of maya, you can add as many flags as you need like this.)


Now you have a dynamic attribute and you can type anything in it. Now qnother line edit at left side of the slider. in property editor change the objectName to slider_view. Change it's enabled attribute and uncheck it. Now select the horizontal slider and add a dynamic attribute. Type -dc (for dragCommand flag of inSlider). Now move down the list to see your attribute and type "textField -e -tx #1 slider_view" (with " marks!). the #1 in this command will return the value of the same controller (slider in this case).
Now save the project from file menu in your script folder of maya as test.ui . In next page we will import this UI in Maya.
Author: css_maya
Submitted: 2010-05-04 13:15:19 UTC
Tags:
Software: Maya
Views: 87,712
Related Items
-
designer stool with sculpted seat 3D Model
$24.99 (USD) -
Designer Italian Armchair 3D Model
$29.00 (USD) -
iPod MP3 player collection for Maya 3D Model
$49.00 (USD) -
aXYZ design - AMan0001-Wa / 3D Human for superior visualizations 3D Model
$18.00 (USD) -
aXYZ design - AMan0001-Wa2 / 3D Human for superior visualizations 3D Model
$18.00 (USD) -
aXYZ design - AMan0002-St / 3D Human for superior visualizations 3D Model
$18.00 (USD) -
aXYZ design - AMan0002-Wa / 3D Human for superior visualizations 3D Model
$18.00 (USD) -
aXYZ design - AMan0003-St / 3D Human for superior visualizations 3D Model
$18.00 (USD) -
aXYZ design - AMan0003-St2 / 3D Human for superior visualizations 3D Model
$18.00 (USD)









