mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-19 08:52:15 -07:00
Make popup not close when interacting with child widgets.
This commit is contained in:
parent
f72900fac7
commit
b6418e8888
1 changed files with 4 additions and 1 deletions
|
|
@ -1,5 +1,6 @@
|
||||||
#include "settings_popup_widget.h"
|
#include "settings_popup_widget.h"
|
||||||
|
|
||||||
|
#include <QApplication>
|
||||||
#include <QFocusEvent>
|
#include <QFocusEvent>
|
||||||
|
|
||||||
SettingsPopupWidget::SettingsPopupWidget(QWidget *parent) : QWidget(parent, Qt::Popup | Qt::FramelessWindowHint)
|
SettingsPopupWidget::SettingsPopupWidget(QWidget *parent) : QWidget(parent, Qt::Popup | Qt::FramelessWindowHint)
|
||||||
|
|
@ -14,7 +15,9 @@ void SettingsPopupWidget::addSettingsWidget(QWidget *toAdd) const
|
||||||
|
|
||||||
void SettingsPopupWidget::focusOutEvent(QFocusEvent *event)
|
void SettingsPopupWidget::focusOutEvent(QFocusEvent *event)
|
||||||
{
|
{
|
||||||
|
if (!this->isAncestorOf(QApplication::focusWidget())) {
|
||||||
close();
|
close();
|
||||||
|
}
|
||||||
QWidget::focusOutEvent(event);
|
QWidget::focusOutEvent(event);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue