-
Hi! I am trying to make a simple application in which I want to drag and drop an image file from windows explorer into an image widget inside the program. Here are some relevant snippets of what I have so far and the problem will be explained below.
In the above code I use a new bool variable to know if the image widget is hovered. Down in my main function I have the callback for when something is dropped in the application. After the drop call, in the onDrop function i use this
which practically checks if my image widget was hovered over at the moment the file was dropped in the program, and from there I can proceed and do what I need. This almost works perfectly. Here is the problem. The isItemHovered only returns true if the program window is on top of all others. That means if for example I have a folder and the program open side by side, and I have opened the folder last, when I start to drag&drop a file, the explorer window is the one "on top" and the isItemHovered reports false even though the program window is completely visible and I can see where I am dropping the file. So my question is how can I make it work properly (in both case above instead only during the second one)? I will be grateful for any help, thanks! |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 9 replies
-
Well this is an interesting question.
|
Beta Was this translation helpful? Give feedback.
I found a way to make it work but there is now another problem....
So i followed some of your previous advice and here is how i made it currently.
This is the whole of my onDrop function now.
And here is the full code where the widget is:
`