KernelPanic
KernelPanic

Reputation: 2432

qt mouse events equal to touch screen events?

I am developing a tiny app that will run on beagleboard with 7" inch touch screen, but I haven't got it so far and I am working as developing standard desktop app. Are mouse events equal to touch screen events? I am working on QTableView and I've disable mouse drag multiple selection via:

void CTableView::mouseMoveEvent(QMouseEvent* event)
{
    if(this->state()!=DragSelectingState)
        QTableView::mouseMoveEvent(event);
}

Will this code also work on touch screen if user will try to select multiple cells with fingers?

Upvotes: 2

Views: 4147

Answers (1)

KimKulling
KimKulling

Reputation: 2843

Normally this strongly depends on you touch-driver. Mostly the touch events will be interpreted as left mouse clicks. And depending on your touch-driver somethimes you have to ensure that the touchdriver is calibrated in the right way ( for instance if the touch driver needs to know the origin of a touch event to get the right coordinates ).

For multitouch-device-handling I strogly recommend to use the QML-stuff for your user interface with a MultiPointTouchArea: http://qt-project.org/doc/qt-5/qml-qtquick-multipointtoucharea.html#details . You can easily connect the QML-stuff to your c++-logic as well.

Upvotes: 2

Related Questions