Merge remote-tracking branch 'origin/5.13' into 5.14

Change-Id: I31c1c469c00016f1bd21ecfab39794df372e56f2
This commit is contained in:
Qt Forward Merge Bot 2019-10-04 01:01:28 +02:00
commit e9f10dfe8c
5 changed files with 16 additions and 8 deletions

View File

@ -851,10 +851,14 @@ QT_END_NAMESPACE
#include "private/qcoreapplication_p.h" #include "private/qcoreapplication_p.h"
QT_WARNING_DISABLE_GCC("-Wattributes")
QT_WARNING_DISABLE_CLANG("-Wattributes")
QT_WARNING_DISABLE_INTEL(2621)
extern const char qt_core_interpreter[] __attribute__((section(".interp"))) extern const char qt_core_interpreter[] __attribute__((section(".interp")))
= ELF_INTERPRETER; = ELF_INTERPRETER;
extern "C" void qt_core_boilerplate(); extern "C" void qt_core_boilerplate() __attribute__((force_align_arg_pointer));
void qt_core_boilerplate() void qt_core_boilerplate()
{ {
printf("This is the QtCore library version " QT_BUILD_STR "\n" printf("This is the QtCore library version " QT_BUILD_STR "\n"

View File

@ -1051,7 +1051,7 @@ int lastIndexOf(const QList<T> &list, const U &u, int from)
Node *n = reinterpret_cast<Node *>(list.p.at(from + 1)); Node *n = reinterpret_cast<Node *>(list.p.at(from + 1));
while (n-- != b) { while (n-- != b) {
if (n->t() == u) if (n->t() == u)
return typename QList<T>::difference_type(n - b); return int(n - b);
} }
} }
return -1; return -1;

View File

@ -1776,8 +1776,8 @@ void QAbstractItemView::mousePressEvent(QMouseEvent *event)
QItemSelectionModel::SelectionFlags command = selectionCommand(index, event); QItemSelectionModel::SelectionFlags command = selectionCommand(index, event);
d->noSelectionOnMousePress = command == QItemSelectionModel::NoUpdate || !index.isValid(); d->noSelectionOnMousePress = command == QItemSelectionModel::NoUpdate || !index.isValid();
QPoint offset = d->offset(); QPoint offset = d->offset();
if ((command & QItemSelectionModel::Current) == 0) {
d->pressedPosition = pos + offset; d->pressedPosition = pos + offset;
if ((command & QItemSelectionModel::Current) == 0) {
d->currentSelectionStartIndex = index; d->currentSelectionStartIndex = index;
} }
else if (!d->currentSelectionStartIndex.isValid()) else if (!d->currentSelectionStartIndex.isValid())

View File

@ -748,11 +748,14 @@ QMimeData *QTreeModel::internalMimeData() const
QMimeData *QTreeModel::mimeData(const QModelIndexList &indexes) const QMimeData *QTreeModel::mimeData(const QModelIndexList &indexes) const
{ {
QList<QTreeWidgetItem*> items; QList<QTreeWidgetItem *> items;
for (const auto &index : indexes) { std::transform(indexes.begin(), indexes.end(), std::back_inserter(items),
if (index.column() == 0) // only one item per row [this](const QModelIndex &idx) -> QTreeWidgetItem * { return item(idx); });
items << item(index);
} // Ensure we only have one item as an item may have more than
// one index selected if there is more than one column
std::sort(items.begin(), items.end());
items.erase(std::unique(items.begin(), items.end()), items.end());
// cachedIndexes is a little hack to avoid copying from QModelIndexList to // cachedIndexes is a little hack to avoid copying from QModelIndexList to
// QList<QTreeWidgetItem*> and back again in the view // QList<QTreeWidgetItem*> and back again in the view

View File

@ -133,6 +133,7 @@ Qt::GestureType QGestureManager::registerGestureRecognizer(QGestureRecognizer *r
void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type) void QGestureManager::unregisterGestureRecognizer(Qt::GestureType type)
{ {
QList<QGestureRecognizer *> list = m_recognizers.values(type); QList<QGestureRecognizer *> list = m_recognizers.values(type);
m_recognizers.remove(type);
foreach (QGesture *g, m_gestureToRecognizer.keys()) { foreach (QGesture *g, m_gestureToRecognizer.keys()) {
QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g); QGestureRecognizer *recognizer = m_gestureToRecognizer.value(g);
if (list.contains(recognizer)) { if (list.contains(recognizer)) {