mirror of
https://bitbucket.org/smil3y/katie.git
synced 2025-02-24 02:42:55 +00:00
be extra carefull when accessing the popup widgets
Signed-off-by: Ivailo Monev <xakepa10@laimg.moc>
This commit is contained in:
parent
317f673d72
commit
8556ac72f3
4 changed files with 11 additions and 12 deletions
|
@ -445,13 +445,13 @@ FontHash *qt_app_fonts_hash()
|
|||
return app_fonts();
|
||||
}
|
||||
|
||||
QWidgetList *QApplicationPrivate::popupWidgets = 0; // has keyboard input focus
|
||||
QWidgetList *QApplicationPrivate::popupWidgets = Q_NULLPTR; // has keyboard input focus
|
||||
|
||||
QDesktopWidget *qt_desktopWidget = 0; // root window widgets
|
||||
QDesktopWidget *qt_desktopWidget = Q_NULLPTR; // root window widgets
|
||||
#ifndef QT_NO_CLIPBOARD
|
||||
QClipboard *qt_clipboard = 0; // global clipboard object
|
||||
QClipboard *qt_clipboard = Q_NULLPTR; // global clipboard object
|
||||
#endif
|
||||
QWidgetList * qt_modal_stack=0; // stack of modal widgets
|
||||
QWidgetList *qt_modal_stack = Q_NULLPTR; // stack of modal widgets
|
||||
|
||||
/*!
|
||||
\internal
|
||||
|
@ -2259,7 +2259,7 @@ void QApplication::setActiveWindow(QWidget* act)
|
|||
sendSpontaneousEvent(qApp, &appDeactivate);
|
||||
}
|
||||
|
||||
if (QApplicationPrivate::popupWidgets == 0) { // !inPopupMode()
|
||||
if (!QApplicationPrivate::popupWidgets) { // !inPopupMode()
|
||||
// then focus events
|
||||
if (!QApplicationPrivate::active_window && QApplicationPrivate::focus_widget) {
|
||||
QApplicationPrivate::setFocusWidget(0, Qt::ActiveWindowFocusReason);
|
||||
|
@ -4421,7 +4421,7 @@ bool QApplicationPrivate::notify_helper(QObject *receiver, QEvent * e)
|
|||
|
||||
bool QApplicationPrivate::inPopupMode() const
|
||||
{
|
||||
return QApplicationPrivate::popupWidgets != 0;
|
||||
return QApplicationPrivate::popupWidgets != Q_NULLPTR;
|
||||
}
|
||||
|
||||
/*!
|
||||
|
|
|
@ -3790,7 +3790,7 @@ void QApplicationPrivate::closePopup(QWidget *popup)
|
|||
}
|
||||
if (QApplicationPrivate::popupWidgets->count() == 0) { // this was the last popup
|
||||
delete QApplicationPrivate::popupWidgets;
|
||||
QApplicationPrivate::popupWidgets = 0;
|
||||
QApplicationPrivate::popupWidgets = Q_NULLPTR;
|
||||
if (!qt_nograb() && popupGrabOk) { // grabbing not disabled
|
||||
Display *dpy = X11->display;
|
||||
if (popup->geometry().contains(QPoint(mouseGlobalXPos, mouseGlobalYPos))
|
||||
|
@ -4097,9 +4097,9 @@ bool QETWidget::translateMouseEvent(const XEvent *event)
|
|||
if (type == 0) // don't send event
|
||||
return false;
|
||||
|
||||
if (qApp->d_func()->inPopupMode()) { // in popup mode
|
||||
QWidget *popup = qApp->activePopupWidget();
|
||||
if (popup) { // in popup mode
|
||||
QWidget *activePopupWidget = qApp->activePopupWidget();
|
||||
QWidget *popup = qApp->activePopupWidget();
|
||||
if (popup != this) {
|
||||
if (event->type == LeaveNotify)
|
||||
return false;
|
||||
|
|
|
@ -7364,7 +7364,7 @@ bool QWidget::close()
|
|||
\sa show() hide() isVisible()
|
||||
*/
|
||||
|
||||
bool QWidget::isVisibleTo(QWidget* ancestor) const
|
||||
bool QWidget::isVisibleTo(const QWidget* ancestor) const
|
||||
{
|
||||
if (!ancestor)
|
||||
return isVisible();
|
||||
|
|
|
@ -476,8 +476,7 @@ public:
|
|||
bool restoreGeometry(const QByteArray &geometry);
|
||||
void adjustSize();
|
||||
bool isVisible() const;
|
||||
bool isVisibleTo(QWidget*) const;
|
||||
// ### Qt 5: bool isVisibleTo(_const_ QWidget *) const
|
||||
bool isVisibleTo(const QWidget*) const;
|
||||
inline bool isHidden() const;
|
||||
|
||||
bool isMinimized() const;
|
||||
|
|
Loading…
Add table
Reference in a new issue