I would subclass QAbstractScrollArea and implement everything as a single custom widget. Placing a QLabel in a QScrollArea will cause you problems sooner or later.
I would subclass QAbstractScrollArea and implement everything as a single custom widget. Placing a QLabel in a QScrollArea will cause you problems sooner or later.
The problem is that I'm using a Designer form. How would I put my own widget right in the middle of a layout?
MTK358 (18th September 2010)
The Promote feature is great! I didn't know about it.
But OK, I created a custom widget containing the scroll area, label, and zoom controls, but it still has the same issues. It just behaves very strangely and so inconsistently that I can't really even explain it.
I told you to subclass QAbstractScrollArea and implement the functionality from scratch, not to use a custom widget composed of a scroll area and a label. You will have to get your hands dirty here.
OK, I looked but I don't understand what methods to reimplement and how to paint to the viewport.
OK, but how do I get a QPainter for the viewport widget?
Finally, I did it.
Anyway, it works great now, but I would really like it so that the user can scroll by dragging the mouse in the viewport. How would I do that?
You're gradually reinventing QGraphicsView here. Just use that; you get all of the features you've brought up so far for free.
Bookmarks