Uploaded image for project: 'Qt Creator'
  1. Qt Creator
  2. QTCREATORBUG-11455

Vertical center anchor and right anchor can't be used at same time

    XMLWordPrintable

Details

    • Bug
    • Resolution: Done
    • P2: Important
    • Qt Creator 3.2.1
    • Qt Creator 3.0.1
    • Quick Designer
    • None
    •  ec26e687f442ecb24d5e356d5563c1ae3b469e52

    Description

      Vertical center anchor and right anchor can't be used at same time as that described in Help "Creating a Qt Quick Application":
      "In Layout, select the vertical center anchor button and then the right anchor button to anchor the rectangle to the middle right margin of the screen."

      If I select "right anchor" then "vertical" is deselected and vice versa.

      If I push the vertical anchor button it is calling setRightAnchor!

      void QmlAnchorBindingProxy::setRightAnchor(bool anchor)
      {
          if (!m_qmlItemNode.hasNodeParent())
              return;
      
          if (rightAnchored() == anchor)
              return;
      
          RewriterTransaction transaction = m_qmlItemNode.modelNode().view()->beginRewriterTransaction(QByteArrayLiteral("QmlAnchorBindingProxy::setRightAnchor"));
      
          if (!anchor) {
              removeRightAnchor(); <<< HERE
          } else {
      
              if (m_rightTarget.modelNode() == m_qmlItemNode.modelNode().parentProperty().parentModelNode()) {
                  m_relativeRightTarget = SameEdge;
              } else {
                  m_relativeRightTarget = OppositeEdge;
              }
      
              anchorRight();
              if (leftAnchored())
                  backupPropertyAndRemove(modelNode(), "width");
          }
      
          emit relativeAnchorTargetRightChanged();
          emit rightAnchorChanged();
      
          if (hasAnchors() != anchor)
              emit anchorsChanged();
      }
      

      Attachments

        Issue Links

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

          Activity

            People

              thohartm Thomas Hartmann
              destiny Ruslan Primak
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Gerrit Reviews

                  There are no open Gerrit changes