Merge remote-tracking branch 'origin/5.11' into dev

Change-Id: Ifce6ddeb4dab8c672732ec6aa6c19a6c4bce447e
bb10
Qt Forward Merge Bot 2018-03-05 13:15:31 +01:00
commit 954fe2c35d
11 changed files with 105 additions and 62 deletions

View File

@ -132,7 +132,7 @@ public class QtActivity extends Activity
}
public boolean super_dispatchPopulateAccessibilityEvent(AccessibilityEvent event)
{
return super_dispatchPopulateAccessibilityEvent(event);
return super.dispatchPopulateAccessibilityEvent(event);
}
//---------------------------------------------------------------------------

View File

@ -438,7 +438,6 @@ public abstract class QtLoader {
{
String key = BUNDLED_IN_LIB_RESOURCE_ID_KEY;
java.util.Set<String> keys = m_contextInfo.metaData.keySet();
if (m_contextInfo.metaData.containsKey(key)) {
String[] list = m_context.getResources().getStringArray(m_contextInfo.metaData.getInt(key));

View File

@ -1349,7 +1349,7 @@ QTextCursor QTextDocument::find(const QString &subString, int from, FindFlags op
If the given \a cursor has a selection, the search begins after the
selection; otherwise it begins at the cursor's position.
By default the search is case-sensitive, and can match text anywhere in the
By default the search is case insensitive, and can match text anywhere in the
document.
*/
QTextCursor QTextDocument::find(const QString &subString, const QTextCursor &cursor, FindFlags options) const
@ -1472,7 +1472,7 @@ QTextCursor QTextDocument::find(const QRegExp & expr, int from, FindFlags option
If the given \a cursor has a selection, the search begins after the
selection; otherwise it begins at the cursor's position.
By default the search is case-sensitive, and can match text anywhere in the
By default the search is case insensitive, and can match text anywhere in the
document.
*/
QTextCursor QTextDocument::find(const QRegExp &expr, const QTextCursor &cursor, FindFlags options) const
@ -1599,7 +1599,7 @@ QTextCursor QTextDocument::find(const QRegularExpression &expr, int from, FindFl
If the given \a cursor has a selection, the search begins after the
selection; otherwise it begins at the cursor's position.
By default the search is case-sensitive, and can match text anywhere in the
By default the search is case insensitive, and can match text anywhere in the
document.
*/
QTextCursor QTextDocument::find(const QRegularExpression &expr, const QTextCursor &cursor, FindFlags options) const

View File

@ -674,6 +674,9 @@ void Moc::parse()
if (test(NAMESPACE)) {
while (test(SCOPE) || test(IDENTIFIER))
;
// Ignore invalid code such as: 'using namespace __identifier("x")' (QTBUG-63772)
if (test(LPAREN))
until(RPAREN);
next(SEMIC);
}
break;

View File

@ -353,35 +353,35 @@ void QHeaderView::setModel(QAbstractItemModel *model)
Q_D(QHeaderView);
d->layoutChangePersistentSections.clear();
if (d->model && d->model != QAbstractItemModelPrivate::staticEmptyModel()) {
if (d->orientation == Qt::Horizontal) {
QObject::disconnect(d->model, SIGNAL(columnsInserted(QModelIndex,int,int)),
this, SLOT(sectionsInserted(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(sectionsAboutToBeRemoved(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsAboutToBeChanged()));
QObject::disconnect(d->model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsChanged()));
} else {
QObject::disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(sectionsInserted(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(sectionsAboutToBeRemoved(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsAboutToBeChanged()));
QObject::disconnect(d->model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsChanged()));
}
QObject::disconnect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
this, SLOT(headerDataChanged(Qt::Orientation,int,int)));
QObject::disconnect(d->model, SIGNAL(layoutAboutToBeChanged()),
this, SLOT(_q_sectionsAboutToBeChanged()));
QObject::disconnect(d->model, SIGNAL(layoutChanged()),
this, SLOT(_q_sectionsChanged()));
if (d->orientation == Qt::Horizontal) {
QObject::disconnect(d->model, SIGNAL(columnsInserted(QModelIndex,int,int)),
this, SLOT(sectionsInserted(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(columnsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(sectionsAboutToBeRemoved(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
QObject::disconnect(d->model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsMoved(QModelIndex,int,int,QModelIndex,int)));
} else {
QObject::disconnect(d->model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(sectionsInserted(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(rowsAboutToBeRemoved(QModelIndex,int,int)),
this, SLOT(sectionsAboutToBeRemoved(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
QObject::disconnect(d->model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
QObject::disconnect(d->model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsMoved(QModelIndex,int,int,QModelIndex,int)));
}
QObject::disconnect(d->model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
this, SLOT(headerDataChanged(Qt::Orientation,int,int)));
QObject::disconnect(d->model, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
this, SLOT(_q_sectionsAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
QObject::disconnect(d->model, SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
this, SLOT(_q_sectionsChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
}
if (model && model != QAbstractItemModelPrivate::staticEmptyModel()) {
@ -393,9 +393,9 @@ void QHeaderView::setModel(QAbstractItemModel *model)
QObject::connect(model, SIGNAL(columnsRemoved(QModelIndex,int,int)),
this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
QObject::connect(model, SIGNAL(columnsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsAboutToBeChanged()));
this, SLOT(_q_sectionsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
QObject::connect(model, SIGNAL(columnsMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsChanged()));
this, SLOT(_q_sectionsMoved(QModelIndex,int,int,QModelIndex,int)));
} else {
QObject::connect(model, SIGNAL(rowsInserted(QModelIndex,int,int)),
this, SLOT(sectionsInserted(QModelIndex,int,int)));
@ -404,16 +404,16 @@ void QHeaderView::setModel(QAbstractItemModel *model)
QObject::connect(model, SIGNAL(rowsRemoved(QModelIndex,int,int)),
this, SLOT(_q_sectionsRemoved(QModelIndex,int,int)));
QObject::connect(model, SIGNAL(rowsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsAboutToBeChanged()));
this, SLOT(_q_sectionsAboutToBeMoved(QModelIndex,int,int,QModelIndex,int)));
QObject::connect(model, SIGNAL(rowsMoved(QModelIndex,int,int,QModelIndex,int)),
this, SLOT(_q_sectionsChanged()));
this, SLOT(_q_sectionsMoved(QModelIndex,int,int,QModelIndex,int)));
}
QObject::connect(model, SIGNAL(headerDataChanged(Qt::Orientation,int,int)),
this, SLOT(headerDataChanged(Qt::Orientation,int,int)));
QObject::connect(model, SIGNAL(layoutAboutToBeChanged()),
this, SLOT(_q_sectionsAboutToBeChanged()));
QObject::connect(model, SIGNAL(layoutChanged()),
this, SLOT(_q_sectionsChanged()));
QObject::connect(model, SIGNAL(layoutAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
this, SLOT(_q_sectionsAboutToBeChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
QObject::connect(model, SIGNAL(layoutChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)),
this, SLOT(_q_sectionsChanged(QList<QPersistentModelIndex>,QAbstractItemModel::LayoutChangeHint)));
}
d->state = QHeaderViewPrivate::NoClear;
@ -2150,8 +2150,33 @@ void QHeaderViewPrivate::_q_sectionsRemoved(const QModelIndex &parent,
viewport->update();
}
void QHeaderViewPrivate::_q_sectionsAboutToBeChanged()
void QHeaderViewPrivate::_q_sectionsAboutToBeMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination)
{
if (sourceParent != root || destinationParent != root)
return; // we only handle changes in the root level
Q_UNUSED(logicalStart);
Q_UNUSED(logicalEnd);
Q_UNUSED(logicalDestination);
_q_sectionsAboutToBeChanged();
}
void QHeaderViewPrivate::_q_sectionsMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination)
{
if (sourceParent != root || destinationParent != root)
return; // we only handle changes in the root level
Q_UNUSED(logicalStart);
Q_UNUSED(logicalEnd);
Q_UNUSED(logicalDestination);
_q_sectionsChanged();
}
void QHeaderViewPrivate::_q_sectionsAboutToBeChanged(const QList<QPersistentModelIndex> &,
QAbstractItemModel::LayoutChangeHint hint)
{
if ((hint == QAbstractItemModel::VerticalSortHint && orientation == Qt::Horizontal) ||
(hint == QAbstractItemModel::HorizontalSortHint && orientation == Qt::Vertical))
return;
//if there is no row/column we can't have mapping for columns
//because no QModelIndex in the model would be valid
// ### this is far from being bullet-proof and we would need a real system to
@ -2190,8 +2215,13 @@ void QHeaderViewPrivate::_q_sectionsAboutToBeChanged()
}
}
void QHeaderViewPrivate::_q_sectionsChanged()
void QHeaderViewPrivate::_q_sectionsChanged(const QList<QPersistentModelIndex> &,
QAbstractItemModel::LayoutChangeHint hint)
{
if ((hint == QAbstractItemModel::VerticalSortHint && orientation == Qt::Horizontal) ||
(hint == QAbstractItemModel::HorizontalSortHint && orientation == Qt::Vertical))
return;
Q_Q(QHeaderView);
viewport->update();
@ -2282,8 +2312,8 @@ void QHeaderView::initializeSections()
const int oldCount = d->sectionCount();
const int newCount = d->modelSectionCount();
if (newCount <= 0) {
d->clear();
emit sectionCountChanged(oldCount, 0);
d->clear();
emit sectionCountChanged(oldCount, 0);
} else if (newCount != oldCount) {
const int min = qBound(0, oldCount, newCount - 1);
initializeSections(min, newCount - 1);
@ -3655,14 +3685,14 @@ void QHeaderViewPrivate::removeSectionsFromSectionItems(int start, int end)
void QHeaderViewPrivate::clear()
{
if (state != NoClear) {
length = 0;
visualIndices.clear();
logicalIndices.clear();
sectionSelected.clear();
hiddenSectionSize.clear();
sectionItems.clear();
lastSectionLogicalIdx = -1;
invalidateCachedSizeHint();
length = 0;
visualIndices.clear();
logicalIndices.clear();
sectionSelected.clear();
hiddenSectionSize.clear();
sectionItems.clear();
lastSectionLogicalIdx = -1;
invalidateCachedSizeHint();
}
}

View File

@ -251,9 +251,14 @@ protected:
friend class QTreeView;
private:
// ### Qt6: make them protected slots in QHeaderViewPrivate
Q_PRIVATE_SLOT(d_func(), void _q_sectionsRemoved(const QModelIndex &parent, int logicalFirst, int logicalLast))
Q_PRIVATE_SLOT(d_func(), void _q_sectionsAboutToBeChanged())
Q_PRIVATE_SLOT(d_func(), void _q_sectionsChanged())
Q_PRIVATE_SLOT(d_func(), void _q_sectionsAboutToBeMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination))
Q_PRIVATE_SLOT(d_func(), void _q_sectionsMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination))
Q_PRIVATE_SLOT(d_func(), void _q_sectionsAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(),
QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint))
Q_PRIVATE_SLOT(d_func(), void _q_sectionsChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(),
QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint))
Q_DECLARE_PRIVATE(QHeaderView)
Q_DISABLE_COPY(QHeaderView)
};

View File

@ -120,8 +120,12 @@ public:
void updateHiddenSections(int logicalFirst, int logicalLast);
void resizeSections(QHeaderView::ResizeMode globalMode, bool useGlobalMode = false);
void _q_sectionsRemoved(const QModelIndex &,int,int);
void _q_sectionsAboutToBeChanged();
void _q_sectionsChanged();
void _q_sectionsAboutToBeMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination);
void _q_sectionsMoved(const QModelIndex &sourceParent, int logicalStart, int logicalEnd, const QModelIndex &destinationParent, int logicalDestination);
void _q_sectionsAboutToBeChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(),
QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
void _q_sectionsChanged(const QList<QPersistentModelIndex> &parents = QList<QPersistentModelIndex>(),
QAbstractItemModel::LayoutChangeHint hint = QAbstractItemModel::NoLayoutChangeHint);
bool isSectionSelected(int section) const;
bool isFirstVisibleSection(int section) const;

View File

@ -11,6 +11,7 @@ ubuntu-16.04
[modalWindowEnterEventOnHide_QTBUG35109]
ubuntu-16.04
osx ci
windows ci
[modalDialogClosingOneOfTwoModal]
osx
[modalWindowModallity]

View File

@ -1729,9 +1729,6 @@ void tst_QWindow::tabletEvents()
void tst_QWindow::windowModality_QTBUG27039()
{
if (!QGuiApplication::platformName().compare(QLatin1String("wayland"), Qt::CaseInsensitive))
QSKIP("Wayland: This fails. Figure out why.");
QWindow parent;
parent.setGeometry(QRect(m_availableTopLeft + QPoint(10, 10), m_testWindowSize));
parent.show();
@ -2369,7 +2366,7 @@ void tst_QWindow::generatedMouseMove()
w.setGeometry(QRect(m_availableTopLeft + QPoint(100, 100), m_testWindowSize));
w.setFlags(w.flags() | Qt::FramelessWindowHint); // ### FIXME: QTBUG-63542
w.show();
QVERIFY(QTest::qWaitForWindowActive(&w));
QVERIFY(QTest::qWaitForWindowExposed(&w));
QPoint point(10, 10);
QPoint step(2, 2);

View File

@ -76,6 +76,7 @@ namespace FooNamespace {
#ifdef Q_MOC_RUN
namespace __identifier("<AtlImplementationDetails>") {} // QTBUG-56634
using namespace __identifier("<AtlImplementationDetails>"); // QTBUG-63772
#endif
#endif // NAMESPACE_H

View File

@ -16,3 +16,6 @@ xcb
xcb
[update2]
opensuse-42.3
[itemsInRect_cosmeticAdjust]
# QTBUG-66815
ubuntu-16.04