Uploaded image for project: 'Qt for MCUs'
  1. Qt for MCUs
  2. QTMCU-341

vertical/horizontal alignment property is not available when referencing a Text defined as Component by id from a Loader

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P2: Important
    • None
    • Qt for MCUs 2.8.1
    • QUL Team
    • None
    • All

    Description

      Here is an example code, the horizontal / vertical alignment causes the build error.

      Code:  

      import QtQuick
      
      Rectangle {
          Component {
              id: textComp
              Text {
                  width: 128
                  height: 64
                  font.pixelSize: 16
                  text: "Build Error"
                  horizontalAlignment: Text.AlignHCenter
                  verticalAlignment: Text.AlignVCenter
              }
          }
          Loader {
              sourceComponent: textComp
              active: true
          }
      } 

      Error message: 

      C:/work/QTMCU341/build/Qt_for_MCUs_2_8_Desktop_32bpp_MINGW-Debug/CMakeFiles/QTMCU341.dir/QTMCU341.cpp: In constructor 'QTMCU341::text_2::text_2(QTMCU341*)':
      C:/work/QTMCU341/build/Qt_for_MCUs_2_8_Desktop_32bpp_MINGW-Debug/CMakeFiles/QTMCU341.dir/QTMCU341.cpp:71:5: error: 'horizontalAlignment' was not declared in this scope
         71 |     horizontalAlignment.setValue(Qul::Private::Items::Text::AlignHCenter);
            |     ^~~~~~~~~~~~~~~~~~~
      C:/work/QTMCU341/build/Qt_for_MCUs_2_8_Desktop_32bpp_MINGW-Debug/CMakeFiles/QTMCU341.dir/QTMCU341.cpp:74:5: error: 'verticalAlignment' was not declared in this scope
         74 |     verticalAlignment.setValue(Qul::Private::Items::Text::AlignVCenter);
            |     ^~~~~~~~~~~~~~~~~

       

      Attachments

        1. error.log
          3 kB
        2. QTMCU341.zip
          2 kB

        Issue Links

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

          Activity

            People

              Unassigned Unassigned
              wataru Wataru Higashiyama
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:

                Gerrit Reviews

                  There are no open Gerrit changes