[Qt-interest] Problems with moving items around on QGraphicsView/scene

Mic J michael.cognacc at gmail.com
Thu Apr 28 22:24:56 CEST 2011


On Thu, Apr 28, 2011 at 2:39 PM, Jason H <scorp1us at yahoo.com> wrote:
> All you had to do was set the item flags for interacting with the mouse. By
> default they don't.
>
>

I have these flags set
CanvasItem::CanvasItem() //(QGraphicsRectItem(*parent = 0) :
   //QGraphicsRectItem(parent)
{
   setFlags( ItemIsSelectable | ItemIsMovable | ItemIsFocusable);
   boundingRect();
}

Is that what you mean?
Do i need something in the display widget (Canvas class)?


By the way later i added

setFlag(QGraphicsItem::ItemSendsGeometryChanges, true);

I see examples where the flags are prepended with QGraphicsItem:, when
should i choose one or the other.
(i also tried it out).

michael



More information about the Qt-interest-old mailing list