qt5-base:rebuild
This commit is contained in:
@@ -0,0 +1,115 @@
|
|||||||
|
From 4a04eea4f4316684e20c509352c6c533cf39306e Mon Sep 17 00:00:00 2001
|
||||||
|
From: David Faure <david.faure@kdab.com>
|
||||||
|
Date: Thu, 1 Mar 2018 11:04:00 +0100
|
||||||
|
Subject: QHeaderView: fix inconsistent saved state, ignored during restore
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
The code that updates a section size must also update length,
|
||||||
|
otherwise saveState can end up saving inconsistent state, and
|
||||||
|
restoreState() goes to an early-return, not doing anything.
|
||||||
|
|
||||||
|
The actual bug was fixed meanwhile because _q_sectionsChanged is called
|
||||||
|
again, which recalculates length. I still see this only as a safety
|
||||||
|
measure, every other code path that changes section sizes updates length
|
||||||
|
right away.
|
||||||
|
|
||||||
|
Change-Id: I6cc16261692d93b3640afafef600a5bdff8dca0c
|
||||||
|
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
|
||||||
|
---
|
||||||
|
src/widgets/itemviews/qheaderview.cpp | 6 ++-
|
||||||
|
.../widgets/itemviews/qtreeview/tst_qtreeview.cpp | 53 ++++++++++++++++++++++
|
||||||
|
2 files changed, 58 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
index 5cbf642802..b7048d1616 100644
|
||||||
|
--- a/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
+++ b/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
@@ -2191,7 +2191,11 @@ void QHeaderViewPrivate::_q_sectionsAboutToBeChanged(const QList<QPersistentMode
|
||||||
|
if (stretchLastSection && lastSectionLogicalIdx >= 0 && lastSectionLogicalIdx < sectionItems.count()) {
|
||||||
|
const int visual = visualIndex(lastSectionLogicalIdx);
|
||||||
|
if (visual >= 0 && visual < sectionItems.size()) {
|
||||||
|
- sectionItems[visual].size = lastSectionSize;
|
||||||
|
+ auto &itemRef = sectionItems[visual];
|
||||||
|
+ if (itemRef.size != lastSectionSize) {
|
||||||
|
+ length += lastSectionSize - itemRef.size;
|
||||||
|
+ itemRef.size = lastSectionSize;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
for (int i = 0; i < sectionItems.size(); ++i) {
|
||||||
|
diff --git a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
|
||||||
|
index 5293ba487a..347d2a81e6 100644
|
||||||
|
--- a/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
|
||||||
|
+++ b/tests/auto/widgets/itemviews/qtreeview/tst_qtreeview.cpp
|
||||||
|
@@ -162,6 +162,7 @@ private slots:
|
||||||
|
void renderToPixmap();
|
||||||
|
void styleOptionViewItem();
|
||||||
|
void keyboardNavigationWithDisabled();
|
||||||
|
+ void saveRestoreState();
|
||||||
|
|
||||||
|
void statusTip_data();
|
||||||
|
void statusTip();
|
||||||
|
@@ -4076,6 +4077,58 @@ void tst_QTreeView::keyboardNavigationWithDisabled()
|
||||||
|
QCOMPARE(view.currentIndex(), model.index(6, 0));
|
||||||
|
}
|
||||||
|
|
||||||
|
+class RemoveColumnOne : public QSortFilterProxyModel
|
||||||
|
+{
|
||||||
|
+public:
|
||||||
|
+ bool filterAcceptsColumn(int source_column, const QModelIndex &) const override
|
||||||
|
+ {
|
||||||
|
+ if (m_removeColumn)
|
||||||
|
+ return source_column != 1;
|
||||||
|
+ return true;
|
||||||
|
+ }
|
||||||
|
+ void removeColumn()
|
||||||
|
+ {
|
||||||
|
+ m_removeColumn = true;
|
||||||
|
+ invalidate();
|
||||||
|
+ }
|
||||||
|
+private:
|
||||||
|
+ bool m_removeColumn = false;
|
||||||
|
+};
|
||||||
|
+
|
||||||
|
+
|
||||||
|
+void tst_QTreeView::saveRestoreState()
|
||||||
|
+{
|
||||||
|
+ QStandardItemModel model;
|
||||||
|
+ for (int i = 0; i < 100; i++) {
|
||||||
|
+ QList<QStandardItem *> items;
|
||||||
|
+ items << new QStandardItem(QLatin1String("item ") + QString::number(i)) << new QStandardItem(QStringLiteral("hidden by proxy")) << new QStandardItem(QStringLiteral("hidden by user"));
|
||||||
|
+ model.appendRow(items);
|
||||||
|
+ }
|
||||||
|
+ QCOMPARE(model.columnCount(), 3);
|
||||||
|
+
|
||||||
|
+ RemoveColumnOne proxy;
|
||||||
|
+ proxy.setSourceModel(&model);
|
||||||
|
+ QCOMPARE(proxy.columnCount(), 3);
|
||||||
|
+
|
||||||
|
+ QTreeView view;
|
||||||
|
+ view.setModel(&proxy);
|
||||||
|
+ view.resize(500, 500);
|
||||||
|
+ view.show();
|
||||||
|
+ view.header()->hideSection(2);
|
||||||
|
+ QVERIFY(view.header()->isSectionHidden(2));
|
||||||
|
+ proxy.removeColumn();
|
||||||
|
+ QCOMPARE(proxy.columnCount(), 2);
|
||||||
|
+ QVERIFY(view.header()->isSectionHidden(1));
|
||||||
|
+ const QByteArray data = view.header()->saveState();
|
||||||
|
+
|
||||||
|
+ QTreeView view2;
|
||||||
|
+ view2.setModel(&proxy);
|
||||||
|
+ view2.resize(500, 500);
|
||||||
|
+ view2.show();
|
||||||
|
+ view2.header()->restoreState(data);
|
||||||
|
+ QVERIFY(view2.header()->isSectionHidden(1));
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
class Model_11466 : public QAbstractItemModel
|
||||||
|
{
|
||||||
|
Q_OBJECT
|
||||||
|
--
|
||||||
|
cgit v1.2.1
|
||||||
|
|
||||||
@@ -0,0 +1,165 @@
|
|||||||
|
From 9395f35cb18725995910531ca8b09f1d84efa96c Mon Sep 17 00:00:00 2001
|
||||||
|
From: Christian Ehrlicher <ch.ehrlicher@gmx.de>
|
||||||
|
Date: Sat, 17 Feb 2018 10:02:19 +0100
|
||||||
|
Subject: QHeaderView: Preserve settings on layoutChange with empty model
|
||||||
|
MIME-Version: 1.0
|
||||||
|
Content-Type: text/plain; charset=UTF-8
|
||||||
|
Content-Transfer-Encoding: 8bit
|
||||||
|
|
||||||
|
Do not clear the settings of QHeaderView during layoutChange when the
|
||||||
|
model is empty and the section count did not change. This will not work
|
||||||
|
when a section is moved or a section is replaced with a new one during
|
||||||
|
layoutChange. But since layoutChanged is also called on sorting, this
|
||||||
|
patch ensures that the settings are not cleared in this case.
|
||||||
|
This restores the behavior to the same as before 5.9.4.
|
||||||
|
|
||||||
|
Task-number: QTBUG-66444
|
||||||
|
Task-number: QTBUG-65478
|
||||||
|
Change-Id: I39989cfd45b42e58f49d18ec014d3a941cadb6c9
|
||||||
|
Reviewed-by: Thorbjørn Lund Martsum <tmartsum@gmail.com>
|
||||||
|
---
|
||||||
|
src/widgets/itemviews/qheaderview.cpp | 24 ++++++++
|
||||||
|
.../itemviews/qheaderview/tst_qheaderview.cpp | 71 ++++++++++++++++++++++
|
||||||
|
2 files changed, 95 insertions(+)
|
||||||
|
|
||||||
|
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
index edef2e9bf8..b0359de3ea 100644
|
||||||
|
--- a/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
+++ b/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
@@ -2205,6 +2205,30 @@ void QHeaderViewPrivate::_q_sectionsChanged()
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
+ bool hasPersistantIndexes = false;
|
||||||
|
+ for (const auto &item : oldPersistentSections) {
|
||||||
|
+ if (item.index.isValid()) {
|
||||||
|
+ hasPersistantIndexes = true;
|
||||||
|
+ break;
|
||||||
|
+ }
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ // Though far from perfect we here try to retain earlier/existing behavior
|
||||||
|
+ // ### See QHeaderViewPrivate::_q_layoutAboutToBeChanged()
|
||||||
|
+ // When we don't have valid hasPersistantIndexes it can be due to
|
||||||
|
+ // - all sections are default sections
|
||||||
|
+ // - the row/column 0 which is used for persistent indexes is gone
|
||||||
|
+ // - all non-default sections were removed
|
||||||
|
+ // case one is trivial, in case two we assume nothing else changed (it's the best
|
||||||
|
+ // guess we can do - everything else can not be handled correctly for now)
|
||||||
|
+ // case three can not be handled correctly with layoutChanged - removeSections
|
||||||
|
+ // should be used instead for this
|
||||||
|
+ if (!hasPersistantIndexes) {
|
||||||
|
+ if (oldCount != newCount)
|
||||||
|
+ q->initializeSections();
|
||||||
|
+ return;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
// adjust section size
|
||||||
|
if (newCount != oldCount) {
|
||||||
|
const int min = qBound(0, oldCount, newCount - 1);
|
||||||
|
diff --git a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
|
||||||
|
index c69c0de949..97aa8a0299 100644
|
||||||
|
--- a/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
|
||||||
|
+++ b/tests/auto/widgets/itemviews/qheaderview/tst_qheaderview.cpp
|
||||||
|
@@ -206,6 +206,7 @@ private slots:
|
||||||
|
void task248050_hideRow();
|
||||||
|
void QTBUG6058_reset();
|
||||||
|
void QTBUG7833_sectionClicked();
|
||||||
|
+ void checkLayoutChangeEmptyModel();
|
||||||
|
void QTBUG8650_crashOnInsertSections();
|
||||||
|
void QTBUG12268_hiddenMovedSectionSorting();
|
||||||
|
void QTBUG14242_hideSectionAutoSize();
|
||||||
|
@@ -286,6 +287,13 @@ public:
|
||||||
|
endInsertColumns();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ void removeFirstRow()
|
||||||
|
+ {
|
||||||
|
+ beginRemoveRows(QModelIndex(), 0, 0);
|
||||||
|
+ --rows;
|
||||||
|
+ endRemoveRows();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
void removeLastRow()
|
||||||
|
{
|
||||||
|
beginRemoveRows(QModelIndex(), rows - 1, rows - 1);
|
||||||
|
@@ -328,6 +336,24 @@ public:
|
||||||
|
emit layoutChanged();
|
||||||
|
}
|
||||||
|
|
||||||
|
+ void emitLayoutChanged()
|
||||||
|
+ {
|
||||||
|
+ emit layoutAboutToBeChanged();
|
||||||
|
+ emit layoutChanged();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
+ void emitLayoutChangedWithRemoveFirstRow()
|
||||||
|
+ {
|
||||||
|
+ emit layoutAboutToBeChanged();
|
||||||
|
+ QModelIndexList milNew;
|
||||||
|
+ const auto milOld = persistentIndexList();
|
||||||
|
+ milNew.reserve(milOld.size());
|
||||||
|
+ for (int i = 0; i < milOld.size(); ++i)
|
||||||
|
+ milNew += QModelIndex();
|
||||||
|
+ changePersistentIndexList(milOld, milNew);
|
||||||
|
+ emit layoutChanged();
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
int cols, rows;
|
||||||
|
mutable bool wrongIndex;
|
||||||
|
};
|
||||||
|
@@ -2332,6 +2358,51 @@ void tst_QHeaderView::QTBUG7833_sectionClicked()
|
||||||
|
QCOMPARE(pressedSpy.at(2).at(0).toInt(), 0);
|
||||||
|
}
|
||||||
|
|
||||||
|
+void tst_QHeaderView::checkLayoutChangeEmptyModel()
|
||||||
|
+{
|
||||||
|
+ QtTestModel tm;
|
||||||
|
+ tm.cols = 11;
|
||||||
|
+ QTableView tv;
|
||||||
|
+ tv.setModel(&tm);
|
||||||
|
+
|
||||||
|
+ const int section4Size = tv.horizontalHeader()->sectionSize(4) + 1;
|
||||||
|
+ const int section5Size = section4Size + 1;
|
||||||
|
+ tv.horizontalHeader()->resizeSection(4, section4Size);
|
||||||
|
+ tv.horizontalHeader()->resizeSection(5, section5Size);
|
||||||
|
+ tv.setColumnHidden(5, true);
|
||||||
|
+ tv.setColumnHidden(6, true);
|
||||||
|
+ tv.horizontalHeader()->swapSections(8, 10);
|
||||||
|
+
|
||||||
|
+ tv.sortByColumn(1, Qt::AscendingOrder);
|
||||||
|
+ tm.emitLayoutChanged();
|
||||||
|
+
|
||||||
|
+ QCOMPARE(tv.isColumnHidden(5), true);
|
||||||
|
+ QCOMPARE(tv.isColumnHidden(6), true);
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->sectionsMoved(), true);
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->logicalIndex(8), 10);
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->logicalIndex(10), 8);
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->sectionSize(4), section4Size);
|
||||||
|
+ tv.setColumnHidden(5, false); // unhide, section size must be properly restored
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->sectionSize(5), section5Size);
|
||||||
|
+ tv.setColumnHidden(5, true);
|
||||||
|
+
|
||||||
|
+ // adjust
|
||||||
|
+ tm.rows = 3;
|
||||||
|
+ tm.emitLayoutChanged();
|
||||||
|
+
|
||||||
|
+ // remove the row used for QPersistenModelIndexes
|
||||||
|
+ tm.emitLayoutChangedWithRemoveFirstRow();
|
||||||
|
+ QCOMPARE(tv.isColumnHidden(5), true);
|
||||||
|
+ QCOMPARE(tv.isColumnHidden(6), true);
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->sectionsMoved(), true);
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->logicalIndex(8), 10);
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->logicalIndex(10), 8);
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->sectionSize(4), section4Size);
|
||||||
|
+ tv.setColumnHidden(5, false); // unhide, section size must be properly restored
|
||||||
|
+ QCOMPARE(tv.horizontalHeader()->sectionSize(5), section5Size);
|
||||||
|
+ tv.setColumnHidden(5, true);
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
void tst_QHeaderView::QTBUG8650_crashOnInsertSections()
|
||||||
|
{
|
||||||
|
QStringList headerLabels;
|
||||||
|
--
|
||||||
|
cgit v1.2.1
|
||||||
|
|
||||||
@@ -0,0 +1,96 @@
|
|||||||
|
From e4e87a2ece1e0c9901514fea094f31863b64b570 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Andy Shaw <andy.shaw@qt.io>
|
||||||
|
Date: Wed, 7 Mar 2018 15:12:13 +0100
|
||||||
|
Subject: sqlite: Prevent a crash when sqlite does not detect any parameters
|
||||||
|
|
||||||
|
When using a virtual table inside a SQLite database it is possible that
|
||||||
|
it does not report the right number of parameters. Therefore we need
|
||||||
|
to account for this case to prevent it from crashing when trying to
|
||||||
|
bind parameters it thinks does not exist.
|
||||||
|
|
||||||
|
Task-number: QTBUG-66816
|
||||||
|
Change-Id: I3ff70bb1fe73091f43c3df53616f75858e451cfd
|
||||||
|
Reviewed-by: Jarek Kobus <jaroslaw.kobus@qt.io>
|
||||||
|
Reviewed-by: Edward Welbourne <edward.welbourne@qt.io>
|
||||||
|
---
|
||||||
|
src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp | 5 ++-
|
||||||
|
tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp | 41 +++++++++++++++++++++++
|
||||||
|
2 files changed, 45 insertions(+), 1 deletion(-)
|
||||||
|
|
||||||
|
diff --git a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
|
||||||
|
index d1a6582c5a..f715d3cba3 100644
|
||||||
|
--- a/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
|
||||||
|
+++ b/src/plugins/sqldrivers/sqlite/qsql_sqlite.cpp
|
||||||
|
@@ -467,7 +467,10 @@ bool QSQLiteResult::exec()
|
||||||
|
|
||||||
|
#if (SQLITE_VERSION_NUMBER >= 3003011)
|
||||||
|
// In the case of the reuse of a named placeholder
|
||||||
|
- if (paramCount < values.count()) {
|
||||||
|
+ // We need to check explicitly that paramCount is greater than 1, as sqlite
|
||||||
|
+ // can end up in a case where for virtual tables it returns 0 even though it
|
||||||
|
+ // has parameters
|
||||||
|
+ if (paramCount > 1 && paramCount < values.count()) {
|
||||||
|
const auto countIndexes = [](int counter, const QList<int>& indexList) {
|
||||||
|
return counter + indexList.length();
|
||||||
|
};
|
||||||
|
diff --git a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
|
||||||
|
index a51865897f..c4a27a3175 100644
|
||||||
|
--- a/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
|
||||||
|
+++ b/tests/auto/sql/kernel/qsqlquery/tst_qsqlquery.cpp
|
||||||
|
@@ -176,6 +176,8 @@ private slots:
|
||||||
|
void emptyTableNavigate();
|
||||||
|
void timeStampParsing_data() { generic_data(); }
|
||||||
|
void timeStampParsing();
|
||||||
|
+ void sqliteVirtualTable_data() { generic_data("QSQLITE"); }
|
||||||
|
+ void sqliteVirtualTable();
|
||||||
|
|
||||||
|
#ifdef NOT_READY_YET
|
||||||
|
void task_229811();
|
||||||
|
@@ -4623,5 +4625,44 @@ void tst_QSqlQuery::dateTime()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
+void tst_QSqlQuery::sqliteVirtualTable()
|
||||||
|
+{
|
||||||
|
+ // Virtual tables can behave differently when it comes to prepared
|
||||||
|
+ // queries, so we need to check these explicitly
|
||||||
|
+ QFETCH(QString, dbName);
|
||||||
|
+ QSqlDatabase db = QSqlDatabase::database(dbName);
|
||||||
|
+ CHECK_DATABASE(db);
|
||||||
|
+ const auto tableName = qTableName("sqliteVirtual", __FILE__, db);
|
||||||
|
+ QSqlQuery qry(db);
|
||||||
|
+ QVERIFY_SQL(qry, exec("create virtual table " + tableName + " using fts3(id, name)"));
|
||||||
|
+
|
||||||
|
+ // Delibrately malform the query to try and provoke a potential crash situation
|
||||||
|
+ QVERIFY_SQL(qry, prepare("select * from " + tableName + " where name match '?'"));
|
||||||
|
+ qry.addBindValue("Andy");
|
||||||
|
+ QVERIFY(!qry.exec());
|
||||||
|
+
|
||||||
|
+ QVERIFY_SQL(qry, prepare("insert into " + tableName + "(id, name) VALUES (?, ?)"));
|
||||||
|
+ qry.addBindValue(1);
|
||||||
|
+ qry.addBindValue("Andy");
|
||||||
|
+ QVERIFY_SQL(qry, exec());
|
||||||
|
+
|
||||||
|
+ QVERIFY_SQL(qry, exec("select * from " + tableName));
|
||||||
|
+ QVERIFY(qry.next());
|
||||||
|
+ QCOMPARE(qry.value(0).toInt(), 1);
|
||||||
|
+ QCOMPARE(qry.value(1).toString(), "Andy");
|
||||||
|
+
|
||||||
|
+ QVERIFY_SQL(qry, prepare("insert into " + tableName + "(id, name) values (:id, :name)"));
|
||||||
|
+ qry.bindValue(":id", 2);
|
||||||
|
+ qry.bindValue(":name", "Peter");
|
||||||
|
+ QVERIFY_SQL(qry, exec());
|
||||||
|
+
|
||||||
|
+ QVERIFY_SQL(qry, prepare("select * from " + tableName + " where name match ?"));
|
||||||
|
+ qry.addBindValue("Peter");
|
||||||
|
+ QVERIFY_SQL(qry, exec());
|
||||||
|
+ QVERIFY(qry.next());
|
||||||
|
+ QCOMPARE(qry.value(0).toInt(), 2);
|
||||||
|
+ QCOMPARE(qry.value(1).toString(), "Peter");
|
||||||
|
+}
|
||||||
|
+
|
||||||
|
QTEST_MAIN( tst_QSqlQuery )
|
||||||
|
#include "tst_qsqlquery.moc"
|
||||||
|
--
|
||||||
|
cgit v1.2.1
|
||||||
|
|
||||||
@@ -0,0 +1,86 @@
|
|||||||
|
From fa091640134b3ff99a9eb92df8286d15203122bf Mon Sep 17 00:00:00 2001
|
||||||
|
From: Antonio Larrosa <alarrosa@suse.com>
|
||||||
|
Date: Fri, 16 Feb 2018 13:18:42 +0100
|
||||||
|
Subject: opengl: Bail if cached shader fails to load
|
||||||
|
|
||||||
|
QOpenGLProgramBinaryCache::setProgramBinary() should check
|
||||||
|
GL_LINK_STATUS after glProgramBinary(), but doesn't.
|
||||||
|
|
||||||
|
In practice, this means that SDDM is a white screen, and KDE is just
|
||||||
|
a gray task bar.
|
||||||
|
|
||||||
|
So far, Qt tries to check this using its internal ::link() function.
|
||||||
|
But in case the cached binary fails to load, Qt currently attempts to
|
||||||
|
link the inexistent program, resulting in a zero-length, fixed
|
||||||
|
pipeline shader.
|
||||||
|
|
||||||
|
Checking this already in ::setProgramBinary() makes the call to
|
||||||
|
::link() superfluous, so we remove that as well.
|
||||||
|
|
||||||
|
Done-with: Max Staudt <mstaudt@suse.com>
|
||||||
|
Done-with: Michal Srb <msrb@suse.com>
|
||||||
|
Done-with: Fabian Vogt <fvogt@suse.de>
|
||||||
|
Task-number: QTBUG-66420
|
||||||
|
Change-Id: Iabb51d0eb2c0c16bde696efff623e57d15f28d82
|
||||||
|
Reviewed-by: Jesus Fernandez <Jesus.Fernandez@qt.io>
|
||||||
|
Reviewed-by: Laszlo Agocs <laszlo.agocs@qt.io>
|
||||||
|
---
|
||||||
|
src/gui/opengl/qopenglprogrambinarycache.cpp | 20 ++++++++++++++++++--
|
||||||
|
src/gui/opengl/qopenglshaderprogram.cpp | 8 +-------
|
||||||
|
2 files changed, 19 insertions(+), 9 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/gui/opengl/qopenglprogrambinarycache.cpp b/src/gui/opengl/qopenglprogrambinarycache.cpp
|
||||||
|
index 06373e1113..d16173df83 100644
|
||||||
|
--- a/src/gui/opengl/qopenglprogrambinarycache.cpp
|
||||||
|
+++ b/src/gui/opengl/qopenglprogrambinarycache.cpp
|
||||||
|
@@ -161,10 +161,26 @@ bool QOpenGLProgramBinaryCache::setProgramBinary(uint programId, uint blobFormat
|
||||||
|
QOpenGLExtraFunctions *funcs = QOpenGLContext::currentContext()->extraFunctions();
|
||||||
|
while (funcs->glGetError() != GL_NO_ERROR) { }
|
||||||
|
funcs->glProgramBinary(programId, blobFormat, p, blobSize);
|
||||||
|
- int err = funcs->glGetError();
|
||||||
|
+
|
||||||
|
+ GLenum err = funcs->glGetError();
|
||||||
|
+ if (err != GL_NO_ERROR) {
|
||||||
|
+ qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, "
|
||||||
|
+ "format 0x%x, err = 0x%x",
|
||||||
|
+ programId, blobSize, blobFormat, err);
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+ GLint linkStatus = 0;
|
||||||
|
+ funcs->glGetProgramiv(programId, GL_LINK_STATUS, &linkStatus);
|
||||||
|
+ if (linkStatus != GL_TRUE) {
|
||||||
|
+ qCDebug(DBG_SHADER_CACHE, "Program binary failed to load for program %u, size %d, "
|
||||||
|
+ "format 0x%x, linkStatus = 0x%x, err = 0x%x",
|
||||||
|
+ programId, blobSize, blobFormat, linkStatus, err);
|
||||||
|
+ return false;
|
||||||
|
+ }
|
||||||
|
+
|
||||||
|
qCDebug(DBG_SHADER_CACHE, "Program binary set for program %u, size %d, format 0x%x, err = 0x%x",
|
||||||
|
programId, blobSize, blobFormat, err);
|
||||||
|
- return err == 0;
|
||||||
|
+ return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
#ifdef Q_OS_UNIX
|
||||||
|
diff --git a/src/gui/opengl/qopenglshaderprogram.cpp b/src/gui/opengl/qopenglshaderprogram.cpp
|
||||||
|
index b044397f8e..1fe30f7e0e 100644
|
||||||
|
--- a/src/gui/opengl/qopenglshaderprogram.cpp
|
||||||
|
+++ b/src/gui/opengl/qopenglshaderprogram.cpp
|
||||||
|
@@ -3824,13 +3824,7 @@ bool QOpenGLShaderProgramPrivate::linkBinary()
|
||||||
|
bool needsCompile = true;
|
||||||
|
if (binCache.load(cacheKey, q->programId())) {
|
||||||
|
qCDebug(DBG_SHADER_CACHE, "Program binary received from cache");
|
||||||
|
- linkBinaryRecursion = true;
|
||||||
|
- bool ok = q->link();
|
||||||
|
- linkBinaryRecursion = false;
|
||||||
|
- if (ok)
|
||||||
|
- needsCompile = false;
|
||||||
|
- else
|
||||||
|
- qCDebug(DBG_SHADER_CACHE, "Link failed after glProgramBinary");
|
||||||
|
+ needsCompile = false;
|
||||||
|
}
|
||||||
|
|
||||||
|
bool needsSave = false;
|
||||||
|
--
|
||||||
|
cgit v1.2.1
|
||||||
|
|
||||||
@@ -0,0 +1,31 @@
|
|||||||
|
From e8425f9e52c9df0ce0fbf122adff3ef6930f9961 Mon Sep 17 00:00:00 2001
|
||||||
|
From: =?UTF-8?q?Thorbj=C3=B8rn=20Lund=20Martsum?= <tmartsum@gmail.com>
|
||||||
|
Date: Wed, 28 Feb 2018 09:23:54 +0100
|
||||||
|
Subject: QHeaderView: Fix crash in layout about to change
|
||||||
|
|
||||||
|
Before there was a risk looking up e.g index -1 if there
|
||||||
|
were no visible sections in layoutAboutToChange.
|
||||||
|
|
||||||
|
Change-Id: Ic911e4292e8e8c4892fef1c0f34cf7dccaad2bac
|
||||||
|
Task-number: QTBUG-65478
|
||||||
|
Reviewed-by: David Faure <david.faure@kdab.com>
|
||||||
|
---
|
||||||
|
diff --git a/src/widgets/itemviews/qheaderview.cpp b/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
index 26d7c5472a..708b9b44ca 100644
|
||||||
|
--- a/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
+++ b/src/widgets/itemviews/qheaderview.cpp
|
||||||
|
@@ -2163,9 +2163,11 @@ void QHeaderViewPrivate::_q_sectionsAboutToBeChanged()
|
||||||
|
layoutChangePersistentSections.clear();
|
||||||
|
layoutChangePersistentSections.reserve(std::min(10, sectionItems.count()));
|
||||||
|
// after layoutChanged another section can be last stretched section
|
||||||
|
- if (stretchLastSection) {
|
||||||
|
+ if (stretchLastSection && lastSectionLogicalIdx >= 0 && lastSectionLogicalIdx < sectionItems.count()) {
|
||||||
|
const int visual = visualIndex(lastSectionLogicalIdx);
|
||||||
|
- sectionItems[visual].size = lastSectionSize;
|
||||||
|
+ if (visual >= 0 && visual < sectionItems.size()) {
|
||||||
|
+ sectionItems[visual].size = lastSectionSize;
|
||||||
|
+ }
|
||||||
|
}
|
||||||
|
for (int i = 0; i < sectionItems.size(); ++i) {
|
||||||
|
auto s = sectionItems.at(i);
|
||||||
|
|
||||||
+71
@@ -0,0 +1,71 @@
|
|||||||
|
From f4bc1f620727366b6a977b106cc68fade95ef426 Mon Sep 17 00:00:00 2001
|
||||||
|
From: Evangelos Foutras <evangelos@foutrelis.com>
|
||||||
|
Date: Wed, 21 Feb 2018 04:20:20 +0200
|
||||||
|
Subject: [PATCH] Revert "Set sharedPainter correctly for QGraphicsEffect"
|
||||||
|
|
||||||
|
This reverts commit 7257862fb2edfab0219d6cd45c83677049404f7d.
|
||||||
|
---
|
||||||
|
src/widgets/kernel/qwidget.cpp | 4 ++--
|
||||||
|
.../effects/qgraphicseffect/tst_qgraphicseffect.cpp | 21 ---------------------
|
||||||
|
2 files changed, 2 insertions(+), 23 deletions(-)
|
||||||
|
|
||||||
|
diff --git a/src/widgets/kernel/qwidget.cpp b/src/widgets/kernel/qwidget.cpp
|
||||||
|
index a973bee2cd..256c77e5a0 100644
|
||||||
|
--- a/src/widgets/kernel/qwidget.cpp
|
||||||
|
+++ b/src/widgets/kernel/qwidget.cpp
|
||||||
|
@@ -5482,11 +5482,11 @@ void QWidgetPrivate::drawWidget(QPaintDevice *pdev, const QRegion &rgn, const QP
|
||||||
|
setSystemClip(pdev->paintEngine(), pdev->devicePixelRatioF(), rgn.translated(offset));
|
||||||
|
QPainter p(pdev);
|
||||||
|
p.translate(offset);
|
||||||
|
- context.painter = context.sharedPainter = &p;
|
||||||
|
+ context.painter = &p;
|
||||||
|
graphicsEffect->draw(&p);
|
||||||
|
setSystemClip(pdev->paintEngine(), 1, QRegion());
|
||||||
|
} else {
|
||||||
|
- context.painter = context.sharedPainter = sharedPainter;
|
||||||
|
+ context.painter = sharedPainter;
|
||||||
|
if (sharedPainter->worldTransform() != sourced->lastEffectTransform) {
|
||||||
|
sourced->invalidateCache();
|
||||||
|
sourced->lastEffectTransform = sharedPainter->worldTransform();
|
||||||
|
diff --git a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
|
||||||
|
index dfe5baba71..a1cb729849 100644
|
||||||
|
--- a/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
|
||||||
|
+++ b/tests/auto/widgets/effects/qgraphicseffect/tst_qgraphicseffect.cpp
|
||||||
|
@@ -52,7 +52,6 @@ private slots:
|
||||||
|
void boundingRect2();
|
||||||
|
void draw();
|
||||||
|
void opacity();
|
||||||
|
- void nestedOpaqueOpacity();
|
||||||
|
void grayscale();
|
||||||
|
void colorize();
|
||||||
|
void drawPixmapItem();
|
||||||
|
@@ -408,26 +407,6 @@ void tst_QGraphicsEffect::opacity()
|
||||||
|
QCOMPARE(effect->m_opacity, qreal(0.5));
|
||||||
|
}
|
||||||
|
|
||||||
|
-void tst_QGraphicsEffect::nestedOpaqueOpacity()
|
||||||
|
-{
|
||||||
|
- // QTBUG-60231: Nesting widgets with a QGraphicsEffect on a toplevel with
|
||||||
|
- // QGraphicsOpacityEffect caused crashes due to constructing several
|
||||||
|
- // QPainter instances on a device in the fast path for
|
||||||
|
- // QGraphicsOpacityEffect::opacity=1
|
||||||
|
- QWidget topLevel;
|
||||||
|
- topLevel.setWindowTitle(QTest::currentTestFunction());
|
||||||
|
- topLevel.resize(320, 200);
|
||||||
|
- QGraphicsOpacityEffect *opacityEffect = new QGraphicsOpacityEffect;
|
||||||
|
- opacityEffect->setOpacity(1);
|
||||||
|
- topLevel.setGraphicsEffect(opacityEffect);
|
||||||
|
- QWidget *child = new QWidget(&topLevel);
|
||||||
|
- child->resize(topLevel.size() / 2);
|
||||||
|
- QGraphicsDropShadowEffect *childEffect = new QGraphicsDropShadowEffect;
|
||||||
|
- child->setGraphicsEffect(childEffect);
|
||||||
|
- topLevel.show();
|
||||||
|
- QVERIFY(QTest::qWaitForWindowExposed(&topLevel));
|
||||||
|
-}
|
||||||
|
-
|
||||||
|
void tst_QGraphicsEffect::grayscale()
|
||||||
|
{
|
||||||
|
if (qApp->desktop()->depth() < 24)
|
||||||
|
--
|
||||||
|
2.16.2
|
||||||
|
|
||||||
@@ -73,9 +73,12 @@
|
|||||||
<Patches>
|
<Patches>
|
||||||
<!-- Pisilinux Patches -->
|
<!-- Pisilinux Patches -->
|
||||||
<Patch>mkspecs.patch</Patch>
|
<Patch>mkspecs.patch</Patch>
|
||||||
<Patch>qt5-qtbase-5.9.1-firebird.patch</Patch>
|
<Patch level="1">revert-Set-sharedPainter-correctly-for-QGraphicsEffect.patch</Patch>
|
||||||
<Patch>qtbase-opensource-src-5.9.0-mysql.patch</Patch>
|
<Patch level="1">qtbug-65478.patch</Patch>
|
||||||
<Patch>qtbase-opensource-src-5.8.0-QT_VERSION_CHECK.patch</Patch>
|
<Patch level="1">4a04eea4.patch</Patch>
|
||||||
|
<Patch level="1">9395f35c.patch</Patch>
|
||||||
|
<Patch level="1">fa091640.patch</Patch>
|
||||||
|
<Patch level="1">e4e87a2e.patch</Patch>
|
||||||
<!-- <Patch>qtbase-mariadb.patch</Patch> -->
|
<!-- <Patch>qtbase-mariadb.patch</Patch> -->
|
||||||
<!-- <Patch>qtbase-opensource-src-5.9.3-QTBUG-64742-out-of-bounds-in-qdnslookup_unix.patch</Patch> -->
|
<!-- <Patch>qtbase-opensource-src-5.9.3-QTBUG-64742-out-of-bounds-in-qdnslookup_unix.patch</Patch> -->
|
||||||
</Patches>
|
</Patches>
|
||||||
@@ -260,7 +263,7 @@
|
|||||||
|
|
||||||
<History>
|
<History>
|
||||||
<Update release="9">
|
<Update release="9">
|
||||||
<Date>2018-08-03</Date>
|
<Date>2018-08-28</Date>
|
||||||
<Version>5.10.1</Version>
|
<Version>5.10.1</Version>
|
||||||
<Comment>Version bump</Comment>
|
<Comment>Version bump</Comment>
|
||||||
<Name>Mustafa Cinasal</Name>
|
<Name>Mustafa Cinasal</Name>
|
||||||
|
|||||||
Reference in New Issue
Block a user