Fixed crash on iOS devices due to unsupported selector.
Added check for traiCollection selector. Task-number: QTBUG-50159 Change-Id: Ie3efafe9e22e59aef862a681ad733f2bb0a5ba49 Reviewed-by: Tor Arne Vestbø <tor.arne.vestbo@theqtcompany.com>
This commit is contained in:
parent
a62132b22c
commit
81ee6e763e
@ -105,8 +105,10 @@ QIOSIntegration::QIOSIntegration()
|
||||
m_touchDevice = new QTouchDevice;
|
||||
m_touchDevice->setType(QTouchDevice::TouchScreen);
|
||||
QTouchDevice::Capabilities touchCapabilities = QTouchDevice::Position | QTouchDevice::NormalizedPosition;
|
||||
if (mainScreen.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
|
||||
touchCapabilities |= QTouchDevice::Pressure;
|
||||
if ([mainScreen respondsToSelector:@selector(traitCollection)]) {
|
||||
if (mainScreen.traitCollection.forceTouchCapability == UIForceTouchCapabilityAvailable)
|
||||
touchCapabilities |= QTouchDevice::Pressure;
|
||||
}
|
||||
m_touchDevice->setCapabilities(touchCapabilities);
|
||||
QWindowSystemInterface::registerTouchDevice(m_touchDevice);
|
||||
QMacInternalPasteboardMime::initializeMimeTypes();
|
||||
|
Loading…
Reference in New Issue
Block a user