PDA

View Full Version : QListWidget gesture support



RolandHughes
18th February 2016, 16:04
All,

Qt 5.4 on 32-bit Ubuntu 14.04 with all updates applied. Eventually will be compiled for a Raspberry Pi with a touch screen.

Trying a very simple experiment. One page in a stacked widget consists entirely of a QListWidget. In the code I add a bunch of items to it. Scrollbars and mouse wheel work fine to scroll the list, but having difficulty getting gesture to work. Is there a link to a working example using QScroller on a QListWidget?

In the past, to achieve this I had to build my own custom buttons in a GraphicsScene under a GraphicsView using a hack of FlickCharm. Was hoping QScroller would finally make this possible with a simple QListWidget.

Thanks,

Added after 1 2 minutes:

Fixed it. Will have to try to put together a shareable example. Basically if you happen to add both

QScroller::grabGesture(ui->menuListWidget, QScroller::LeftMouseButtonGesture)

and

QScroller::grabGesture(ui->menuListWidget, QScroller::TouchGesture);

to the same item they nuke each other.