Uploaded image for project: 'Qt Design Studio'
  1. Qt Design Studio
  2. QDS-15571

ImageLayers don't show up unless width and height are explicitly set

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Not Evaluated Not Evaluated
    • None
    • QDS 4.7.2
    • MCU support
    • None

      Example code:

      It's expected that the ImageLayer is shown and gets the size of the source image, but it only shows up by explicitly setting the width and height properties to match those of the source. On an actual MCU target, that's not necessary.

      /*
      This is a UI file (.ui.qml) that is intended to be edited in Qt Design Studio only.
      It is supposed to be strictly declarative and only uses a subset of QML. If you edit
      this file manually, you might introduce QML code that is not supported by Qt Design Studio.
      Check out https://doc.qt.io/qtcreator/creator-quick-ui-forms.html for details on .ui.qml files.
      */
      
      import QtQuick
      import Constants
      
      import QtQuickUltralite.Layers 2.0
      
      ApplicationScreens {
          Screen {
              id: screen
      
              width: 800
              height: 480
      
      
              ItemLayer {
                  z: 1
                  width: 200
                  height: 200
                  
                  Rectangle {
                      id: root
                      width: 400
                      height: 200
                      color: "red"
                  }
              }
              
              ImageLayer {
                  id: reineLofotenIslands
                  z: 2
                  source: "images/reine-lofoten-islands.jpg"
              }
          }
      }
      

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

            thohartm Thomas Hartmann
            srodal Samuel Rødal
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:

                There are no open Gerrit changes