Dear All , I have created a CustomLabel class which is based QLabel, then I added this label to QGraphicsView via QGraphicsProxyWidget.
CustomLabel *imageItem = new CustomLabel();
imageItem->setSelectionStatus(true);
imageItem->setImagePath("/home/can/workspace/DenemeGraphic/media/home.png");
QGraphicsProxyWidget *pCImageProxyWidgetInstance = new QGraphicsProxyWidget(0, Qt::Window);
pCImageProxyWidgetInstance->setWidget(imageItem);
pCImageProxyWidgetInstance
->setCacheMode
( QGraphicsItem::NoCache );
pCImageProxyWidgetInstance->setPos(100,100);
scene->addItem(pCImageProxyWidgetInstance);
CustomLabel *imageItem = new CustomLabel();
imageItem->setSelectionStatus(true);
imageItem->setImagePath("/home/can/workspace/DenemeGraphic/media/home.png");
QGraphicsProxyWidget *pCImageProxyWidgetInstance = new QGraphicsProxyWidget(0, Qt::Window);
pCImageProxyWidgetInstance->setWidget(imageItem);
pCImageProxyWidgetInstance->setCacheMode ( QGraphicsItem::NoCache );
pCImageProxyWidgetInstance->setPos(100,100);
scene->addItem(pCImageProxyWidgetInstance);
To copy to clipboard, switch view to plain text mode
In CustomLabel I writed a paintEvent(QPaintEvent *pe) function, the problem is , always it is refreshing , There is a printf() in painEvent and it is continiously printing string.
Bookmarks