[solved]display qt quick control calendar at a certain position
-
Greetings.
I am developing an application in qt quick, using the qt quick "controls":http://qt-project.org/doc/qt-5/qtquickcontrols-index.html, I have a set up with a "GridLayout":http://qt-project.org/doc/qt-5/qml-qtquick-layouts-gridlayout.html in which I use a "RowLayout":http://qt-project.org/doc/qt-5/qml-qtquick-layouts-rowlayout.html, in "RowLayout":http://qt-project.org/doc/qt-5/qml-qtquick-layouts-rowlayout.html I have an some "TextField":http://qt-project.org/doc/qt-5/qml-qtquick-controls-textfield.html controls. I am using anchors based design,
The problem is that I would like to display the calendar control below one of the "TextFields":http://qt-project.org/doc/qt-5/qml-qtquick-controls-textfield.html. but aver the "GridLayout":http://qt-project.org/doc/qt-5/qml-qtquick-layouts-gridlayout.html.
It turned out that the calendar control cannot be in the grid layout, because it will break the existing item order, so I have to remove it out, to the main element, because of this the anchors binding is not possible anymore, and if I try to access the properties of the "TextField":http://qt-project.org/doc/qt-5/qml-qtquick-controls-textfield.html it has the position properties X, Y empty.
The question is: is it possible to determine the exact position of the "TextField":http://qt-project.org/doc/qt-5/qml-qtquick-controls-textfield.html in the "RowLayout":http://qt-project.org/doc/qt-5/qml-qtquick-layouts-rowlayout.html? and if it is How?
Sorry for a rather long, and hopefully not too confusing explanation.
Thank you for your answer.Ciao, Andrej
-
Hi,
bq. is it possible to determine the exact position of the TextField [qt-project.org] in the RowLayout [qt-project.org]? and if it is How?
AFAIK, you can use mapToItem function to get global coordinates of the element.
-
Hi,
thank you for the replay, This function did the trick.
Bye Andrej
-
You're Welcome :) You can mark the post as solved by editing and prepending the thread title with [Solved]