Skip to content

Instantly share code, notes, and snippets.

@oKcerG
Last active November 2, 2016 14:31
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save oKcerG/24307ece0dd5660725dd591d53121832 to your computer and use it in GitHub Desktop.
Save oKcerG/24307ece0dd5660725dd591d53121832 to your computer and use it in GitHub Desktop.
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