summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp3
-rw-r--r--src/widgets/kernel/qwidget.cpp8
-rw-r--r--src/widgets/kernel/qwidget_qpa.cpp11
-rw-r--r--src/widgets/kernel/qwidgetwindow.cpp12
4 files changed, 21 insertions, 13 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 4bd306ed32..04d398206b 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -3625,6 +3625,9 @@ bool QApplication::keypadNavigationEnabled()
We recommend that widgets do not cache this value as it may change at any
time if the user changes the global desktop settings.
+
+ \note This property may hold a negative value, for instance if cursor
+ blinking is disabled.
*/
void QApplication::setCursorFlashTime(int msecs)
{
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 65e435fbdc..7396808442 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -2912,7 +2912,13 @@ void QWidget::showNormal()
This is the case if neither the widget itself nor every parent up
to but excluding \a ancestor has been explicitly disabled.
- isEnabledTo(0) is equivalent to isEnabled().
+ isEnabledTo(0) returns false if this widget or any if its ancestors
+ was explicitly disabled.
+
+ The word ancestor here means a parent widget within the same window.
+
+ Therefore isEnabledTo(0) stops at this widget's window, unlike
+ isEnabled() which also takes parent windows into considerations.
\sa setEnabled(), enabled
*/
diff --git a/src/widgets/kernel/qwidget_qpa.cpp b/src/widgets/kernel/qwidget_qpa.cpp
index e5f552679c..5a4bd33672 100644
--- a/src/widgets/kernel/qwidget_qpa.cpp
+++ b/src/widgets/kernel/qwidget_qpa.cpp
@@ -115,6 +115,10 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
win->setProperty(propertyName, q->property(propertyName));
}
+#ifdef Q_OS_OSX
+ if (q->testAttribute(Qt::WA_ShowWithoutActivating))
+ win->setProperty("_q_showWithoutActivating", QVariant(true));
+#endif
win->setFlags(data.window_flags);
fixPosIncludesFrame();
if (q->testAttribute(Qt::WA_Moved)
@@ -134,7 +138,7 @@ void QWidgetPrivate::create_sys(WId window, bool initializeWindow, bool destroyO
if (QWidget *nativeParent = q->nativeParentWidget()) {
if (nativeParent->windowHandle()) {
if (flags & Qt::Window) {
- win->setTransientParent(nativeParent->windowHandle());
+ win->setTransientParent(nativeParent->window()->windowHandle());
win->setParent(0);
} else {
win->setTransientParent(0);
@@ -779,7 +783,10 @@ void QWidgetPrivate::setGeometry_sys(int x, int y, int w, int h, bool isMove)
}
}
- if (isMove) {
+ // generate a move event for QWidgets without window handles. QWidgets with native
+ // window handles already receive a move event from
+ // QGuiApplicationPrivate::processGeometryChangeEvent.
+ if (isMove && (!q->windowHandle() || q->testAttribute(Qt::WA_DontShowOnScreen))) {
QMoveEvent e(q->pos(), oldPos);
QApplication::sendEvent(q, &e);
}
diff --git a/src/widgets/kernel/qwidgetwindow.cpp b/src/widgets/kernel/qwidgetwindow.cpp
index 35a526e77d..fc328e7af0 100644
--- a/src/widgets/kernel/qwidgetwindow.cpp
+++ b/src/widgets/kernel/qwidgetwindow.cpp
@@ -591,24 +591,16 @@ void QWidgetWindow::updateNormalGeometry()
void QWidgetWindow::handleMoveEvent(QMoveEvent *event)
{
- // If the widget's position already matches that of the event, this is a
- // result of call to QWidget::move(), which already sends an event.
- const bool spontaneous = m_widget->geometry().topLeft() != event->pos();
updateGeometry();
- if (spontaneous)
- QGuiApplication::sendSpontaneousEvent(m_widget, event);
+ QGuiApplication::sendSpontaneousEvent(m_widget, event);
}
void QWidgetWindow::handleResizeEvent(QResizeEvent *event)
{
QSize oldSize = m_widget->data->crect.size();
- // If the widget's size already matches that of the event, this is a
- // result of call to QWidget::resize(), which already sends an event.
- const bool spontaneous = oldSize != event->size();
updateGeometry();
- if (spontaneous)
- QGuiApplication::sendSpontaneousEvent(m_widget, event);
+ QGuiApplication::sendSpontaneousEvent(m_widget, event);
if (m_widget->d_func()->paintOnScreen()) {
QRegion updateRegion(geometry());