summaryrefslogtreecommitdiffstats
path: root/examples/widgets/widgets/tablet/tabletapplication.cpp
blob: 0d50ef685aa02cae65cc8e23337a53f37af69713 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
// Copyright (C) 2016 The Qt Company Ltd.
// SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause

#include "tabletapplication.h"

//! [0]
bool TabletApplication::event(QEvent *event)
{
    if (event->type() == QEvent::TabletEnterProximity ||
        event->type() == QEvent::TabletLeaveProximity) {
        m_canvas->setTabletDevice(static_cast<QTabletEvent *>(event));
        return true;
    }
    return QApplication::event(event);
}
//! [0]