PDA

View Full Version : QSlider with double Heads..



moizahamedv
18th March 2006, 10:51
hi,

I need a Qslider with double headed......can any one please guide me how to do that.....



Thanks in advance

jamadagni
18th March 2006, 15:23
I need a Qslider with double headed......can any one please guide me how to do that.....Thanks in advance
Reimplement the code from qt-x11-opensource-src-4.1.1/src/gui/widgets/qslider.* or I think more likely src/gui/styles/qstyle.*

jacek
18th March 2006, 17:07
What do you mean by "QSlider with double heads"?

Did you try this?
slider->setTickPosition( QSlider::TicksBothSides );

high_flyer
19th March 2006, 17:54
I think he means a slider with an interval - like with min and max heads.

georgie
9th May 2006, 07:51
Reimplement the code from qt-x11-opensource-src-4.1.1/src/gui/widgets/qslider.* or I think more likely src/gui/styles/qstyle.*

When you say reimplement those files, most of the functionality of the qslider is actually contained in qabstractslider, but when I am trying to understand these files, there are two macros which are kind of confusing me

Q_Q(QAbstractSlider) seems to give access to some member q, and likewise Q_D(QAbstractSlider) makes some member d available

what do these macros mean? are they important for what I am doing? because I am struggling to understand how the heads on the slider are actually implemented and I think that they may hold some of the information

thanks
georgie

jacek
9th May 2006, 15:28
Q_Q(QAbstractSlider) seems to give access to some member q, and likewise Q_D(QAbstractSlider) makes some member d available

what do these macros mean?

#define Q_D(Class) Class##Private * const d = d_func()
#define Q_Q(Class) Class * const q = q_func()
Q_D macro declares a variable that points to the private part of the implementation, while Q_Q works the other way around --- gives you access to public part of the implementation.

If you want to know why the implementation is split into public and private part, ask google about "pimpl".