Hi,
I have a QImage inside a QScrollArea in my QMainWindow.
Now that the classes have been mentioned, let me tell you the actual story. I'm custom drawing something that I want to display in a window. I'm using a QImage for this, because I will need pixel level access. I've put this QImage inside a scroll area so that if the picture Im drawing is larger than the window (or even the screen), the whole thing can still be viewed by scrolling. This works.
The problem is that when you resize the window to be *larger* than the image I'm drawing, it fills everything outside my QImage with the standard grey background.
After some messing around figuring out what background I was actually seeing, I ended up setting a new background colour for my QMainWindow, as follows:
Qt Code:
this->setPalette( p );To copy to clipboard, switch view to plain text mode
This works.. in a way.. The problem is that it's not just using this colour as the background for the window, but also as the status bar colour, the scrollbars are tinted with it, and the corner of the scrollbars is filled with the colour. All in all, not a very nice look.
Is there any way I can paint *just* the background of my window?
Thanks for any pointers you can give me..
I've attached a screenshot with clearly distinguishable colours. Black is the QImage and blue the window background.
Regards,
kw
Bookmarks