Skip to content

Week 3 recap GSoC 2025 - fix floating bar UI and research

Tuesday, 1 July 2025  |  Ross Rosales (rossr)

Intro

This week I learned how to tweak the UI using Qt modules, specifically Qt GUI classes. As someone new to C++ and Qt, I’ve found that official documentation for any new technology is always helpful in understanding the basic concepts and framework. Reading official documentation is like using an encyclopedia—you may not read it cover to cover, but you can search for key concepts to help navigate what you’re trying to do.

Before and After

QPainter

After researching how the Assistant Tool is drawn on the canvas, I thought I could use that same logic to draw on the floating bar. In the process, I found that the Assistant Tool has a lot of nested logic, inheriting different widget classes, and referencing various Kis objects that need to be built. After debugging countless times to find where this tool is drawn, I found the QPainter class. To keep it simple, this class draws lines and shapes in different colors. For now my goal is to display a floating bar.

Files and Implementation

/krita/libs/ui/
kis_painting_assistants_decoration.h
kis_painting_assistants_decoration.cpp
_
new
kis_selection_assistants_decoration.h
kis_selection_assistants_decoration.cpp

The files I focused on are in the path above. For organization, I made new files in the same directory. In kis_selection_assistants_decoration, the QPainterPath class is used to build the floating bar. This is slightly different from QPainter, as a QPainterPath object only needs to be created once for complex shapes.

To display and test the floating bar I used kis_painting_assistants_decoration::drawDecoration() method call to call kis_selection_assistants_decoration::drawDecoration().

Conclusion

This week I took a deeper dive into how Krita's UI is structured in Qt. By exploring how the Assistant Tool is created, I learned, I learned how core classes like QPainterPath interact with the canvas. Through this experience, I gained a solid starting point for UI-related work in Krita. There’s still much more to learn and improve on, but seeing a visual element I wrote appear on the canvas was a big milestone!

Contact

To anyone reading this, please feel free to reach out to me. I’m always open to suggestions and thoughts on how to improve as a developer and as a person.
Email: ross.erosales@gmail.com
Matrix: @rossr:matrix.org