Week 6 recap GSoC 2025 - Add Action Button
Intro
The main goal of this project is to add accessible functionality for users. This wouldn't be possible without buttons to activate those tools! This week’s focus was all about giving the user more direct access to selection tools by placing actionable buttons on top of the floating bar right on the canvas.

QPushButton and connect()
During the halfway point check in with Emmet, I got advice to look into QAction and QPushButton. I learned that QAction held a lot of the Selection Tool actions I was looking for like 'Select All' and 'Deselect' in kis_selection_manager.cc. The QPushButton creates a clickable button. To make the button respond to user input, I connected the button's clicked() signal to the slotted action with Qt's connect() function.
// Example
connect(sender, signal, receiver, slot);
connect(buttonObjectWithSignal, buttonSignal, objectWithAction, objectActionToActivate)
// Commited Code
connect(d->buttonSelectAll, &QPushButton::clicked, d->selectionManager, &KisSelectionManager::selectAll);
This really helped me set the foundation for triggering selection actions.
Files and Implementation
/krita/libs/ui/
kis_selection_assistants_decoration.h
kis_selection_assistants_decoration.cpp
kis_selection_decoration.h
kis_selection_decoration.cc
kis_selection_manager.cc
I added a couple of QPushButtons that appear on the floating bar. The placement and visibility are currently hardcoded as a proof-of-concept to quickly test the functionality and visual layout.
In order to connect() the button's signal to the selection actions, it was important to learn how to pass in and reference the KisViewManager and KisSelectionManager which contained the selection actions. By creating a function within KisSelectionAssistantsDecoration to set the declared references of KisSelectionManager and calling it after KisSelectionAssistantsDecoration is instantiated, I was able to pass in the selection action function I wanted to activate.
void KisSelectionAssistantsDecoration::setViewManager(KisViewManager* viewManager) {
d->m_viewManager = viewManager;
d->selectionManager = viewManager->selectionManager();
}
Conclusion
Adding a floating button might seem like a small thing, but it lays the foundation for a more interactive and intuitive user experience in Krita. Seeing it appear directly on the canvas and being able to click it feels like I made real progress!
Right now, the layout and behavior are still pretty basic as the floating bar and buttons' positions are hardcoded, but it proves the concept works. I also learned a lot about how to pass around references like KisViewManager and KisSelectionManager in order to access and trigger the selection actions.
Next week, I plan to continue to find the selection actions I need, add those selection buttons, and improve on the hardcoded positions!
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