Alexandru,

Mac OSX, testing with trackpad and mouse.

Regards,

Nuno

> On 20 Apr 2017, at 09:36, Alexandru Croitor <alexandru.croi...@qt.io> wrote:
> 
> Hi.
> 
> What platform are you testing on?
> 
> 
>> On 20 Apr 2017, at 10:26, Nuno Santos <nunosan...@imaginando.pt> wrote:
>> 
>> Hi,
>> 
>> I would like to understand how can I handle a QQuickItem touch input when 
>> extending QQuickItem and creating my own item in C++
>> 
>> I can’t find documentation that explains this, neither examples. I have 
>> tried the following and none have worked.
>> 
>> What am I missing?
>> 
>> // Implementation
>> 
>> MyItem::MyItem(QQuickItem* parent) :
>>   QQuickItem(parent)
>> {
>>   setAcceptedMouseButtons(Qt::LeftButton);
>>   setFiltersChildMouseEvents(true);
>>   setKeepTouchGrab(true);
>> }
>> 
>> // Header
>> 
>> protected:
>>   void mousePressEvent(QMouseEvent *event) {
>>       QQuickItem::mousePressEvent(event);
>> 
>>       qDebug() << "mousePressEvent" << event->pos();
>>   }
>> 
>>   void mouseMoveEvent(QMouseEvent *event) {
>>       QQuickItem::mouseMoveEvent(event);
>> 
>>       qDebug() << "mouseMoveEvent" << event->pos();
>>   }
>> 
>>   void mouseReleaseEvent(QMouseEvent *event) {
>>       QQuickItem::mouseReleaseEvent(event);
>> 
>>       qDebug() << "mouseReleaseEvent" << event->pos();
>>   }
>> 
>>   void mouseReleaseEvent();
>> 
>>   void touchEvent(QTouchEvent* event) {
>>       qDebug() << "touch event" << event;
>>   }
>> 
>>   bool eventFilter(QObject *, QEvent *event)
>>   {
>>       qDebug() << "processing TouchUpdate...";
>> 
>>       if (event->type() == QEvent::TouchUpdate) {
>>       }
>>       // other Touch events here...
>> 
>>       return false;
>>   }
>> 
>> Thanks,
>> 
>> Regards,
>> 
>> Nuno
>> _______________________________________________
>> Interest mailing list
>> Interest@qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
> 

_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest

Reply via email to