diff options
author | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-15 01:00:38 +0100 |
---|---|---|
committer | Qt Forward Merge Bot <qt_forward_merge_bot@qt-project.org> | 2020-01-15 01:00:39 +0100 |
commit | c3123c757a2301445ac286ce2c8af20959151e21 (patch) | |
tree | c8f5421725d0fe0cfe8a29136937e54d6f3f95c2 /src/widgets | |
parent | 2cbc5f6f7ae8ba580126a7cafc1898377c2a2407 (diff) | |
parent | 7a59d6f138ff8799170cc03d709525ab965d703a (diff) |
Merge remote-tracking branch 'origin/5.14' into 5.15
Change-Id: I8dbcf23835d52d3aa7d018ed250814d60c68aa83
Diffstat (limited to 'src/widgets')
-rw-r--r-- | src/widgets/dialogs/qfiledialog.cpp | 3 | ||||
-rw-r--r-- | src/widgets/dialogs/qfilesystemmodel.cpp | 3 | ||||
-rw-r--r-- | src/widgets/kernel/qshortcut.cpp | 2 | ||||
-rw-r--r-- | src/widgets/kernel/qwidget.cpp | 6 | ||||
-rw-r--r-- | src/widgets/widgets/qscrollbar.cpp | 10 |
5 files changed, 18 insertions, 6 deletions
diff --git a/src/widgets/dialogs/qfiledialog.cpp b/src/widgets/dialogs/qfiledialog.cpp index f0bd08a778..7c2c202cd6 100644 --- a/src/widgets/dialogs/qfiledialog.cpp +++ b/src/widgets/dialogs/qfiledialog.cpp @@ -2374,7 +2374,8 @@ QList<QUrl> QFileDialog::getOpenFileUrls(QWidget *parent, This function is used to access local files on Qt for WebAssembly, where the web sandbox places restrictions on how such access may happen. Its implementation will - make the browser display a native file dialog, where the user makes the file selection. + make the browser display a native file dialog, where the user makes the file selection + based on the parameter \a nameFilter. It can also be used on other platforms, where it will fall back to using QFileDialog. diff --git a/src/widgets/dialogs/qfilesystemmodel.cpp b/src/widgets/dialogs/qfilesystemmodel.cpp index d658f7fe0c..a723c3a955 100644 --- a/src/widgets/dialogs/qfilesystemmodel.cpp +++ b/src/widgets/dialogs/qfilesystemmodel.cpp @@ -1213,7 +1213,8 @@ QMimeData *QFileSystemModel::mimeData(const QModelIndexList &indexes) const /*! Handles the \a data supplied by a drag and drop operation that ended with the given \a action over the row in the model specified by the \a row and - \a column and by the \a parent index. + \a column and by the \a parent index. Returns true if the operation was + successful. \sa supportedDropActions() */ diff --git a/src/widgets/kernel/qshortcut.cpp b/src/widgets/kernel/qshortcut.cpp index 039699a004..d469279ea5 100644 --- a/src/widgets/kernel/qshortcut.cpp +++ b/src/widgets/kernel/qshortcut.cpp @@ -545,7 +545,7 @@ QShortcut::QShortcut(QWidget *parent) match the \a key sequence. Depending on the ambiguity of the event, the shortcut will call the \a member function, or the \a ambiguousMember function, if the key press was in the shortcut's - \a shortcutContext. + \a context. */ QShortcut::QShortcut(const QKeySequence &key, QWidget *parent, const char *member, const char *ambiguousMember, diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp index 767a1d2a8a..954b00eb35 100644 --- a/src/widgets/kernel/qwidget.cpp +++ b/src/widgets/kernel/qwidget.cpp @@ -5955,7 +5955,11 @@ void QWidget::setWindowTitle(const QString &title) has been set, windowIcon() returns the application icon (QApplication::windowIcon()). - \sa windowTitle + \note On \macos, window icons represent the active document, + and will not be displayed unless a file path has also been + set using setFilePath. + + \sa windowTitle, setFilePath */ QIcon QWidget::windowIcon() const { diff --git a/src/widgets/widgets/qscrollbar.cpp b/src/widgets/widgets/qscrollbar.cpp index 34ea017279..2ce1d50c86 100644 --- a/src/widgets/widgets/qscrollbar.cpp +++ b/src/widgets/widgets/qscrollbar.cpp @@ -497,14 +497,20 @@ bool QScrollBar::event(QEvent *event) void QScrollBar::wheelEvent(QWheelEvent *event) { event->ignore(); + bool horizontal = qAbs(event->angleDelta().x()) > qAbs(event->angleDelta().y()); + // The vertical wheel can be used to scroll a horizontal scrollbar, but only if + // there is no simultaneous horizontal wheel movement. This is to avoid chaotic + // scrolling on touchpads. + if (!horizontal && event->angleDelta().x() != 0 && orientation() == Qt::Horizontal) + return; // scrollbar is a special case - in vertical mode it reaches minimum // value in the upper position, however QSlider's minimum value is on // the bottom. So we need to invert the value, but since the scrollbar is // inverted by default, we need to invert the delta value only for the // horizontal orientation. - int delta = (orientation() == Qt::Horizontal ? -event->angleDelta().x() : event->angleDelta().y()); + int delta = horizontal ? -event->angleDelta().x() : event->angleDelta().y(); Q_D(QScrollBar); - if (d->scrollByDelta(orientation(), event->modifiers(), delta)) + if (d->scrollByDelta(horizontal ? Qt::Horizontal : Qt::Vertical, event->modifiers(), delta)) event->accept(); if (event->phase() == Qt::ScrollBegin) |