Z-Order globally
-
Hi,
how i can use z-globally ?
(z-order work only on siblings ....how i have read)heir is a simple sample (https://saengjja.tistory.com/176) (ok on china-language but code is clear )
how I can override here "yellow"-rectangle ?What is this solution for this problem ?
thanks a lot !!!
Marian -
If your Items are model driven then change the order of the items in the model.
You might be better served to create a minimal example that represents what you are actually doing than a contrived simplistic version.
I will often create a side project that accurately reflects what I am doing and recreates the problem. Code is cut and pasted from larger projects in order to keep the example as accurate as possible. This takes time, but it will save you time when asking for help.
-
Hi,
how i can use z-globally ?
(z-order work only on siblings ....how i have read)heir is a simple sample (https://saengjja.tistory.com/176) (ok on china-language but code is clear )
how I can override here "yellow"-rectangle ?What is this solution for this problem ?
thanks a lot !!!
Marian@krowa
ok, here's a hack for your problem:- Create a c++ class either as root context property or as a singleton.
- Give it a Q_PROPERTY of QObject *
- at the top most level inside main.qml assign the root element to that c++ QObject -Pointer
- where you need it / want a top level/ top z-order, use this object pointer for the parent property of the QML Item
I use this for a custom Popup component, in an application where the root component is neither a Window or Application Window.
It works, but it will make your skin crawl :D
-
You just gave me an idea. I don't read chinese so I cannot tell what they are trying to accomplish. But qml has a way to use states to change parenting of an object. This could be used to reparent an object to do what you said. So the selected item could reparent itself as a popup.
-
I thought and hoped that this was a totally trivial problem and I just overlooked something ...
look like this no standart solution....
- what is this technical problem ?
- what is solution of this problem ?
@fcarney
I thinking this example describe and show my understanding problem.
I was very surprised that it doesn't work as I think.....@J.Hilk
ok, is but this is a hack , I will read you code tomorow again and have sure question :-)for my understanding, I sure could if I move a item, first remove/delete this item and after add again ......but this not really solution, very dirty hack .......
Marian
-
I thought and hoped that this was a totally trivial problem and I just overlooked something ...
look like this no standart solution....
- what is this technical problem ?
- what is solution of this problem ?
@fcarney
I thinking this example describe and show my understanding problem.
I was very surprised that it doesn't work as I think.....@J.Hilk
ok, is but this is a hack , I will read you code tomorow again and have sure question :-)for my understanding, I sure could if I move a item, first remove/delete this item and after add again ......but this not really solution, very dirty hack .......
Marian