summaryrefslogtreecommitdiffstats
path: root/src/widgets/kernel
diff options
context:
space:
mode:
authorFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-10-27 13:00:36 +0100
committerFrederik Gladhorn <frederik.gladhorn@theqtcompany.com>2014-10-27 13:00:36 +0100
commit2eb26c170920d28213b71e549d5dac4663febb14 (patch)
tree8df5223ac114d758c2112a8fc787992175556418 /src/widgets/kernel
parent49ddae28e0dcd1c59dd5d742cffedd5290d1224a (diff)
parent81998b4e8e440076bd22a9164f0a93481c0e597a (diff)
Merge remote-tracking branch 'origin/5.4' into dev
Conflicts: src/gui/text/qfontdatabase.cpp Change-Id: I6ac1f55faa22b8e7b591386fb67f0333d0ea443d
Diffstat (limited to 'src/widgets/kernel')
-rw-r--r--src/widgets/kernel/qlayout.cpp9
-rw-r--r--src/widgets/kernel/qstandardgestures.cpp4
-rw-r--r--src/widgets/kernel/qwidget.cpp38
3 files changed, 33 insertions, 18 deletions
diff --git a/src/widgets/kernel/qlayout.cpp b/src/widgets/kernel/qlayout.cpp
index 3900444df4..46cab90ab4 100644
--- a/src/widgets/kernel/qlayout.cpp
+++ b/src/widgets/kernel/qlayout.cpp
@@ -1106,15 +1106,6 @@ bool QLayout::activate()
ms.setWidth(mw->minimumSize().width());
if (heightSet)
ms.setHeight(mw->minimumSize().height());
- if ((!heightSet || !widthSet) && hasHeightForWidth()) {
- int h = minimumHeightForWidth(ms.width());
- if (h > ms.height()) {
- if (!heightSet)
- ms.setHeight(0);
- if (!widthSet)
- ms.setWidth(0);
- }
- }
mw->setMinimumSize(ms);
} else if (!widthSet || !heightSet) {
QSize ms = mw->minimumSize();
diff --git a/src/widgets/kernel/qstandardgestures.cpp b/src/widgets/kernel/qstandardgestures.cpp
index 78a2c65060..0822c04033 100644
--- a/src/widgets/kernel/qstandardgestures.cpp
+++ b/src/widgets/kernel/qstandardgestures.cpp
@@ -341,10 +341,10 @@ QGestureRecognizer::Result QSwipeGestureRecognizer::recognize(QGesture *state,
if (d->horizontalDirection == QSwipeGesture::NoDirection)
d->horizontalDirection = horizontal;
if (d->verticalDirection != vertical || d->horizontalDirection != horizontal) {
- // the user has changed the direction!
result = QGestureRecognizer::CancelGesture;
+ } else {
+ result = QGestureRecognizer::TriggerGesture;
}
- result = QGestureRecognizer::TriggerGesture;
} else {
if (q->state() != Qt::NoGesture)
result = QGestureRecognizer::TriggerGesture;
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
index af1745d845..63497ce745 100644
--- a/src/widgets/kernel/qwidget.cpp
+++ b/src/widgets/kernel/qwidget.cpp
@@ -1360,11 +1360,11 @@ void q_createNativeChildrenAndSetParent(const QWidget *parentWidget)
if (!childWidget->internalWinId())
childWidget->winId();
if (childWidget->windowHandle()) {
- QWindow *parentWindow = childWidget->nativeParentWidget()->windowHandle();
- if (childWidget->isWindow())
- childWidget->windowHandle()->setTransientParent(parentWindow);
- else
- childWidget->windowHandle()->setParent(parentWindow);
+ if (childWidget->isWindow()) {
+ childWidget->windowHandle()->setTransientParent(parentWidget->window()->windowHandle());
+ } else {
+ childWidget->windowHandle()->setParent(childWidget->nativeParentWidget()->windowHandle());
+ }
}
} else {
q_createNativeChildrenAndSetParent(childWidget);
@@ -1401,10 +1401,8 @@ 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)
@@ -9663,6 +9661,10 @@ QVariant QWidget::inputMethodQuery(Qt::InputMethodQuery query) const
is set, the input method may change its visual components to reflect
that only numbers can be entered.
+ \warning Some widgets require certain flags in order to work as
+ intended. To set a flag, do \c{w->setInputMethodHints(w->inputMethodHints()|f)}
+ instead of \c{w->setInputMethodHints(f)}.
+
\note The flags are only hints, so the particular input method
implementation is free to ignore them. If you want to be
sure that a certain type of characters are entered,
@@ -12250,6 +12252,17 @@ QPaintEngine *QWidget::paintEngine() const
*/
QPoint QWidget::mapToGlobal(const QPoint &pos) const
{
+#ifndef QT_NO_GRAPHICSVIEW
+ Q_D(const QWidget);
+ if (d->extra && d->extra->proxyWidget) {
+ const QList <QGraphicsView *> views = d->extra->proxyWidget->scene()->views();
+ if (!views.isEmpty()) {
+ const QPointF scenePos = d->extra->proxyWidget->mapToScene(pos);
+ const QPoint viewPortPos = views.first()->mapFromScene(scenePos);
+ return views.first()->viewport()->mapToGlobal(viewPortPos);
+ }
+ }
+#endif // !QT_NO_GRAPHICSVIEW
int x = pos.x(), y = pos.y();
const QWidget *w = this;
while (w) {
@@ -12274,6 +12287,17 @@ QPoint QWidget::mapToGlobal(const QPoint &pos) const
*/
QPoint QWidget::mapFromGlobal(const QPoint &pos) const
{
+#ifndef QT_NO_GRAPHICSVIEW
+ Q_D(const QWidget);
+ if (d->extra && d->extra->proxyWidget) {
+ const QList <QGraphicsView *> views = d->extra->proxyWidget->scene()->views();
+ if (!views.isEmpty()) {
+ const QPoint viewPortPos = views.first()->viewport()->mapFromGlobal(pos);
+ const QPointF scenePos = views.first()->mapToScene(viewPortPos);
+ return d->extra->proxyWidget->mapFromScene(scenePos).toPoint();
+ }
+ }
+#endif // !QT_NO_GRAPHICSVIEW
int x = pos.x(), y = pos.y();
const QWidget *w = this;
while (w) {