Last active
November 2, 2016 14:31
-
-
Save oKcerG/24307ece0dd5660725dd591d53121832 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import QtQuick 2.0 | |
/*! | |
\qmltype AreaTester | |
\brief A component that highlights the aera of a given component. | |
The AreaTester component is a simple component to troubleshoot what area occupies an other component. | |
You can use this component like this to highlights its parent's area. | |
\qml | |
Item { | |
id: itemToHighlight | |
//... | |
AreaTester{} | |
} | |
\endqml | |
Or if you want to test a component that isn't its parent, use the \l target property : | |
\qml | |
Item { | |
Item { | |
id: itemToHighlight | |
} | |
AreaTester { target: itemToHighlight } | |
} | |
\endqml | |
*/ | |
Rectangle { | |
/*! | |
Indicates the item whose area you want to highlight. | |
By default it is set to the parent of this component. | |
*/ | |
property Item target: parent | |
anchors.fill: target | |
color: Qt.hsla(Math.random(), 0.5, 0.5, 0.5) | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment