[Interest] [Quick Controls 2] Best way to add binding arrow tip to Popup?

Jérôme Godbout jerome at bodycad.com
Wed Oct 12 15:32:00 CEST 2016


For the round corner with rectangle:

Rectangle
{
  border.width: 2
  border.color: "black"
  color: Qt.rgba(0,0,0,0)
  clip: true
  width: canvas_.width
  height: canvas_.height
  Canvas
  {
    ...
  }
}

Using the clip and the round corner should work.

On Wed, Oct 12, 2016 at 7:48 AM, Oleg Evseev <ev.mipt at gmail.com> wrote:

> Great thanks, Shawn.
>
> Canvas is what I searching for!
>
> Even in canvas example there is a Talk bubble example that is look similar
> to tipped Popup!
> [image: Встроенное изображение 1]
>
> Canvas is Qt Quick Item, so it is quite easy to add it on the scene and
> add a shadows (or other effects) to it
> [image: Встроенное изображение 2]
> and use it as background for Qt Quick Controls.
>
> Only thing that I miss is the inner border in Canvas (to be identical to
> Rectangle drawing principle). But for simple tipped popup (rectangle with
> rounded corners and tip) it was quite easy to recalculate coordinates
> points.
> Plus, apparently there is the other solution with globalCompositeOperation
> http://stackoverflow.com/a/34234589/5765076 for complex shapes (didn't
> test it).
>
> I made tipped rectangle with Canvas and it looks great!
>
> *I really surprised, why using Canvas item was not suggested in first
> place?!*
>
> And you, Shawn, write this:
>
> ... we've always needed support for arbitrary shapes in QtQuick.  We’ll
>> have them eventually…
>
>
> like Canvas is *not *the really good solution - just a workaround. That
> is, it not claims to be "support for arbitrary shapes in QtQuick".
>
> Why? How your ideal support for arbitrary shapes in QtQuick will look like
> in general words, then?
>
> What about Canvas vs QSGGeometry Node approach? Only performance aspects?
>
> --
> Regards, Oleg.
>
> 2016-10-10 10:41 GMT+03:00 Shawn Rutledge <Shawn.Rutledge at qt.io>:
>
>> You can add two rotated rectangles, one underneath for the border, and
>> one (on top) for the fill, to cover up the edge of the main rectangle.
>> Next you will want a drop shadow, then you need a couple more Rectangles
>> (or something from GraphicalEffects) underneath.
>>
>> This is a good illustration of why we've always needed support for
>> arbitrary shapes in QtQuick.  We’ll have them eventually…
>>
>> Meanwhile you can use Canvas (draw the shape) or BorderImage (pull edge,
>> corner and center pieces from an image and assemble them into a resizable
>> balloon).
>>
>> _______________________________________________
>> Interest mailing list
>> Interest at qt-project.org
>> http://lists.qt-project.org/mailman/listinfo/interest
>>
>
> _______________________________________________
> Interest mailing list
> Interest at qt-project.org
> http://lists.qt-project.org/mailman/listinfo/interest
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161012/1291acc8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 18626 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161012/1291acc8/attachment.png>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: image.png
Type: image/png
Size: 26155 bytes
Desc: not available
URL: <http://lists.qt-project.org/pipermail/interest/attachments/20161012/1291acc8/attachment-0001.png>


More information about the Interest mailing list