Commit 35a09f2e authored by Jens Bache-Wiig's avatar Jens Bache-Wiig

Fix button toggle of the miniproject selector on Windows

The problem is that on windows, mouse events are replayed
if you click outside a popup to close it. If you hit the
project selector button to toggle it, this will cause
the popup to reopen on mouse release. Which we do not want.
Hence we set the DontReplay flag on mouseClick.

A similar workaround can be found in QComboBox.
parent 9426caee
......@@ -426,6 +426,19 @@ void MiniProjectTargetSelector::setVisible(bool visible)
m_projectAction->setChecked(visible);
}
// This is a workaround for the problem that Windows
// will let the mouse events through when you click
// outside a popup to close it. This causes the popup
// to open on mouse release if you hit the button, which
//
//
// A similar case can be found in QComboBox
void MiniProjectTargetSelector::mousePressEvent(QMouseEvent *e)
{
setAttribute(Qt::WA_NoMouseReplay);
QWidget::mousePressEvent(e);
}
void MiniProjectTargetSelector::addProject(ProjectExplorer::Project* project)
{
QTC_ASSERT(project, return);
......
......@@ -132,6 +132,7 @@ private slots:
void changeStartupProject(ProjectExplorer::Project *project);
void updateAction();
void paintEvent(QPaintEvent *);
void mousePressEvent(QMouseEvent *);
private:
int indexFor(ProjectExplorer::Project *project) const;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment