1. 31 May, 2013 - 1 commit
    • Jan Arve Saether's avatar
      Several improvements to documentation · c5d39cb1
      Jan Arve Saether authored
      
      * List all applicable attached properties for each layout
      * Move the stuff that describes min,pref and max sizes from GridLayout
        to the Layout docs.
      * Document that all layouts \inherits Item. (Even if they don't directly
        inherit, this is consistent with how the positioners are documented)
      * Add some links to Row, Column and Grid where appropriate
      * Use \qmlattachedproperty instead of \qmlproperty for the attached
        properties. (Again, consistent with how the Positioners attached
        properties are documented)
      * Change POSITIVE_INFINITE to the correct POSITIVE_INFINITY
      
      Change-Id: Ia9272faa479b48a97300b031402c0380ca113d7b
      Reviewed-by: default avatarCaroline Chao <caroline.chao@digia.com>
      Reviewed-by: default avatarJerome Pasion <jerome.pasion@digia.com>
      c5d39cb1
  2. 30 May, 2013 - 1 commit
    • Jan Arve Saether's avatar
      Do not crash when deleting a layout · cf6f7de3
      Jan Arve Saether authored
      
      onItemVisibleChanged() was in some cases called after the dtor of
      QQuickGridLayoutBase was called.
      
      After having called the dtor of QQuickGridLayoutBase it would
      continue to call the dtors of its base classes until it entered the
      dtor of QQuickItem.  In QQuickItem it would call setParentItem(0) on
      all its child items. This caused the item to become visible again,
      thus it would emit visibleChanged() and finally invoke
      QQuickGridLayoutBase::onItemVisibleChanged() which lead to the crash
      (while trying to call the virtual invalidate())
      
      The fix is to do an early return if we know that the layout is
      in the destruction phase.
      isReady() will return only true *after* the component is completed,
      and before the component is destructing.
      
      Task-number: QTBUG-31276
      Change-Id: I191e348278e3d052c109bffb92a1ccd9326859bd
      Reviewed-by: default avatarJens Bache-Wiig <jens.bache-wiig@digia.com>
      cf6f7de3
  3. 29 May, 2013 - 1 commit
  4. 23 May, 2013 - 1 commit
    • Jan Arve Saether's avatar
      Don't implicit cast the enum to a bool · 587c2c00
      Jan Arve Saether authored
      
      Casting a QLayoutPolicy::Fixed to bool was fine since that would return
      false.
      However, casting a QLayoutPolicy::Shrink to bool would return true,
      which would give wrong results. (The conditions only want to check if
      the item can grow).
      
      There were no bugs because of this, simply because the Qt Quick Layouts
      API does not allow setting *only* the shrink flag.
      However, it would become a bug if we ever added such a feature.
      
      Change-Id: I781aec85117f45e12e49ba27f7ed8f5724f71bd9
      Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
      587c2c00
  5. 22 May, 2013 - 1 commit
  6. 16 May, 2013 - 1 commit
  7. 10 May, 2013 - 2 commits
    • Jens Bache-Wiig's avatar
      Revert "Return infinity instead of -1 as a default value for max sizes" · 91fc9b18
      Jens Bache-Wiig authored
      
      This reverts commit a4158c97d84d5c76126307213baf22d12babdbc2
      
      This commit breaks the basiclayouts example so I am reverting it until we have a revised ifx.
      
      Change-Id: I901924d292606ffe1e797232ad2f5ff02d8fc2d6
      Reviewed-by: default avatarJens Bache-Wiig <jens.bache-wiig@digia.com>
      91fc9b18
    • Jan Arve Saether's avatar
      Return infinity instead of -1 as a default value for max sizes · 16558ac7
      Jan Arve Saether authored
      
      This was a bit inconsistent, because in the case of a Rectangle its
      Layout.maximumWidth would return -1 by default (which was supposed to
      be interpreted as infinity) However, since the maximumWidth propagated
      up to the layout, the layout.Layout.maximumWidth would return
      1000000000. Adding two Rectangles to the layout would make
      layout.Layout.maximumWidth return 2000000000, and adding a third item
      with Layout.maximumWidth:1 would make layout.Layout.maximumWidth
      return 2000000001
      
      With this change, since infinity + number = infinity, everything
      that can grow to infinity will just return infinity.
      
      In addition a developer can now more intuitively do comparisons
      like this:
      
      if (value > Layout.minimumWidth && value < Layout.maximumWidth)
      
      instead of
      
      if ((value == -1 || value > Layout.minimumWidth) &&
          (value != -1 && value < Layout.maximumWidth))
      
      Now, as a bonus, it becomes less consistent to set an attached
      (min,max) property to -1 in order to reset it to its implicit value.
      
      This also fixes a documentation issue with regards to the attached
      Layout.{min|max}imum{Width|Height} properties. It only told the story
      correct if the item was not a layout, and updates the docs for the max
      sizes to mention that it returns Number.POSITIVE_INFINITY
      
      Change-Id: Ia638064fd3ed5614d7e496a9b5e4aa8fcb7307f7
      Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
      16558ac7
  8. 30 Apr, 2013 - 1 commit
    • Jan Arve Saether's avatar
      Improve how child items are ignored/skipped · 15377099
      Jan Arve Saether authored
      
      The previous code was a bit rough in how it determined if the item
      was supposed to be ignored or not.
      
      For instance, it did not ignore items with
       Layout.maximumWidth: 0
      or
       Layout.preferredWidth: 0
       Layout.fillWidth: false
      
      The following patch will use
      QQuickLayoutItem::effectiveSizeHints_helper. Since that is now shared,
      it should make the behavior more consistent.
      
      The patch also fixes a bug where ignored items (e.g. a hidden item)
      was not re-added to the layout if it became visible again. (QTBUG-30796)
      We use a QSet to keep track of the ignored items, and repopulate the
      layout if any of the items in the QSet changed some properties relevant
      for the layout.
      
      Task-number: QTBUG-30796
      
      Change-Id: Ia4b0584ed61e1b24efaca322551f6bb1a4228ca6
      Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
      15377099
  9. 26 Apr, 2013 - 2 commits
    • Jan Arve Saether's avatar
      Refactor propagation of size hints · 5dec3ed5
      Jan Arve Saether authored
      
      This issue refactors how size hints are propagated up layout
      hierarchies. It fixes several problems:
      
      1. Do not overwrite explicitly set size hints when propagating them
         (Covered by test_sizeHint(propagateNone) )
      2. Propagate size hints immediately when they are changed.
         Previously, this was in an inconsistent state, since for some
         operations (such as implicitWidth changes) it would immediately
         propagate through an explicit call to propagateSizeHints. However,
         changes to other properties such as Layout.minimumWidth would simply
         call invalidate(), causing the propagation to be postponed until the
         layout got rearranged.
      3. Do not propagate size hints from rearrange. This could potentially
         make rearrange() unnecessary slow.
      4. Only use the fallback to width/height the *first* time the size hint
         is queried. This had the unfortunate consequence when a
         Layout.preferredWidth was reset back to -1 it could end up querying
         the width again (due to layout resizing, this could at this point be
         different than what was specified in the QML file). This is still
         not bullet proof, but AFAIK there is no bullet-proof way, since there
         is no way of retrieving the original value that 'width' was bound to
         in the QML file.
         (Covered by test_sizeHintPropagationCount)
      
      The performance characteristics for this change should be that it will
      make resizing of layouts faster, but will make dynamic changes to the
      layout slower (since it has to propagate the size hints every time a
      property is changed).
      
      Change-Id: I3dd818f6f7504908534eb5b22413fbeba1877985
      Task-number: QTBUG-30773
      Reviewed-by: default avatarJens Bache-Wiig <jens.bache-wiig@digia.com>
      5dec3ed5
    • Jan Arve Saether's avatar
      Repopulate the GridLayout if flow is changed · 4435aaef
      Jan Arve Saether authored
      
      This is needed because changing the flow will change which
      cell an item is associated with.
      
      Change-Id: Id84d1710fb6d7debe72a859c52b505e1e47f06b0
      Reviewed-by: default avatarRichard Moe Gustavsen <richard.gustavsen@digia.com>
      4435aaef
  10. 19 Apr, 2013 - 1 commit
  11. 17 Apr, 2013 - 1 commit
  12. 15 Apr, 2013 - 1 commit
  13. 12 Apr, 2013 - 1 commit
  14. 11 Apr, 2013 - 1 commit
  15. 10 Apr, 2013 - 2 commits
  16. 09 Apr, 2013 - 1 commit
  17. 04 Apr, 2013 - 1 commit
  18. 03 Apr, 2013 - 1 commit
  19. 22 Mar, 2013 - 1 commit
  20. 20 Mar, 2013 - 1 commit
  21. 14 Mar, 2013 - 1 commit
    • Jan Arve Saether's avatar
      Rearrange only the topmost layout. · 0c935730
      Jan Arve Saether authored
      
      Since we also rearrange in geometryChanged(), this should ensure
      that we recurse down and arrange all sublayouts.
      
      This assumes that objects are constructed in bottom-up order.
      (That's what componentComplete() indicates.)
      
      Previously we would risk rearranging sublayouts several times:
      1. Sublayout got componentComplete -> geometryChanged -> rearrange()
      2. Parent layout got componentComplete -> geometryChanged -> rearrange()
      3. Since the sublayout was a layout item of the parent layout it could
         get a geometry change again, causing it to rearrange again.
      
      This also fixes the issue where the implicitWidth/Height of the layout
      was not immediately set after componentComplete, which could cause it
      to get the wrong initial size.
      
      Change-Id: I63a35dd934cd3ace01fab6319333d531631a6f4e
      Reviewed-by: default avatarFrederik Gladhorn <frederik.gladhorn@digia.com>
      0c935730
  22. 13 Mar, 2013 - 2 commits
  23. 11 Mar, 2013 - 1 commit
  24. 07 Mar, 2013 - 1 commit
  25. 06 Mar, 2013 - 1 commit