Skip to content
nucularmoo edited this page May 15, 2018 · 4 revisions

Custom Painted Items (P1 | 3h)

Tino: SUGGESTION. This will be 4.06 and 4.07 will be Shapes. Or somewhere we need to have shapes, as it's another way to create custom painting but more efficiently than with QPainter. It would earn its own session

Erika: Will create shapes somewhere

Tino: Some Shapes stuff: Efficient way for rendering shaped paths in Qt Quick Any path shape supported: line, ellipse, arc, quadratic and cubic Bezier curves Path created manually from path elements (geometry) or with GPU vendor extension GL_NV_path_rendering Possible to define the line color and style as well as the fill color and fill rules Image masks allow creating even more complicated shapes Performance benefit as the path is never rasterized in SW Existing QQuickPaintedItem and Canvas items rendered to an image by the CPU Rendered images uploaded to the video memory Easier to create new shapes No JavaScript needed as in Canvas No QQuickPaintedItem sub-classing needed

Explanation of the contents of a topic page @ Topic reference page

Back to Week 4

Objective: TBA

Tino: Learn how to use QPainter paint kit to create custom items

Beginner

  • What functionality a typical 2D part kit provides?

Intermediate

  • What is QQuickPaintedItem?
  • What is QPainter?
  • How to draw a polygon?

Tino: The actual painted item can be anything. Although we have Image QML type, a custom painting with an image (image provider) would be nice. At least commonly used by customers.

Expert

Omitted


Course material content

Instructions and description for the exercise of the topic


Exhaustive reference material mentioned in this topic

Further reading topics/links:

Clone this wiki locally