So a better workaround I just found is to write a custom action that sends the required data via a custom signal like this:

class CustomAction(QAction):
    customData = Signal(list)

    def __init__(self, icon, text, parent):
        super(CustomAction, self).__init__(icon, text, parent)
        self.myData = []
        self.triggered.connect(self.emitCustomSignal)

    def setCustomData(self, data):
        self.myData = data

    def emitCustomSignal(self):
        self.customData.emit(self.myData)


Seems to work as a band aid.

frank


On 3/03/16 9:59 pm, Frank Rueter | OHUfx wrote:

Hi guys,


I ran into this a while ago but since the host application I am using with my PySide apps was still using PySide 1.0.7 it wasn't a problem.
Now it's being switched to use PySide 1.2.2 and the bug is back in sight.

Below is a test snippet that shows how assigning a QStandardItem via QAction().setData() returns None when QAction().data() is called.

Is this a known bug?

I guess the work around is to send the data required to re-create the QStandardItem as a dictionary?!


http://pastebin.com/E9TCgEfJ


Cheers,
frank



--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation and consulting <http://ohufx.com/index.php/vfx-customising>* *



_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside

--
ohufxLogo 50x50 <http://www.ohufx.com> *vfx compositing <http://ohufx.com/index.php/vfx-compositing> | *workflow customisation and consulting <http://ohufx.com/index.php/vfx-customising>* *

_______________________________________________
PySide mailing list
[email protected]
http://lists.qt-project.org/mailman/listinfo/pyside

Reply via email to