[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-devel
Subject:    drag 'n' drop between QScrollView
From:       Stefano Frangella <stefanofr () freemail ! it>
Date:       1999-09-30 16:30:10
[Download RAW message or body]

Hi,I'm writing a vector drawing program.
I have a 'ViewForm' class derived from QScrollView.
Each instance of 'ViewForm' is a document containing a lot of  graphic objects.
These objects are directly rendered  on the contents area using
'drawContentsOffset' method.
I perform drag 'n' drop operations  within a single ViewForm in the following
way :

void ViewForm::viewportMousePressEvent (QMouseEvent* me)
{
pressed=true;
...
...
drag_timer->start(100,true);
}

void TChildForm::slotDragTimeOut()
{
if (pressed)
{
debug("drag started");
drag_started=true;
....
}
}
void ViewForm::viewportMouseReleaseEvent (QMouseEvent* me)
{
pressed=false;
if(drag_started)
{
drag_started=false;
debug("dropped in same window");
....
}

drag_timer's signal 'timeout()' is connected to 'slotDragTimeOut()'.

Everything work fine within a ViewForm , but if i drag mouse cursor on a
different ViewForm, no event occurs until i release
the mouse button, so i can't locate the detsination widget. 
I want to locate the destination widget before 'viewportMousReleasedEvent' is
called.

Thanks for any help.

-- 
Stefano Frangella

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic