Hi,
I am trying to implement QTapSensor in my app . Here is part of my code:
//declaration of tap sensor
QTapReading *reading;
QTapSensor tapSensor;
//in main constructor
tapSensor.start();
reading = tapSensor.reading();
connect(&tapSensor,SIGNAL(readingChanged()),this,SLOT(readingTapChanged()));
void MainWindow::readingTapChanged()
{
qDebug("asdsadsadsad");
QTapReading::TapDirection direction = reading->tapDirection();
if(direction == QTapReading::X)
{
widgetPosition++;
if(widgetPosition > ui->stackedWidget->count())
widgetPosition = 0;
}
else if(direction == QTapReading::X_Neg)
{
widgetPosition--;
if(widgetPosition < 0)
widgetPosition = ui->stackedWidget->count();
}
updateWidget();
}
void MainWindow::updateWidget()
{
ui->stackedWidget->setCurrentIndex(widgetPosition);
}
I am traying to handle slide gestrure to switch between widgets in stacked windget. As u can see I have in slot readingTapChanged() debug note to see whether sensor react to touch. But I have to push the screen very strong to get response. Can somebody help me how to handle tap better?



