Hi!
I'd like to create an item group for a QGraphicsScene with this function:
QGraphicsItemGroup * QGraphicsScene::createItemGroup ( const QList<QGraphicsItem *> & items )
However, I don't know how to create a variable of type QList<QGraphicsItem*>. I even can't find the class:
* (qt:qapropos "QList") ; No debug variables for current frame: using EVAL instead of EVAL-IN-FRAME. Class QListView Class QListWidget Class QListWidgetItem Method QListView::QListView [7272] Method QListView::QListView [7342] Method QListView::~QListView [7356] Method QListWidget::QListWidget [7364] Method QListWidget::QListWidget [7422] Method QListWidget::~QListWidget [7426] Method QListWidgetItem::QListWidgetItem [7427] Method QListWidgetItem::QListWidgetItem [7428] Method QListWidgetItem::QListWidgetItem [7429] Method QListWidgetItem::QListWidgetItem [7430] Method QListWidgetItem::QListWidgetItem [7472] Method QListWidgetItem::QListWidgetItem [7473] Method QListWidgetItem::QListWidgetItem [7474] Method QListWidgetItem::QListWidgetItem [7475] Method QListWidgetItem::QListWidgetItem [7476] Method QListWidgetItem::QListWidgetItem [7477] Method QListWidgetItem::~QListWidgetItem [7480]
I tried to call canvas's items() and see what's inside. Then I see
(#<QGraphicsItem 0x01FEB0B8> #<QGraphicsItem 0x01FEABB8>)
That's the two items I created, before calling items(). So I see CommonQt does some magic to convert QList to a lisp list.
Then I tried to pass nil (here I mean empty list, not false) to createItemGroup, but I got the following: The value NIL is not of type SYSTEM-AREA-POINTER. I think that's because nil is not like a "C pointer", but I know almost nothing about CFFI or other low-level stuffs, so I'm stuck now.
- Rujia
Rujia Liu rujia.liu@gmail.com writes:
Hi!
I'd like to create an item group for a QGraphicsScene with this function:
QGraphicsItemGroup * QGraphicsScene::createItemGroup ( const QList<QGraphicsItem *> & items )
However, I don't know how to create a variable of type QList<QGraphicsItem*>. I even can't find the class:
- (qt:qapropos "QList")
; No debug variables for current frame: using EVAL instead of EVAL-IN-FRAME. Class QListView Class QListWidget Class QListWidgetItem Method QListView::QListView [7272] Method QListView::QListView [7342] Method QListView::~QListView [7356] Method QListWidget::QListWidget [7364] Method QListWidget::QListWidget [7422] Method QListWidget::~QListWidget [7426] Method QListWidgetItem::QListWidgetItem [7427] Method QListWidgetItem::QListWidgetItem [7428] Method QListWidgetItem::QListWidgetItem [7429] Method QListWidgetItem::QListWidgetItem [7430] Method QListWidgetItem::QListWidgetItem [7472] Method QListWidgetItem::QListWidgetItem [7473] Method QListWidgetItem::QListWidgetItem [7474] Method QListWidgetItem::QListWidgetItem [7475] Method QListWidgetItem::QListWidgetItem [7476] Method QListWidgetItem::QListWidgetItem [7477] Method QListWidgetItem::~QListWidgetItem [7480]
I tried to call canvas's items() and see what's inside. Then I see
(#<QGraphicsItem 0x01FEB0B8> #<QGraphicsItem 0x01FEABB8>)
That's the two items I created, before calling items(). So I see CommonQt does some magic to convert QList to a lisp list.
Then I tried to pass nil (here I mean empty list, not false) to createItemGroup, but I got the following: The value NIL is not of type SYSTEM-AREA-POINTER. I think that's because nil is not like a "C pointer", but I know almost nothing about CFFI or other low-level stuffs, so I'm stuck now.
There's something strange going on, I added a QList<QGraphicsItem*> marshaller, but when i try to use it with #_createItemGroup, it crashes hard with free(): invalid pointer: 0x00007ffff4375350.
You're probably better off for now with explicit item group functions, like (#_addToGroup QGraphicsItemGroup item)
On Thu, Sep 12, 2013 at 10:18 PM, Stas Boukarev stassats@gmail.com wrote:
There's something strange going on, I added a QList<QGraphicsItem*> marshaller, but when i try to use it with #_createItemGroup, it crashes hard with free(): invalid pointer: 0x00007ffff4375350.
You're probably better off for now with explicit item group functions, like (#_addToGroup QGraphicsItemGroup item)
I used a manually managed group instead :) Until now, nothing has prevented me from implementing what I need. I just posted some issues I found during developement.
- Rujia
commonqt-devel@common-lisp.net