Hey Arvid,

It sounds like you’ve got the gist of it. You’ll need to listen for both
DragEnterEvent, to determine whether or not to accept the event, and
DropEvent to decide what to do with it in case it gets accepted. Some
widget will be more difficult to install such an event filter in than
others; most prominently the main viewport. I’d probably try installing it
onto the main application first, (PySide.QtGui.qApp) and go from there.

If you haven’t already had a look at this, I’d suggest taking a moment to
read it through.

   - https://doc.qt.io/qt-4.8/dnd.html (Dungeons & Dragons.html?)

​

On 4 April 2016 at 16:11, Arvid Schneider <[email protected]> wrote:

> Hello, me again with Qt stuff..
>
> So I have a QListWidget with lots of thumbnails of textures, hdrs, assets
> etc etc.
>
>
> <https://lh3.googleusercontent.com/-d2gGZcBFCIg/VwKDxU-gwnI/AAAAAAAAI-A/o8H9nbGyKsoIM9VQQj9WrgQU2nJ0UKiNQ/s1600/Screenshot%2Bfrom%2B2016-04-04%2B16%253A09%253A48.png>
> I want to be able to drop this thumbnail into any QApplication ( for now
> Maya) and then I can call certain functions to create image nodes, lights,
> etc etc.
> I read about MimeData, and I read about eventFilter and install
> eventFilter. But I have no idea on how to get it to work, so Maya accepts
> drops and registers them. So I can call my functions.
> Any help as always appreciated.
>
>
>
>
>
>
>
> Arvid
>
> --
> You received this message because you are subscribed to the Google Groups
> "Python Programming for Autodesk Maya" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> To view this discussion on the web visit
> https://groups.google.com/d/msgid/python_inside_maya/fd8bcc5a-7e01-4e03-bb55-e3ddf0d15c15%40googlegroups.com
> <https://groups.google.com/d/msgid/python_inside_maya/fd8bcc5a-7e01-4e03-bb55-e3ddf0d15c15%40googlegroups.com?utm_medium=email&utm_source=footer>
> .
> For more options, visit https://groups.google.com/d/optout.
>



-- 
*Marcus Ottosson*
[email protected]

-- 
You received this message because you are subscribed to the Google Groups 
"Python Programming for Autodesk Maya" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To view this discussion on the web visit 
https://groups.google.com/d/msgid/python_inside_maya/CAFRtmOB1zyzW94FmnsTE-c5GBgF%2B1ePYdKfZUe6EJGAU6%3DPUHw%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.

Reply via email to