QScrollArea autoscroll on children drag
-
Actually yes, that is half correct it seems.
It appears that dragEnterEvent event is working whilst the QDrag is active, but not the dragMoveEvent.
I'm using qt 4 and this tool is for Autodesk Maya if that makes and difference?
-
Hmm
We kinda need dragMoveEvent to be active to do some scrolling. This is not a uncommon
use case so others might have a good idea besides using dragMoveEvent.- I'm using qt 4 and this tool is for Autodesk Maya if that makes and difference?
I think not as it seems to be same doc for Qt4.
So platform is Windows?
- I'm using qt 4 and this tool is for Autodesk Maya if that makes and difference?
-
I would like this to work across Windows and Linux :)
-
Hi,
How are you implementing your dragEnter event ?
-
Hi SGaist,
I am creating a new class inheriting the QScrollArea object.
There are widgets inside it with mouseMoveEvents() that instigate a QDrag event.
I have tried putting various mouse events in the new inherited class like the dragEnter event. The dragEnter event actually appears to work. But its the dragMoveEvent that I'm having trouble with! :(
-
Seems that QScrollArea is different from others widgets in that regards
as it seems the views can do it.
( scrolling during drag operation )
-
@mrjj I've just tried scrolling this way on my QScrollArea but it's not doing the same thing. Isn't the widget you're demonstrating a QListWidget?
-
@DjMonkey
Yes, as i write "as it seems the views can do it."
Meaning List/Tree/xxx - Views.
Which means (seems that) that the default drag&drop do not block
the dragMoveEvent or have some other way to make this work.
So you could take a look in their source code to see how they do it. :) -
@mrjj ah my apologies! I understand now :)
I'll try to get to the bottom of this then, thanks
-
@DjMonkey
Oh no need for apologies, it was not really clear from my post :)
Well please do post back if you find out.Also if you have some test code, ill be happy to play with it.
-
@mrjj I have figured out a solution!
It seems to work by moving the dragMoveEvent onto the child widget instead of the QScrollArea that is holding them. If I implement my logic into that and use a pointer to the QSrollArea to change its scroll bar position - that works :)
-
@DjMonkey
Super. That would work. Hopefully there are no side effects :)