QtWidgets: Fix build & warnings with QT_NO_GRAPHICSVIEW.
kernel\qapplication.cpp(3157,18) : warning: unused variable 'isGraphicsWidget' [-Wunused-variable] bool isGraphicsWidget = false; ^ kernel\qwidget.cpp(6446,18) : warning: unused variable 'window' [-Wunused-variable] if (QWidget *window = w->window()) { ^ kernel\qwidget.cpp(7949,50) : error: no member named 'proxyWidget' in 'QWExtra' if ((q->isWindow() && (!extra || !extra->proxyWidget)) ~~~~~ ^ kernel\qwidget.cpp(8084,50) : error: no member named 'proxyWidget' in 'QWExtra' if ((q->isWindow() && (!extra || !extra->proxyWidget)) Change-Id: I8474ab0ab4617c6588707ce0c2f7a97e4d0e54da Reviewed-by: Marc Mutz <marc.mutz@kdab.com>
This commit is contained in:
parent
ce29de5c33
commit
c4a53f647f
@ -3161,9 +3161,8 @@ bool QApplication::notify(QObject *receiver, QEvent *e)
|
|||||||
case QEvent::KeyRelease:
|
case QEvent::KeyRelease:
|
||||||
{
|
{
|
||||||
bool isWidget = receiver->isWidgetType();
|
bool isWidget = receiver->isWidgetType();
|
||||||
bool isGraphicsWidget = false;
|
|
||||||
#ifndef QT_NO_GRAPHICSVIEW
|
#ifndef QT_NO_GRAPHICSVIEW
|
||||||
isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver);
|
const bool isGraphicsWidget = !isWidget && qobject_cast<QGraphicsWidget *>(receiver);
|
||||||
#endif
|
#endif
|
||||||
QKeyEvent* key = static_cast<QKeyEvent*>(e);
|
QKeyEvent* key = static_cast<QKeyEvent*>(e);
|
||||||
bool def = key->isAccepted();
|
bool def = key->isAccepted();
|
||||||
|
@ -6415,13 +6415,13 @@ bool QWidget::hasFocus() const
|
|||||||
const QWidget* w = this;
|
const QWidget* w = this;
|
||||||
while (w->d_func()->extra && w->d_func()->extra->focus_proxy)
|
while (w->d_func()->extra && w->d_func()->extra->focus_proxy)
|
||||||
w = w->d_func()->extra->focus_proxy;
|
w = w->d_func()->extra->focus_proxy;
|
||||||
if (QWidget *window = w->window()) {
|
|
||||||
#ifndef QT_NO_GRAPHICSVIEW
|
#ifndef QT_NO_GRAPHICSVIEW
|
||||||
|
if (QWidget *window = w->window()) {
|
||||||
QWExtra *e = window->d_func()->extra;
|
QWExtra *e = window->d_func()->extra;
|
||||||
if (e && e->proxyWidget && e->proxyWidget->hasFocus() && window->focusWidget() == w)
|
if (e && e->proxyWidget && e->proxyWidget->hasFocus() && window->focusWidget() == w)
|
||||||
return true;
|
return true;
|
||||||
#endif
|
|
||||||
}
|
}
|
||||||
|
#endif // !QT_NO_GRAPHICSVIEW
|
||||||
return (QApplication::focusWidget() == w);
|
return (QApplication::focusWidget() == w);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -7918,8 +7918,11 @@ void QWidgetPrivate::show_sys()
|
|||||||
invalidateBuffer(q->rect());
|
invalidateBuffer(q->rect());
|
||||||
q->setAttribute(Qt::WA_Mapped);
|
q->setAttribute(Qt::WA_Mapped);
|
||||||
// add our window the modal window list (native dialogs)
|
// add our window the modal window list (native dialogs)
|
||||||
if ((q->isWindow() && (!extra || !extra->proxyWidget))
|
if (window && q->isWindow()
|
||||||
&& q->windowModality() != Qt::NonModal && window) {
|
#ifndef QT_NO_GRAPHICSVIEW
|
||||||
|
&& (!extra || !extra->proxyWidget)
|
||||||
|
#endif
|
||||||
|
&& q->windowModality() != Qt::NonModal) {
|
||||||
QGuiApplicationPrivate::showModalWindow(window);
|
QGuiApplicationPrivate::showModalWindow(window);
|
||||||
}
|
}
|
||||||
return;
|
return;
|
||||||
@ -8053,8 +8056,11 @@ void QWidgetPrivate::hide_sys()
|
|||||||
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
|
if (q->testAttribute(Qt::WA_DontShowOnScreen)) {
|
||||||
q->setAttribute(Qt::WA_Mapped, false);
|
q->setAttribute(Qt::WA_Mapped, false);
|
||||||
// remove our window from the modal window list (native dialogs)
|
// remove our window from the modal window list (native dialogs)
|
||||||
if ((q->isWindow() && (!extra || !extra->proxyWidget))
|
if (window && q->isWindow()
|
||||||
&& q->windowModality() != Qt::NonModal && window) {
|
#ifndef QT_NO_GRAPHICSVIEW
|
||||||
|
&& (!extra || !extra->proxyWidget)
|
||||||
|
#endif
|
||||||
|
&& q->windowModality() != Qt::NonModal) {
|
||||||
QGuiApplicationPrivate::hideModalWindow(window);
|
QGuiApplicationPrivate::hideModalWindow(window);
|
||||||
}
|
}
|
||||||
// do not return here, if window non-zero, we must hide it
|
// do not return here, if window non-zero, we must hide it
|
||||||
|
Loading…
x
Reference in New Issue
Block a user