August 18, 2012

daljit97 daljit97
Ant Farmer
68 posts

[solved]How to set minimum flickable contentY and how to use Math.max() function?

 

Hello, I’m working with a flickable in qml and I need that the minimium contentY shoud be 20, I don’t know how to do this because flickable doesn’t have a onMovementUpdated signal. Another thing, I don’t understand how work Math.max() and Math.min() functions.
Can anyone help?

4 replies

August 18, 2012

Peppy Peppy
Hobby Entomologist
389 posts

Math.max() and Math.min() choose from two arguments and return the higher or the lower one.

August 19, 2012

daljit97 daljit97
Ant Farmer
68 posts

Thanks, now how to set max or min contentY for a flickable

August 20, 2012

mbrasser mbrasser
Ant Farmer
452 posts

Hi,

Math.min()/Math.max() are standard Javascript functions. The QML documentation doesn’t document these at the moment, so your best bet is to refer to existing Javascript documentation, such as http://www.w3schools.com/jsref/jsref_obj_math.asp .

Can you give more details about what sort of effect you are trying to achieve (and what version of QtQuick you are using)? It may be that it is possible to achieve without setting a minimum contentY. For example, you might try placing your flickable content starting at y position of -20.

Regards,
Michael

August 20, 2012

daljit97 daljit97
Ant Farmer
68 posts

Thanks, setting up content at y position of -20 works!

 
  ‹‹ Why does PageStackWindow not add itself as Parent to a child page ?      Custom QGraphicsWebView - scrollbars always on ››

You must log in to post a reply. Not a member yet? Register here!