How do I elide Rectangle that is wider than its parent Rectangle?
Solved
QML and Qt Quick
-
Elision is only related to text.
If you want to "hide" the part of a rectangle that overflows out of its parent, you can use the clip property:
Rectangle { width: 50 height: 50 clip: true Rectangle { width: 100 height: 100 } }
Note that using
clip
should be your last solution, on big items, this can be bad for performances.Instead you should try to prevent your child item from being bigger than its parent so you don't have to use
clip
. -
Elision is only related to text.
If you want to "hide" the part of a rectangle that overflows out of its parent, you can use the clip property:
Rectangle { width: 50 height: 50 clip: true Rectangle { width: 100 height: 100 } }
Note that using
clip
should be your last solution, on big items, this can be bad for performances.Instead you should try to prevent your child item from being bigger than its parent so you don't have to use
clip
.