Hello all.

I have the following very simplified situation where all my screens should 
belong
to a hierarchy of partial screens, so that there is no duplication and I can 
easily
change behaviour and design at one place (amonst other things). For example:

 [BaseScreen] <----- [SomePartScreen]  <----- [MainScreen]
                                       <----- [AboutScreen]

              <----- [OtherPartScreen] <----- [...Screen]

And so forth. Now the problem is this:

SomePartScreen.qml:

BaseScreen {

   Rectangle {
     id: rectOne
     anchor.left: parent.anchors.left
   }

   Rectangle {
     id: rectTwo
     anchor.right: parent.anchors.right
   }

}

If I want to put a rectangle between rectOne and rectTwo in a further "derived"
screen (e.g. AboutScreen), I need access to at least one of their anchor 
properties.
Unfortunately due to the way QML is designed, I cannot access the childs of my 
parent
class. I have also not managed to successfully alias the anchor property of 
either
rectangles in the BaseScreen root because it always resulted in an error when I
accessed it in e.g. AboutScreen ("Cannot anchor to a null item.").

Is there any way, trick or solution I don't know about to solve this problem or 
do
I really need to duplicate common layout / behaviour through all screens?

I know I could break down everything to separate elements and reuse those, which
is unfortunately not feasible for my current project for various reasons. :(

Thanks for any input and help...

So long,
Matthias Dahl

-- 
Dipl.-Inf. (FH) Matthias Dahl | Software Engineer | http://binary-island.eu
 services: custom desktop, mobile and web applications, server administration
_______________________________________________
Qt-qml mailing list
[email protected]
http://lists.qt.nokia.com/mailman/listinfo/qt-qml

Reply via email to