PDA

View Full Version : Multiple sliders for drawing



Misko
16th August 2007, 11:34
Hi,

I want to connect multiple sliders to drawing different things.
Since I can only have 1 paintEvent-function, i'll have to do something with the event-pointer, i guess, like in:
void SomeClass::paintEvent(QPaintEvent *e)
and then like in Java using something like: if (e.getSource() == sldValue1) ...
But I don't know the QT-equivalence...:o
If you know a different way to do this, also welcome to mention...

Thx in Advance!
Misko

wysota
16th August 2007, 15:21
I think you're doing something wrong here... paintEvent is called on each object when it needs to be repainted. If you have different objects which you want to be painted differently either make them separate classes and provide different paintEvent implementations or make a property that will hold some state which will cause the painting routine to behave differently (like "orientation" property of QAbstractSlider).