src/mainwindow.cpp

changeset 106
128efb9d148b
parent 105
6ca6e8c647d4
child 108
94c92c923713
equal deleted inserted replaced
105:6ca6e8c647d4 106:128efb9d148b
397 397
398 void MainWindow::selectTool(BaseTool* tool) 398 void MainWindow::selectTool(BaseTool* tool)
399 { 399 {
400 if (tool != nullptr && tool != this->selectedTool) 400 if (tool != nullptr && tool != this->selectedTool)
401 { 401 {
402 if (this->selectedTool != nullptr)
403 {
404 this->selectedTool->reset();
405 }
402 this->selectedTool = tool; 406 this->selectedTool = tool;
403 for (auto&& pair : items(this->toolActions)) 407 for (auto&& pair : items(this->toolActions))
404 { 408 {
405 pair.value->setChecked(pair.key == tool); 409 pair.value->setChecked(pair.key == tool);
406 } 410 }

mercurial