![]() |
Sailfish Silica and anchors
Hi,
I'm playing around with Sailfish Silica. Column is a sub-optimal solution in my case, simple anchoring would be the best here. That's my code: Code:
import QtQuick 2.0 What am I doing wrong? |
Re: Sailfish Silica and anchors
I suspect some reparenting takes place at runtime. Try anchoring with id instead of parent.
|
Re: Sailfish Silica and anchors
Quote:
Code:
QML TextField: Cannot anchor to an item that isn't a parent or sibling. |
Re: Sailfish Silica and anchors
So that confirms my suspicion. The only way I can think of then is to do
Code:
TextField { y: page.height - height } EDIT: now that I read your code again, you may try putting your TextField directly in the page, not in the flickable, and keep anchoring with parent or id. It should work, but I am not sure it will be exactly what you want. |
Re: Sailfish Silica and anchors
Reparing would not cause a problem as long as you always use the "parent" keyword to refer to the parent object.
I'm far from a QtQuick expert but I suspect the problem is that the Flickable's contentHeight, which you defined as the height of the children, is less than the full page height. Thus the bottom anchor is not at the page bottom, but at the bottom of the "content". (If you don't want to be "flickable", why don't you put it outside the flickable?) |
Re: Sailfish Silica and anchors
What I was saying, is that probably the pulley menu becomes the parent of all the contents of the flickable for some reason, so that when the textfield is anchored at the bottom of the parent it goes to the bottom of the pullmenu.
As far as I know contentHeight does not affect the actual flickable height which is set by anchors.fill:parent in this case. That said, javispedro is right that it should be put outside the flickable. Putting ut inside and anchoring it to the bottom doesn't make much sense. |
Re: Sailfish Silica and anchors
Reposting the code with now-important stuff
Code:
import QtQuick 2.0 It looks ok but lags as hell with Code:
QQuickWindow: possible QQuickItem::polish() loop |
Re: Sailfish Silica and anchors
Quote:
Code:
height: parent.height - header.height If you want to put a filler, then calculate its height based on either a constant, the window size, or the page's size. What you're doing there is triggering a loop (e.g. Column's height is calculated based on Text's height, which is calculated based on Header's height and ... Column's height). |
All times are GMT. The time now is 14:01. |
vBulletin® Version 3.8.8