Anyone had a QtSlider to display correctly?

No matter how I lay it out (in a vertical or horizontal layout, with or without ticks) all I see in the display is two small vertical bars, one black, one grey.

I don't see anything remotely resembling a slider. I can move the 'slider' and see the value change, but a user will never figure it out. There is no slider track and no clider button.

Does anyone have an example of how to create a proper horizontal slider?

Thanks,
David

Comments

  • surrealsurreal Posts: 155

    When I was playing with it in early 2015, I found it was too much work to get the QSlider to work well with the Daz gui and reverted back to using the Daz versions (DzIntSlider or DzFloatSlider).

     

    Unfortunately code sample for DzIntSlider is of no help for QSlider.

    #include "dzintslider.h"...	DzIntSlider*	m_sliderTest;...	m_sliderTest = new DzIntSlider( this );	m_sliderTest->setMinimumHeight( 60 );	m_sliderTest->setMinimumWidth( 60 );	m_sliderTest->setMinMax(-100, 100);	m_sliderTest->setClamped(true);	// True = slide can move left and right, False = slide stays at center 	m_sliderTest->setCaption( "sliderTest" );	mainLyt->addWidget( m_sliderTest );	// Listen for the edit finished signal from the slider	connect( m_sliderTest, SIGNAL(editEnd()), this, SLOT(mySliderEditEndFunction()) );

     

  • Thanks!

    I will try those. I gave up on the QSlider and am currently using a QScrollBar which gives a good gui for testing.

  • TotteTotte Posts: 13,498

    This thread saved me hours of headache, thanks!

     

Sign In or Register to comment.