Confirm possible bug in DzListViewItem.pixmap() ?

I have a case where I'm making deep copies of several DzListViewItem,  and all the property methods I call from the donor to pass to the recipient give the expected return type, and everything works fine.

But when I call the donor's pixmap() method, I appear not to get a Pixmap as expected, but a native Q type instead. The process stops with the error:

TypeError: cannot call pixmap(): unknown return type `const QPixmap*' (register the type with qScriptRegisterMetaType())

Can anyone verify that this is either a bug, or PEBKAC, before I file a bug report? It appears this one member isn't wrapped.

If it is PEBKAC, can someone point out why I shouldn't be able to do

wRecipientItem.setPixmap(1, wDonorItem.pixmap(1));

It can't even be assigned to a simple variable. I'm passing all the other donor members I need this way, and it's groovy.

I do have a work-around, but it involves reading the text on the column to decide which icon to fetch, and use setPixmap()on the recipient to finish the duplication. That work was already done once building the donor; I hate using two stoves to cook one meal...

Thanks in advance!

Comments

  • Richard HaseltineRichard Haseltine Posts: 96,191
    edited September 2021

    Unfortunately the script engine is correct, this was an error in the documentation - QPixmap* is not a type of object available to scripts. The documentation has been corrected.

    Edited because I read QPixmap* as QPixmap, it is specifically the * (pointer, I think) that is not compatible.

    Post edited by Richard Haseltine on
  • Ok then, thanks for that info, and I see the doc has been amended with pixmap() redacted.

    So then, there is no proper way to fetch the pixmap of a DzListview item, or is there a "trick" that one could use?

  • As I understand it there is currently no method to do this.

Sign In or Register to comment.