Flick Delay



  • The flickable has the property, pressDelay, but does not have a flickDelay property. Is there a way to ignore a flick if the user presses and release faster than some interval. On a PC this really isn't a problem, but with a resistive touch screen I get a flick event about 25% of the time I really meant to just do a press/release.

    Thanks,
    Tom



  • You can use
    @
    qApp->setStartDragDistance(25);
    @
    to remove false flickings (25 of course is a sample, choose number that will suit you)



  • I have the same problem. What would the drag distance code be in qml?



  • It will be distance that is needed for mouse cursor (or finger in case of touch) to be moved for flickable area moving start.



  • right but am I correct in assuming that "qApp->setStartDragDistance(25);" is for C++? Can I set the attribute in QML?



  • kyleplattner, you should set it in c++ wrapper if you have qml-only app working inside qtcreator wrapper.



  • is there an article on that you could reference?



  • kyleplattner, article about what? If you mean using this method for qml flickable elements then I don't know if it is somewhere documented (I've found it in Qt sources).



  • Sorry, I meant an article about how to use C++ in a QML only app.



  • kyleplattner, you are using qml-only app inside wrapper generated for you by qt creator (this way I think is better for production using). Am I right? So you have some C++ code that loads your qml inside QDeclarativeView. In this code, in main.cpp after QApplication object creation you can put this string.



  • Denis, I really need to get to that point but currently I only have .qml files with a .qmlproject file.



  • So you are using qml inside qml viewer. In this way I think it is impossible to change this parameter.



  • What is the easiest way to get my project over to using C++?



  • Create new project in QtCreator: Qt C++ Project->Qt Quick Application. It will ask you a few questions and then will create you some files, copy your qmls in qml folder and change in main.cpp path to your first qml file. After it in main.cpp after line
    @
    QApplication app(argc, argv);
    @
    add line
    @
    app.setStartDragDistance(25);
    @
    It should help you



  • Using the QApplication class, it looks like I can set a time too:

    qApp->setStartDragTime(100)

    I don't like that this is a global function. I have some ListView's/GridView's that I want longer or shorter StartDragTime's for.

    Thanks for the help



  • [quote]right but am I correct in assuming that “qApp->setStartDragDistance(25);” is for C++? Can I set the attribute in QML? [/quote]

    It isn't possible to manipulate the value from QML, but for testing purposes qmlviewer has a command line option for changing this value; for example to set it to 25 when running main.qml you could do

    @qmlviewer -dragthreshold 25 main.qml@

    Regards,
    Michael



  • mbrasser, as I know this parameter influence on qml flickable element is not documented. Will this parameter have such side-effect in future or it can be changed?



  • [quote author="Denis Kormalev" date="1292541846"]mbrasser, as I know this parameter influence on qml flickable element is not documented. Will this parameter have such side-effect in future or it can be changed?[/quote]

    It's extremely unlikely that it will change (and, in fact, we should be documenting it).

    Regards,
    Michael



  • Good suggestion, that worked!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.