anafor2004
25th September 2009, 09:02
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);
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.
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);
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.