D9460: KCM: Dynamically resize QMLOutput root dimensions directly in QML

Daniel Vrátil noreply at phabricator.kde.org
Thu Dec 21 15:57:56 UTC 2017


dvratil added a comment.


  In https://phabricator.kde.org/D9460#182151, @apol wrote:
  
  > In https://phabricator.kde.org/D9460#182139, @dvratil wrote:
  >
  > > QML is clever enough to re-evaluate the function when `item.rotation` or dimensions change.
  >
  >
  > Not if it's within `_transformedSize()`
  
  
  It actually does, since the function //depends// on the object. Try running this and resize the window:
  
    import QtQuick 2.0
    
    Rectangle {
        id: root
        anchors.fill: parent
        color: "red"
    
        function f(item) {
            if (item.width > 1000) {
                console.log("Wide");
            } else {
                console.log("Narrow");
            }
            return 0
        }
    
        rotation: f(root)
    }

REPOSITORY
  R104 KScreen

REVISION DETAIL
  https://phabricator.kde.org/D9460

To: dvratil, sebas, davidedmundson
Cc: apol, plasma-devel, ZrenBot, progwolff, lesliezhai, ali-mohamed, jensreuterberg, abetts, sebas, mart
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.kde.org/pipermail/plasma-devel/attachments/20171221/4ee42a91/attachment.html>


More information about the Plasma-devel mailing list