Reply
Thread Tools
Posts: 55 | Thanked: 206 times | Joined on Mar 2019
#31
Three more questions:

1. I would like to navigate from the first page of an app (page 1) to another by swiping left (page 2).
GPSInfo does this by using a timer which creates the pageStack.pushAttached element of the second page.
Is there another / more elegant way to achieve this behaviour of changing from one to another page?

2. Is it possible to navigate from one pages button (page 1) to another page (page 3) and scroll this one to a specific item (for example a label) in the middle of this page (like anchors in HTML)?

3. Is it possible to use QLM's transform.matrix4x4 within sailfish apps to transform this element (for example to mirror a text field vertically)?
Attached Images
 

Last edited by BGK; 2019-10-21 at 17:17.
 

The Following User Says Thank You to BGK For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#32
1. PageStack is stack, it's linear. You should have a page under your depth to go lower.
2. You can pass any arguments to a page you pushing to. Process it inside page to scroll
3. You can use transform property: https://doc.qt.io/qt-5/qml-qtquick-i...transform-prop
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 4 Users Say Thank You to coderus For This Useful Post:
Posts: 55 | Thanked: 206 times | Joined on Mar 2019
#33
Thanks for your helpful tips, coderus!

Originally Posted by coderus View Post
1. PageStack is stack, it's linear. You should have a page under your depth to go lower.
Navigating the stack backwards is clear (and easy). It's the possibility to navigate "forward" from page 1 to page 2 (without the need of a button, just swiping) which I'm looking for.

Originally Posted by coderus View Post
2. You can pass any arguments to a page you pushing to. Process it inside page to scroll
Passing the "scroll-to-item" to page 3 was exactly what I thought of. But how to scroll the page?

Originally Posted by coderus View Post
3. You can use transform property: https://doc.qt.io/qt-5/qml-qtquick-i...transform-prop
Wonderful! Exactly what I was searching for!
 

The Following User Says Thank You to BGK For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#34
1. okay, then attachedPage is your choice. Or use a Dialog instead of a Page and set acceptDestination
2. By using https://doc.qt.io/qt-5/qml-qtquick-l...AtIndex-method
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 2 Users Say Thank You to coderus For This Useful Post:
Posts: 55 | Thanked: 206 times | Joined on Mar 2019
#35
Originally Posted by coderus View Post
1. okay, then attachedPage is your choice. Or use a Dialog instead of a Page and set acceptDestination
I'll go for attachedPage. GPSInfo uses a timer to call attachedPage. What could be the reason for that (wouldn't be Component.onCompleted an easier way)?

Originally Posted by coderus View Post
2. By using https://doc.qt.io/qt-5/qml-qtquick-l...AtIndex-method
Thanks a lot!
 

The Following User Says Thank You to BGK For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#36
There could be problems with transitions., Try it out and see. New API introduced pageStack.completeAnimation() method, which is probably you want to call before pageStack.pushAttached
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following User Says Thank You to coderus For This Useful Post:
Posts: 27 | Thanked: 80 times | Joined on Feb 2016 @ Czech Republic
#37
How to work with images? I want to create app like this or this... so I need to choose image(s) from gallery and save it somewhere in the app - to local database?
__________________
:: Xiaomi Redmi 5 Plus with Sailfish OS 3.1.0.12:: My apps for Sailfish OS ::
 

The Following 2 Users Say Thank You to kuba77 For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#38
I think this code should still work: https://bitbucket.org/mitakuuluu/mit...atarPicker.qml
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following 4 Users Say Thank You to coderus For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, España
#39
Hi,

How to add a short vibration to a Rectangle Button?,

thanks, . .
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post:
Ancelad's Avatar
Posts: 1,552 | Thanked: 3,108 times | Joined on Jun 2012 @ Russia, 96
#40
Originally Posted by Markkyboy View Post
Hi,

How to add a short vibration to a Rectangle Button?,

thanks, . .
Code:
import QtFeedback 5.0

HapticsEffect {
	id: activeEffect
	duration: 500 // in ms
	intensity: 0.2 // from 0 to 1 with 0.1 step-size
	running: button.pressed
}
Button {
        id: button
	width: text.width
	text: "Test"					 
        anchors.horizontalCenter: parent.horizontalCenter
	onClicked: activeEffect.start()          
}

Last edited by Ancelad; 2019-11-12 at 19:49.
 

The Following 6 Users Say Thank You to Ancelad For This Useful Post:
Reply


 
Forum Jump


All times are GMT. The time now is 22:59.