summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qapplication.cpp11
-rw-r--r--src/widgets/kernel/qapplication_qpa.cpp13
-rw-r--r--src/widgets/kernel/qtooltip.cpp4
-rw-r--r--src/widgets/kernel/qwidget.cpp6
-rw-r--r--src/widgets/kernel/qwindowcontainer.cpp11
5 files changed, 34 insertions, 11 deletions
diff --git a/src/widgets/kernel/qapplication.cpp b/src/widgets/kernel/qapplication.cpp
index 8d0a51606e..9c2c2bab16 100644
--- a/src/widgets/kernel/qapplication.cpp
+++ b/src/widgets/kernel/qapplication.cpp
@@ -337,6 +337,15 @@ QApplicationPrivate::~QApplicationPrivate()
*/
/*!
+ \fn QApplication::setGraphicsSystem(const QString &)
+ \obsolete
+
+ This call has no effect.
+
+ Use the QPA framework instead.
+*/
+
+/*!
\fn QWidget *QApplication::topLevelAt(const QPoint &point)
Returns the top-level widget at the given \a point; returns 0 if
@@ -360,6 +369,7 @@ QApplicationPrivate::~QApplicationPrivate()
void qt_init(QApplicationPrivate *priv, int type
);
+void qt_init_tooltip_palette();
void qt_cleanup();
QStyle *QApplicationPrivate::app_style = 0; // default application style
@@ -4022,6 +4032,7 @@ void QApplicationPrivate::notifyThemeChanged()
QGuiApplicationPrivate::notifyThemeChanged();
clearSystemPalette();
initSystemPalette();
+ qt_init_tooltip_palette();
}
#ifndef QT_NO_DRAGANDDROP
diff --git a/src/widgets/kernel/qapplication_qpa.cpp b/src/widgets/kernel/qapplication_qpa.cpp
index ccd6c2b03c..1c6bcfa9ce 100644
--- a/src/widgets/kernel/qapplication_qpa.cpp
+++ b/src/widgets/kernel/qapplication_qpa.cpp
@@ -447,6 +447,14 @@ void QApplication::alert(QWidget *widget, int duration)
}
}
+void qt_init_tooltip_palette()
+{
+#ifndef QT_NO_TOOLTIP
+ if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
+ QToolTip::setPalette(*toolTipPalette);
+#endif
+}
+
void qt_init(QApplicationPrivate *priv, int type)
{
Q_UNUSED(priv);
@@ -454,10 +462,7 @@ void qt_init(QApplicationPrivate *priv, int type)
QColormap::initialize();
-#ifndef QT_NO_TOOLTIP
- if (const QPalette *toolTipPalette = QGuiApplicationPrivate::platformTheme()->palette(QPlatformTheme::ToolTipPalette))
- QToolTip::setPalette(*toolTipPalette);
-#endif
+ qt_init_tooltip_palette();
QApplicationPrivate::initializeWidgetFontHash();
}
diff --git a/src/widgets/kernel/qtooltip.cpp b/src/widgets/kernel/qtooltip.cpp
index 5aea55e196..2b43fd7f6d 100644
--- a/src/widgets/kernel/qtooltip.cpp
+++ b/src/widgets/kernel/qtooltip.cpp
@@ -512,9 +512,9 @@ void QToolTip::showText(const QPoint &pos, const QString &text, QWidget *w, cons
else if (QApplication::isEffectEnabled(Qt::UI_AnimateTooltip))
qScrollEffect(QTipLabel::instance);
else
- QTipLabel::instance->show();
+ QTipLabel::instance->showNormal();
#else
- QTipLabel::instance->show();
+ QTipLabel::instance->showNormal();
#endif
}
}
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index 926db7febf..016abfa0dc 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -6006,10 +6006,8 @@ void QWidget::setFocus(Qt::FocusReason reason)
if (!(testAttribute(Qt::WA_WState_Created) && window()->windowType() != Qt::Popup && internalWinId()))
//setFocusWidget will already post a focus event for us (that the AT client receives) on Windows
# endif
-# ifdef Q_OS_UNIX
// menus update the focus manually and this would create bogus events
if (!(f->inherits("QMenuBar") || f->inherits("QMenu") || f->inherits("QMenuItem")))
-# endif
{
QAccessibleEvent event(f, QAccessible::Focus);
QAccessible::updateAccessibility(&event);
@@ -8530,6 +8528,8 @@ void QWidget::mouseReleaseEvent(QMouseEvent *event)
This event handler, for event \a event, can be reimplemented in a
subclass to receive mouse double click events for the widget.
+ The default implementation calls mousePressEvent().
+
\note The widget will also receive mouse press and mouse release
events in addition to the double click event. It is up to the
developer to ensure that the application interprets these events
@@ -8541,7 +8541,7 @@ void QWidget::mouseReleaseEvent(QMouseEvent *event)
void QWidget::mouseDoubleClickEvent(QMouseEvent *event)
{
- event->ignore();
+ mousePressEvent(event);
}
#ifndef QT_NO_WHEELEVENT
diff --git a/src/widgets/kernel/qwindowcontainer.cpp b/src/widgets/kernel/qwindowcontainer.cpp
index 4618e1c91d..1770e60c2e 100644
--- a/src/widgets/kernel/qwindowcontainer.cpp
+++ b/src/widgets/kernel/qwindowcontainer.cpp
@@ -1,6 +1,6 @@
/****************************************************************************
**
-** Copyright (C) 2012 Digia Plc and/or its subsidiary(-ies).
+** Copyright (C) 2014 Digia Plc and/or its subsidiary(-ies).
** Contact: http://www.qt-project.org/legal
**
** This file is part of the QtWidgets module of the Qt Toolkit.
@@ -72,7 +72,14 @@ public:
void updateGeometry() {
Q_Q(QWindowContainer);
- if (usesNativeWidgets)
+ if (q->geometry().bottom() <= 0 || q->geometry().right() <= 0)
+ /* Qt (e.g. QSplitter) sometimes prefer to hide a widget by *not* calling
+ setVisible(false). This is often done by setting its coordinates to a sufficiently
+ negative value so that its clipped outside the parent. Since a QWindow is not clipped
+ to widgets in general, it needs to be dealt with as a special case.
+ */
+ window->setGeometry(q->geometry());
+ else if (usesNativeWidgets)
window->setGeometry(q->rect());
else
window->setGeometry(QRect(q->mapTo(q->window(), QPoint()), q->size()));