Luc4
12th March 2010, 11:40
Hi! I'm trying to create a custom scrollbar. I subclassed QScrollBar and I overwrote the paint method. Seems to work quite ok, but I'm not able to make the cursor move correctly. I placed an ellipse this way:
painter.drawEllipse(0, this->height()*this->value()/(this->maximum() - this->minimum()) + 30,
this->width(), this->width());
for a vertical scrollbar. Unfortunately, seems not to scroll correctly according to the content of my area. Any other way?
Thanks!
painter.drawEllipse(0, this->height()*this->value()/(this->maximum() - this->minimum()) + 30,
this->width(), this->width());
for a vertical scrollbar. Unfortunately, seems not to scroll correctly according to the content of my area. Any other way?
Thanks!