Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-83600

Invalid property assignment: "horizontalCenter" is a read-only property

    XMLWordPrintable

    Details

    • Platform/s:
      Windows
    • Commits:
      3f5b5e48595b52000421a339d95d1a30d783aed5 (qt/qtbase/dev)

      Description

      I first saw the error when running qtvirtualkeyboard's basic example:

      qrc:/Basic.qml:72:47: Invalid property assignment: "horizontalCenter" is a read-only property 
      
       anchors.horizontalCenter: parent.horizontalCenter
      

      A minimal Qt Quick example works:

      import QtQuick 2.14
      import QtQuick.Window 2.12
      Window {
          width: 400
          height: 400
          visible: true
          Rectangle {
              anchors.fill: parent
              color: "transparent"
              border.color: "darkorange"
          }
      }
      

      A minimal Qt Quick Controls 2 example does not:

      import QtQuick 2.14
      import QtQuick.Controls 2.12
      
      ApplicationWindow {
          width: 400
          height: 400
          visible: true
      
          Rectangle {
              anchors.fill: parent
              color: "transparent"
              border.color: "darkorange"
          }
      }
      

      If I remove the anchor bindings in qtvirtualkeyboard's basic example, I get a crash:

      1  QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData>>::operator->          qscopedpointer.h             118  0x7ffa8387d1ca 
      2  qGetPtrHelper<QScopedPointer<QObjectData,QScopedPointerDeleter<QObjectData>> const> qglobal.h                    1081 0x7ffa83879643 
      3  QObject::d_func                                                                     qobject.h                    126  0x7ffa838803ea 
      4  QObjectPrivate::get                                                                 qobject_p.h                  329  0x7ffa83881023 
      5  QQmlData::wasDeleted                                                                qqmldata_p.h                 316  0x7ffa81d7e5a3 
      6  QV4::QObjectWrapper::wrap                                                           qv4qobjectwrapper_p.h        227  0x7ffa81d7e6e8 
      7  loadProperty                                                                        qv4qobjectwrapper.cpp        139  0x7ffa81fc3cca 
      8  QV4::QObjectWrapper::getProperty                                                    qv4qobjectwrapper.cpp        274  0x7ffa81fbe57b 
      9  QV4::QObjectWrapper::getQmlProperty                                                 qv4qobjectwrapper.cpp        398  0x7ffa81fbda31 
      10 QV4::QQmlContextWrapper::getPropertyAndBase                                         qv4qmlcontext.cpp            318  0x7ffa81f7af16 
      11 QV4::QQmlContextWrapper::resolveQmlContextPropertyLookupGetter                      qv4qmlcontext.cpp            486  0x7ffa81f7bcdd 
      12 QV4::Moth::VME::interpret                                                           qv4vme_moth.cpp              585  0x7ffa8201645c 
      13 QV4::Moth::VME::exec                                                                qv4vme_moth.cpp              463  0x7ffa82014da5 
      14 QV4::Function::call                                                                 qv4function.cpp              69   0x7ffa81f2a364 
      15 QQmlJavaScriptExpression::evaluate                                                  qqmljavascriptexpression.cpp 219  0x7ffa82298c74 
      16 QQmlBinding::evaluate                                                               qqmlbinding.cpp              216  0x7ffa822a6d61 
      17 QQmlNonbindingBinding::doUpdate                                                     qqmlbinding.cpp              252  0x7ffa822ab851 
      18 QQmlBinding::update                                                                 qqmlbinding.cpp              194  0x7ffa822a5760 
      19 QQmlBinding::setEnabled                                                             qqmlbinding.cpp              557  0x7ffa822a54d2 
      20 QQmlObjectCreator::finalize                                                         qqmlobjectcreator.cpp        1423 0x7ffa822c41c6 
      21 QQmlComponentPrivate::complete                                                      qqmlcomponent.cpp            990  0x7ffa821c2b20 
      22 QQmlComponentPrivate::completeCreate                                                qqmlcomponent.cpp            1081 0x7ffa821c191c 
      23 QQmlComponent::completeCreate                                                       qqmlcomponent.cpp            1068 0x7ffa821bf6d2 
      24 QQmlComponent::create                                                               qqmlcomponent.cpp            825  0x7ffa821bf44e 
      25 QQuickView::continueExecute                                                         qquickview.cpp               489  0x7ffa84a4d791 
      26 QQuickViewPrivate::execute                                                          qquickview.cpp               105  0x7ffa84a4e086 
      27 QQuickView::setSource                                                               qquickview.cpp               240  0x7ffa84a4d1a0 
      28 QQuickView::QQuickView                                                              qquickview.cpp               175  0x7ffa84a4c970 
      29 main                                                                                main.cpp                     39   0x7ff648192f8b 
      30 WinMain                                                                             qtmain_win.cpp               97   0x7ff648197775 
      31 invoke_main                                                                         exe_common.inl               107  0x7ff648195fdd 
      32 __scrt_common_main_seh                                                              exe_common.inl               288  0x7ff648195ece 
      33 __scrt_common_main                                                                  exe_common.inl               331  0x7ff648195d8e 
      34 WinMainCRTStartup                                                                   exe_winmain.cpp              17   0x7ff648196069 
      35 BaseThreadInitThunk                                                                 KERNEL32                          0x7ffaf1f87bd4 
      36 RtlUserThreadStart                                                                  ntdll                             0x7ffaf2f8ced1 
      

        Attachments

          Issue Links

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

            Activity

              People

              Assignee:
              fabiankosmale Fabian Kosmale
              Reporter:
              mitch_curtis Mitch Curtis
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

                Dates

                Created:
                Updated:
                Resolved:

                  Gerrit Reviews

                  There are no open Gerrit changes