MCPcopy Create free account
hub / github.com/SaschaWillems/VulkanCapsViewer / setTouchProps

Function setTouchProps

vulkanCapsViewer.cpp:136–153  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

134
135#if defined(VK_USE_PLATFORM_IOS_MVK) || defined(VK_USE_PLATFORM_ANDROID_KHR)
136void setTouchProps(QWidget *widget) {
137 QScroller *scroller = QScroller::scroller(widget);
138 QScrollerProperties properties = scroller->scrollerProperties();
139 QVariant overshootPolicy = QVariant::fromValue<QScrollerProperties::OvershootPolicy>(QScrollerProperties::OvershootAlwaysOff);
140 properties.setScrollMetric(QScrollerProperties::VerticalOvershootPolicy, overshootPolicy);
141 properties.setScrollMetric(QScrollerProperties::HorizontalOvershootPolicy, overshootPolicy);
142 properties.setScrollMetric(QScrollerProperties::DragVelocitySmoothingFactor, 0.6);
143 properties.setScrollMetric(QScrollerProperties::MinimumVelocity, 0.0);
144 properties.setScrollMetric(QScrollerProperties::MaximumVelocity, 0.5);
145 properties.setScrollMetric(QScrollerProperties::AcceleratingFlickMaximumTime, 0.4);
146 properties.setScrollMetric(QScrollerProperties::AcceleratingFlickSpeedupFactor, 1.2);
147 properties.setScrollMetric(QScrollerProperties::SnapPositionRatio, 0.2);
148 properties.setScrollMetric(QScrollerProperties::MaximumClickThroughVelocity, 0);
149 properties.setScrollMetric(QScrollerProperties::DragStartDistance, 0.001);
150 properties.setScrollMetric(QScrollerProperties::MousePressEventDelay, 0.5);
151 scroller->grabGesture(widget, QScroller::LeftMouseButtonGesture);
152 scroller->setScrollerProperties(properties);
153}
154#endif
155
156VulkanCapsViewer::VulkanCapsViewer(QWidget *parent)

Callers 1

foreachFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected