That looks fairly ok (other than then obvious unnecessary save/restore).
So you have two instances of that label?
In a layout?
With different data?
Cheers,
_
That looks fairly ok (other than then obvious unnecessary save/restore).
So you have two instances of that label?
In a layout?
With different data?
Cheers,
_
Yes, two instances of the label. I also tried to use two different classes instead of instancing. Same result.
I added them to the same layout. The data is different. But it seems that the paint event from "label1" is also applied on "label2". I try to provide the whole code in a simplified way so you can understand the problem better. Maybe it is something very simple.
I attached a simple project.
The window shows 2 large labels in white. Try painting on the first one. It will also paint onto the lower one.
I guess that the problem here is that paintEvent will be triggered for every label. But it is strange that it also paints inside the 2nd label. When I paint onto the 2nd label nothing happens.
ImageManipulate2.zip
So you have two labels that draw the same data and you are surprised that they look identical?
Cheers,
_
I found my mistake by trying it with another approach (promoting a custom class via the gui). I put all the globals into the custom label class and now every label has its own values. Damn i forgot about the the attributes of an objects.![]()
You know, I asked you if the two instances had different data.
A reasonable approach would have been to check that before answering yes despite the facts pointing to the opposite.
Cheers,
_
I thought they were different. At least I thought that the MousePos were Screen Positions. Because the coordinates are based on the widget coordinates they are also appearing in the 2nd widget.
And in my last reply I already said that I did a mistake.
Bookmarks