mirror of
https://github.com/Cockatrice/Cockatrice.git
synced 2026-07-18 16:32:16 -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 <QApplication>
|
||||
#include <QFocusEvent>
|
||||
|
||||
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)
|
||||
{
|
||||
close();
|
||||
if (!this->isAncestorOf(QApplication::focusWidget())) {
|
||||
close();
|
||||
}
|
||||
QWidget::focusOutEvent(event);
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue