Re: Image as a background
Yes.
To do what you described, you will have to override the paintEvent() and set your tile image as brush.
See QBrush for more details.
Re: Image as a background
Quote:
Originally Posted by
high_flyer
To do what you described, you will have to override the paintEvent() [...]
Ok. I see.
So I've got one more favour to ask - many times I hear about overriding some functions, but i can't find any nice example how to do it right way. Maybe someone got some link or piece of code how to override and then use that overrided functions of widgets?
thanks in advance
best regards
Tomasz
Re: Image as a background
I am not sure I follow.
When you override a method you do it because you want to add your own functionality to it - so how can someone else give you an example for that?
You do know what overriding a method is , right?
But I probably just don't understand your question.
Re: Image as a background
I know what override is in theory. When I override paintEvent() then I should write my own painting event (including painting text etc...), right? Or maybe I've got all standard painting inherited from original paintEvent()? I just want to see some example how can I do it on widget. It could be any similar example, and I think then I will be able to do it myself.
thanks in advance
best regards
Tomasz
Re: Image as a background
This is out side of the scope of this forum, since this is basic C++ issue.
In short however, if you call the paintEvent of the mother class(in your case it would be QPushButton::paintEvent()), then you have its functionality too.
But please don't ask basic C++ questions in these forums, as they are meant for specific help with Qt related issue, where C++ (or what ever language you are using with your Qt) knowledge is assumed.