Reputation: 393
I created a subclass of QToolBar to make a context tool bar associate with QGraphicsItem.
What I want to add is a small triangle point to where my toolbar popped up. I know that QPainter can't draw outside the QToolBar. But is there a way to draw from pic 1 to pic 2
Sorry. My pics are awful. But you could understand.
Upvotes: 0
Views: 599
Reputation: 35408
Maybe you should create a new widget (or a tiny frameless, borderless window), with only the small triangle and put it at the required position (ie: the x coordinate should be the mouseX - width_of_window/2 and the Y coordinate should be mouseX - height_of_window).
Make sure the widget (windows) is hidden when the scrollbar is not shown, and show it at the calculated global coordinates on a mouse action.
Upvotes: 3