# Drag and drop in custom application does not work

**URL:** https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172
**Category:** Development
**Created:** [September 9, 2025, 12:19pm UTC](https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172 "2025-09-09T12:19:08Z")
**Posts on this page:** 7
**Page:** 1

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/csatizoltan/32/6997_2.png) [@CsatiZoltan](https://discourse.paraview.org/u/CsatiZoltan)
#### Post date: [September 9, 2025, 12:19pm UTC](https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172/1 "2025-09-09T12:19:08Z")

</div>

Hi,

I built ParaView from the master branch, then used this ParaView to build the _SimpleParaView_ example application. Drag & drop a file to the render window works in ParaView that I built, but not in the custom application. Was drag & drop deactivated on purpose in the _SimpleParaViewI_?

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 9, 2025, 3:06pm UTC](https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172/2 "2025-09-09T15:06:00Z")

</div>

In `ParaView/ParaViewMainWindow.cxx ` there is this code:

```auto
//-----------------------------------------------------------------------------
void ParaViewMainWindow::dragEnterEvent(QDragEnterEvent* evt)
{
  pqApplicationCore::instance()->getMainWindowEventManager()->dragEnterEvent(evt);
}

//-----------------------------------------------------------------------------
void ParaViewMainWindow::dropEvent(QDropEvent* evt)
{
  pqApplicationCore::instance()->getMainWindowEventManager()->dropEvent(evt);
}

```

And also the following in `ParaView/ParaViewMainWindow.ui`

```auto
  <property name="acceptDrops">
   <bool>true</bool>
  </property>

```

Which is not present in SimpleParaView

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/csatizoltan/32/6997_2.png) [@CsatiZoltan](https://discourse.paraview.org/u/CsatiZoltan)
#### Post date: [September 9, 2025, 3:39pm UTC](https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172/3 "2025-09-09T15:39:39Z")

</div>

Thank you. Does it need modification in the build system? Adding these (along with the declarations in the header file) was not enough:

```bash
/home/zc/paraview/Examples/CustomApplications/SimpleParaView/client/myMainWindow.cxx: In member function ‘virtual void myMainWindow::dragEnterEvent(QDragEnterEvent*)’:
/home/zc/paraview/Examples/CustomApplications/SimpleParaView/client/myMainWindow.cxx:88:61: error: invalid use of incomplete type ‘class pqMainWindowEventManager’
   88 | pqApplicationCore::instance()->getMainWindowEventManager()->dragEnterEvent(evt);
      | ^~
In file included from /home/zc/paraview/Examples/CustomApplications/SimpleParaView/client/myMainWindow.cxx:7:
/home/zc/paraview_install/include/paraview-6.0/pqApplicationCore.h:17:7: note: forward declaration of ‘class pqMainWindowEventManager’
   17 | class pqMainWindowEventManager;
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~
/home/zc/paraview/Examples/CustomApplications/SimpleParaView/client/myMainWindow.cxx: In member function ‘virtual void myMainWindow::dropEvent(QDropEvent*)’:
/home/zc/paraview/Examples/CustomApplications/SimpleParaView/client/myMainWindow.cxx:94:61: error: invalid use of incomplete type ‘class pqMainWindowEventManager’
   94 | pqApplicationCore::instance()->getMainWindowEventManager()->dropEvent(evt);
      | ^~
/home/zc/paraview_install/include/paraview-6.0/pqApplicationCore.h:17:7: note: forward declaration of ‘class pqMainWindowEventManager’
   17 | class pqMainWindowEventManager;
      | ^ ~~~~~~~~~~~~~~~~~~~~~~~

```

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 9, 2025, 3:40pm UTC](https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172/4 "2025-09-09T15:40:31Z")

</div>

Probably an include ?

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/csatizoltan/32/6997_2.png) [@CsatiZoltan](https://discourse.paraview.org/u/CsatiZoltan)
#### Post date: [September 9, 2025, 3:46pm UTC](https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172/5 "2025-09-09T15:46:41Z")

</div>

I included

```cpp
#include <QDragEnterEvent>
#include <QDropEvent> 

```

so it shouldn’t be the problem. By the way, _Clients/ParaView/ParaViewMainWindow.cxx_ only includes `QDragEnterEvent`, so `QDropEvent` must be included implicitly.

---

<div class="post-metadata">

### Author: ![mwestphal](https://discourse.paraview.org/user_avatar/discourse.paraview.org/mwestphal/32/17_2.png) [@mwestphal](https://discourse.paraview.org/u/mwestphal)
#### Post date: [September 9, 2025, 3:47pm UTC](https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172/6 "2025-09-09T15:47:35Z")

</div>

> [@CsatiZoltan](#):
>
> `pqMainWindowEventManager`

`#include "pqMainWindowEventManager.h"`

---

<div class="post-metadata">

### Author: ![CsatiZoltan](https://discourse.paraview.org/user_avatar/discourse.paraview.org/csatizoltan/32/6997_2.png) [@CsatiZoltan](https://discourse.paraview.org/u/CsatiZoltan)
#### Post date: [September 9, 2025, 3:57pm UTC](https://discourse.paraview.org/t/drag-and-drop-in-custom-application-does-not-work/17172/7 "2025-09-09T15:57:19Z")

</div>

Sorry, my bad. It works now.
