0

My problem relates to user interface. I have wrapped a Rectangle (root) inside the ApplicationWindow. The height and width of root rectangle and application window is same.I have designed my complete application inside root rectangle.The problem is when I minimize my ApplicationWindow , everything inside root rectangle gets hidden. I tired to set root rectangle and application window's minimum height and width, but the problem still exist.

This is actual application https://drive.google.com/file/d/0Bz-y0XAfUMXHa2E2cFdBLTRhMGM/view?usp=sharing

And this is the problem https://drive.google.com/file/d/0Bz-y0XAfUMXHWTNIQlZYekw2R0E/view?usp=sharing

Second problem is, I have an ImageView inside root rectangle. On minimizing the window it goes over the toolbar which also, is a rectangle inside root.

This is image view https://drive.google.com/file/d/0Bz-y0XAfUMXHUy1ZMEJIWFYyMnc/view?usp=sharing

This is what happens https://drive.google.com/file/d/0Bz-y0XAfUMXHb2pCdHFEMXBCeXM/view?usp=sharing

Here is my code :

    ApplicationWindow {
                id: appwindow
                visible: true
                width: 1280
                height: 800
                     Rectangle{    //root rectangle inside application window
                         id:root
                         width: parent.width
                         height: parent.height
                         color:"#05293D"
                      Rectangle{                 //the toolbar inside root
                          id : toolbar
                          height : 50
                          width : root.width
                          color : "#7CC7FF"
                          radius: 4
                          visible: true
}

Below is the Image code inside root rectangle :

    Image{
            id:main
            y: 81
            width: 600
            height: 400
            anchors.verticalCenterOffset: 23
            anchors.centerIn: parent
}
Ankit
  • 1,330
  • 2
  • 11
  • 16
MJKhan
  • 61
  • 2
  • 7
  • 1
    Add an item anchored to top: toolbar.bottom and bottom: root.bottom, acting as parent for the image. Also, don't give absolute sizes to the image, but size it in relation to its parent – Frank Osterfeld May 10 '15 at 19:54
  • @FrankOsterfeld can you elaborate through writing a code snippet , i am new to qml – MJKhan May 10 '15 at 21:10
  • 1
    If you're new, start with the documentation: http://doc.qt.io/qt-5/qtquick-positioning-anchors.html – cmannett85 May 10 '15 at 22:30

0 Answers0