summaryrefslogtreecommitdiffstats
path: root/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp')
-rw-r--r--src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
index 86a4cd0076..6a53ad2088 100644
--- a/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
+++ b/src/platformsupport/input/evdevmouse/qevdevmousehandler.cpp
@@ -66,7 +66,7 @@ QT_BEGIN_NAMESPACE
Q_LOGGING_CATEGORY(qLcEvdevMouse, "qt.qpa.input")
-QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QString &specification)
+std::unique_ptr<QEvdevMouseHandler> QEvdevMouseHandler::create(const QString &device, const QString &specification)
{
qCDebug(qLcEvdevMouse) << "create mouse handler for" << device << specification;
@@ -91,10 +91,10 @@ QEvdevMouseHandler *QEvdevMouseHandler::create(const QString &device, const QStr
fd = qt_safe_open(device.toLocal8Bit().constData(), O_RDONLY | O_NDELAY, 0);
if (fd >= 0) {
::ioctl(fd, EVIOCGRAB, grab);
- return new QEvdevMouseHandler(device, fd, abs, compression, jitterLimit);
+ return std::unique_ptr<QEvdevMouseHandler>(new QEvdevMouseHandler(device, fd, abs, compression, jitterLimit));
} else {
qErrnoWarning(errno, "Cannot open mouse input device %s", qPrintable(device));
- return 0;
+ return nullptr;
}
}