PDA

View Full Version : Making a Float, not Int slider with Qt Designer UI?


Horganovski
01-16-2011, 01:46 AM
I'm taking my first steps with Qt Designer and Maya here and so far it looks great.

One thing I can't figure out though - If I create a slider and hook it up to an attribute, say the radius of a sphere object, the slider only works in integers. No matter what flag I try to add in Qt Designer (-step, -stepSize etc) I always get the slider working in whole numbers.

Anyone have any ideas on how to make it work as a Float value?

Cheers,
Brian

Horganovski
01-16-2011, 10:31 PM
After some looking around I learned that Qt does not currently support Float sliders, so I used MEL to divide the slider output value by 100 and then fed that back into a text field beside the slider. So now the user changes the slider in whole numbers from 0 to 100 but the output reads 0 - 1, so even though the slider is still working in integers the user gets the impression they are dealing with floats. You can do the same thing in reverse too by having a procedure that gets called if the user types a value into the text field which then updates the slider accordingly.

It works fine, but a little tedious to set up, hopefully in the future Qt integration will be more complete and this will be simpler to do.

Cheers,
Brian

CGTalk Moderation
01-16-2011, 10:31 PM
This thread has been automatically closed as it remained inactive for 12 months. If you wish to continue the discussion, please create a new thread in the appropriate forum.