How to make QScroller grabGesture work with QDialog

Posted on Posted in Qt Tutorials, Tutorials

If you have tried this then you have definitely noticed that it becomes very annoying when you want to use QScroller::grabGesture with QDialogs that are opened using exec and have used QScroller::grabGesture in the calling (parent) window or dialog.

This is the case as far as Qt 5.6 (I have tried this for myself) and it seems that the only solution for this is to use a suitable SIGNAL/SLOT design in your program and therefore use show() function instead of exec()

So, to summarize and put it simply, use show() function to open a QDialog if you have a QAbstractScrollArea (QScrollArea, QTableWidget etc.) in it and you want to use grabGesture with it.

Leave a Reply

Your email address will not be published. Required fields are marked *