Skip to content

Commit

Permalink
Merge pull request #1647 from ghutchis/fix-default-tool
Browse files Browse the repository at this point in the history
Default tool wasn't set properly, so rotations, etc. ignored
  • Loading branch information
ghutchis authored Mar 7, 2024
2 parents f2f1ff2 + f9cda24 commit 3316b10
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions avogadro/qtopengl/glwidget.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -15,13 +15,13 @@

#include <avogadro/rendering/camera.h>

#include <QAction>
#include <QtCore/QTimer>
#include <QtGui/QKeyEvent>
#include <QtGui/QMouseEvent>
#include <QtGui/QWheelEvent>
#include <QAction>
#include <QtWidgets/QApplication>
#include <QtGui/QWindow>
#include <QtWidgets/QApplication>

namespace Avogadro::QtOpenGL {

Expand Down Expand Up @@ -169,7 +169,9 @@ void GLWidget::setDefaultTool(const QString& name)
{
foreach (QtGui::ToolPlugin* tool, m_tools) {
QAction* toolAction = tool->activateAction();
if (tool->name() == name || (toolAction && toolAction->text() == name)) {

if (tool->objectName() == name || tool->name() == name ||
(toolAction && toolAction->text() == name)) {
setDefaultTool(tool);
return;
}
Expand Down Expand Up @@ -332,4 +334,4 @@ void GLWidget::keyReleaseEvent(QKeyEvent* e)
QOpenGLWidget::keyReleaseEvent(e);
}

} // namespace Avogadro
} // namespace Avogadro::QtOpenGL

0 comments on commit 3316b10

Please sign in to comment.