You have to compensate for whatever decoration/primitive you want to be dynamic the same way I compensated for the axis title. If you have a legend, take it into consideration when calculating the extent.
You have to compensate for whatever decoration/primitive you want to be dynamic the same way I compensated for the axis title. If you have a legend, take it into consideration when calculating the extent.
Yes! I did that (even in the above diff); however, it is still off by 1 or 2. For some reason, the legend size that I get from p->legend ()->sizeHint () is not quite right. There is a margin or spacing of some sort, but trying to compensate for that similarly does seem to work. I keep thinking sizeHint isn't the right way to go about this, but I don't see other alternatives.
sizeHint() is probably ok but there is certainly some spacing involved. Look into Qwt source code to see how to calculate everything.
Bookmarks