it show blank space in the drawtext() ,in the first it show a QString, and it also scale when the view scale.
the code
begin:
void QzCanvasTagItem
::paint(QPainter * painter
) {
drawText(Rect(), Qt::AlignLeft,_text);
}
void QzCanvasTagItem::paint(QPainter * painter)
{
drawText(Rect(), Qt::AlignLeft,_text);
}
To copy to clipboard, switch view to plain text mode
it show a rect with text
after:
{
painter->save();
w = widget->parentWidget();
QzCanvasView *v;
v = (QzCanvasView *)w;
//In there, I don't konw what to do
drawText(Rect(), Qt::AlignLeft,_text);
painter->restore();
}
void QzCanvasTagItem::paint(QPainter * painter,QWidget *widget)
{
painter->save();
QWidget *w;
w = widget->parentWidget();
QzCanvasView *v;
v = (QzCanvasView *)w;
//In there, I don't konw what to do
drawText(Rect(), Qt::AlignLeft,_text);
painter->restore();
}
To copy to clipboard, switch view to plain text mode
it show blank space ,the text disapper
and the Item also scale with view scale
Bookmarks