
Originally Posted by
Uwe
PS: QwtPicker::trackerRect is changed to virtual in SVN trunk
thank you! when I have time, I'll convert my application to Qwt 6 
I tried to move the resulting rect - but now the Label is disappeared completely.
void YourPicker
::drawTracker( QPainter *painter
) const {
QRect textRect
= trackerRect
( painter
->font
() );
// removed "const" textRect.
moveTopLeft(QPoint(100,
100));
// new line if ( !textRect.isEmpty() )
{
QwtText label
= trackerText
( trackerPosition
() );
if ( !label.isEmpty() )
label.draw( painter, textRect );
}
}
void YourPicker::drawTracker( QPainter *painter ) const
{
QRect textRect = trackerRect( painter->font() ); // removed "const"
textRect.moveTopLeft(QPoint(100,100)); // new line
if ( !textRect.isEmpty() )
{
QwtText label = trackerText( trackerPosition() );
if ( !label.isEmpty() )
label.draw( painter, textRect );
}
}
To copy to clipboard, switch view to plain text mode
The reason I'm doing this is: In my plot I have a scrollzoomer with scrollbars set to "AlwaysOn" and "AttachedToScales" (they are attached to xTop and yRight). When I move the mouse close to one of the scrollbars, the trackertext is painted on the scrollbar (this does not happen if scrollbar is "AsNeeded" - in this case the trackertext is painted "under" the scrollbar, so it is not visible). When you now move the mouse parallel to the scrollbar, parts of the old trackertext label remain where they were. unfortunately I can't make a screenshot - when I press a button, the scrollbar gets repainted.
Bookmarks