grapGesture - QScrollArea scroll with 1 Finger touch
I found this way
to avoid the annoying 2-Finger scroll. With this code I can scroll with one Finger.
But I found a problem.
When I click on a QPushButton in this scrollarea to open a new Dialog with an other one-Finger-ScrollArea in it, the scrolling does not work here.
When I disable the one-Finger scrolling in first area with the Button it, the second dialog works.
Only one grabGesture possible - must I disable it - on disabeling in the first Dialog in the on click even the app crashes after I close the 2. Dialog ????????????
what you u also call
for the second
Yes, of course !
When I move the Button which calls the 2. Dialog out of the scrolling area, all works.
So calling a scrollarea from an other scroll area is not posssible.
Maybe in the _clicked event processing the gesture processing is in work and prevents other gesture processings ?
What can I do ?
I have checked my thesis.
In the Button onClicked I start a timer in 100 ms .
In the timer-even I open the 2. dialog -> it works.
Hm, a little bit roundabout ! Is there an more easy and direct way ?
when you open this dialog, do you call exec() ?
That will start a local event loop and it might be the reason.
Yes, I start a modal dialog with exec !
ok, that might do strange stuff as it stays in there.
try calling show() instead to test
note, show() dont block so if u have code
code that do something with dialog stuff after OK
switching to show() wont work.
Indeed with show it works.
Any ideas how perform it with exec ?
Only as you self discovered to use a timer to
start it via other signal.
Thank you for you help, here is my short solution:
QMetaObject::invokeMethod(this, "functionToCall", Qt::QueuedConnection);
ah, yes. i wondered if it would work.
And it does. super.