165 { |
165 { |
166 QAction* action = new QAction{toolInstance->name(), this}; |
166 QAction* action = new QAction{toolInstance->name(), this}; |
167 action->setCheckable(true); |
167 action->setCheckable(true); |
168 this->toolActions[toolInstance] = action; |
168 this->toolActions[toolInstance] = action; |
169 action->setToolTip(toolInstance->toolTip()); |
169 action->setToolTip(toolInstance->toolTip()); |
|
170 action->setIcon(QPixmap{toolInstance->iconName()}); |
170 connect(action, &QAction::triggered, this, &Document::toolActionTriggered); |
171 connect(action, &QAction::triggered, this, &Document::toolActionTriggered); |
171 this->toolsBar->addAction(action); |
172 this->toolsBar->addAction(action); |
172 QWidget* const widget = toolInstance->toolWidget(); |
173 QWidget* const widget = toolInstance->toolWidget(); |
173 if (widget) |
174 if (widget) |
174 { |
175 { |