Hi! I'm new to Qt + QCustomPlot and need some advice for how to approach a particular problem.

I have a plot where I need to mark the axis with labels at certain points, very similar to the AxisTag example (https://www.qcustomplot.com/index.php/tutorials/specialcases/axistags), and have made my own tag class following the example. My problem is that I have many tags (essentially QCPItemText objects) that sometimes overlap each other, and therefore I'd like to shift the tag in some direction when that happens. I don't know beforehand where my tags are on the axis or how many I have, that depends on the data I'm plotting. Thankfully the tags are static, so I should be able to decide when creating the tag if it needs shifting or not, based on where other tags are already placed.

I have tried to create QRectF's based on the tag's dimensions so I can check for collision and shift the tag when needed, but I am having trouble with getting the right dimensions from the QCPItemText label and it only works well for the starting zoom level anyways. I could maybe try to reshift everything when replotting, but it feels like a difficult task for a newbie since replotting is done automatically when zooming. It feels like there could be an easier approach using widgets and layouts, but I'm not sure.

Any ideas?