PDA

View Full Version : Vibrate Device



javed_alam786
26th January 2011, 15:46
Hi All,

I want to vibrate the device (of course through code not manually) for a variable amount of time whenever a button is clicked. For example Button1_Clicked vibrate for 1sec, if Button2_clicked vibrate for 2sec.

Any idea how to achieve this.

Regards,
Javed Alam

tsp
26th January 2011, 18:21
I have not tested this personally but there is an API (and example) in Qt Mobility for feedback effects, see http://doc.qt.nokia.com/qtmobility-1.1.0/qfeedbackhapticseffect.html#details

javed_alam786
27th January 2011, 10:32
Hi Tsp,

Thanks for the direction. I am new to QT C++ and for some reason i cannot include QFeedbackHapticsEffect. i get an error "QFeedbackHapticsEffect: No such file or directory". Am i missing something here ?

Kind Regards,
Javed

nish
27th January 2011, 11:34
you need to include and link qtmobility first.

javed_alam786
27th January 2011, 21:20
Hi All,

When i run configure in C:\QtMobility\qt-mobility-symbian-opensource-1.1.0\configure.bat file the command prompt opens up and closes in a split second then i see three file getting generated

.qmake.cache

QT_MOBILITY_SOURCE_TREE = C:/QtMobility/qt-mobility-symbian-opensource-1.1.0
QT_MOBILITY_BUILD_TREE = C:/QtMobility/qt-mobility-symbian-opensource-1.1.0


config.in

CONFIG += release
CONFIG_WIN32 += debug_and_release build_all release
QT_MOBILITY_PREFIX = C:/QtMobility
build_unit_tests = no
build_public_unit_tests = no
build_examples = no
build_demos = no
build_docs = yes
build_tools = yes
qmf_enabled = no
!symbian:isEmpty($$QT_MOBILITY_INCLUDE):QT_MOBILIT Y_INCLUDE=$$QT_MOBILITY_PREFIX/include
isEmpty($$QT_MOBILITY_LIB):QT_MOBILITY_LIB=$$QT_MO BILITY_PREFIX/lib
isEmpty($$QT_MOBILITY_BIN):QT_MOBILITY_BIN=$$QT_MO BILITY_PREFIX/bin
isEmpty($$QT_MOBILITY_PLUGINS):QT_MOBILITY_PLUGINS =$$QT_MOBILITY_PREFIX/plugins
isEmpty($$QT_MOBILITY_EXAMPLES):QT_MOBILITY_EXAMPL ES=$$QT_MOBILITY_PREFIX/bin
isEmpty($$QT_MOBILITY_DEMOS):QT_MOBILITY_DEMOS=$$Q T_MOBILITY_PREFIX/bin
mobility_modules = bearer location contacts systeminfo publishsubscribe versit messaging sensors serviceframework multimedia gallery organizer feedback
contains(mobility_modules,versit): mobility_modules *= contacts


config.txt

'qmake' is not recognized as an internal or external command,
operable program or batch file.
... Not found



I have no idea what to make of this. I have installed Qt Creator 2.0.1 and is Based on Qt 4.7.0 (32 bit) on Windows 7. I have also done all updates using SDK Maintenance Tool.

All I am trying to do is to #include <QFeedbackHapticsEffect> and use its properties and functions to Vibrate the phone on button click.

I am stuck here please help.

Leionida
4th March 2011, 20:07
What about add path to qmake into PATH?