Trolltech Home | Qt-jambi-interest Home | Recent Threads | All Threads | Author | Date
All threads index page 1

Qt-jambi-interest Archive, August 2007
how to find out the target window of a drop operation


Message 1 in thread

Hello people, i have a litte (or probably quite big) Question.

I wrote a litte App with QtJambi, it is more or less a simple Listview 
in which you can insert Text fragments and give them a name which is 
shown in the list, this fragemnts then can be dragged and dropped into 
applications.
The app is intended to help people who have to type the same text 
fragments repeatedly and like using the mouse more than keyboard.

DnD works quite fine right now, (i use mimetype text/plain)

well, i would like the ability to issue an keypress for example for 
return and tab - keys automatically after the drop has taken place.
this may be useful or example when ppl. use my app to fill in Values in 
forms...
now my question is, is there any convenient way to et a reference to the 
target window of a DnD operation?
or any other way to find out where the user dropped something, so that i 
can send a keypress to this app? (not sure how to do this in general but 
i quess dbus or DCOP may do the trick)

any ideas on this?
thanks in advance.

Ge0rgy


Message 2 in thread

On Aug 13, 2007, at 20:19 , Christoph Schmid wrote:

> Hello people, i have a litte (or probably quite big) Question.
>
> I wrote a litte App with QtJambi, it is more or less a simple  
> Listview in which you can insert Text fragments and give them a  
> name which is shown in the list, this fragemnts then can be dragged  
> and dropped into applications.
> The app is intended to help people who have to type the same text  
> fragments repeatedly and like using the mouse more than keyboard.
>
> DnD works quite fine right now, (i use mimetype text/plain)
>
> well, i would like the ability to issue an keypress for example for  
> return and tab - keys automatically after the drop has taken place.
> this may be useful or example when ppl. use my app to fill in  
> Values in forms...
> now my question is, is there any convenient way to et a reference  
> to the target window of a DnD operation?
> or any other way to find out where the user dropped something, so  
> that i can send a keypress to this app? (not sure how to do this in  
> general but i quess dbus or DCOP may do the trick)
>
> any ideas on this?
> thanks in advance.
>
> Ge0rgy
>

Hi Christoph,

If you're only inside the same Qt app this can be done quite easily,  
as illustrated with the attached example. It has a list to drag from  
and a target that accepts it and sends key events to the target  
afterwards. But you're talking about going outside of the current  
process, and there Qt Jambi doesn't provide a lot of help.

You would have to integrate tighter with the given target windowing  
system to support such features.

-
best regards,
Gunnar

Attachment:

Attachment: DnD.java
Description: Binary data