用QtFeedback实现手机震动效果
Delete instructional text in italic
This article explains how to ... Replace the abstract text with a short paragraph (or sentence) describing what the topic covers.
Enter article metadata as described below. Note that this template can be placed anywhere in the article. Do not remove parameters that you do not use
Article Metadata
Introduction
本文介绍如果用QML 实现手机的震动效果.
在Meego系统的手机上实现手机的震动效果,直接使用QtMobility中的QtFeedBack就可。
实现
用QtFeedBack模块实现手机的震动效果的类为QFeedbackHapticsEffect,其对应的QML 元素为HapticsEffect,本文就用QML HapticsEffect ELement来实现震动效果。
1,在pro文件中导入feedback模块
CONFIG += mobility
MOBILITY += feedback
2,在QML文件中导入feedback 模块
import QtMobility.feedback 1.1
3,在qml文件中的代码实现
HapticsEffect {
id: rumbleEffect
attackIntensity: 0.0
attackTime: 250
intensity: 1.0
duration: 500
fadeTime: 250
fadeIntensity: 0.0
}相关连接
Add categories below. Remove Category:Draft when the page is complete or near complete

