From 1f6ec34d46bc36ff9396e5e865af81cecf310cc3 Mon Sep 17 00:00:00 2001 From: Shane Kearns Date: Fri, 2 Dec 2011 14:56:28 +0000 Subject: symbian - don't export qsymbianbearer.qtplugin twice The file was being exported using both prj_exports and deployment lines. As deployment is copying to epoc32 z and c directories, the prj_exports is not needed. Moved the prj_exports rules into the S60 5.0 section, where deployment is not used but rather explicit rules added to the sis file. Task-number: ou1cimx1#946574 Reviewed-by: mread --- src/s60installs/s60installs.pro | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/s60installs/s60installs.pro b/src/s60installs/s60installs.pro index 08c4829..d5281f4 100755 --- a/src/s60installs/s60installs.pro +++ b/src/s60installs/s60installs.pro @@ -34,9 +34,6 @@ symbian: { pluginLocations = $${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET) bearerPluginLocation = $${EPOCROOT}epoc32/release/$(PLATFORM)/$(TARGET) bearerStubZ = $${EPOCROOT}$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin - BLD_INF_RULES.prj_exports += \ - "$$S60_INSTALLS_SOURCE_DIR/qsymbianbearer.qtplugin /$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" \ - "$$S60_INSTALLS_SOURCE_DIR/qsymbianbearer.qtplugin /epoc32/winscw/c$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" } else { pluginLocations = $$QT_BUILD_TREE/plugins/s60 bearerPluginLocation = $$QT_BUILD_TREE/plugins/bearer @@ -54,6 +51,9 @@ symbian: { "ENDIF" \ " \"$$bearerStubZ\" - \"c:$$replace(QT_PLUGINS_BASE_DIR,/,\\)\\bearer\\qsymbianbearer$${QT_LIBINFIX}.qtplugin\"" qtlibraries.pkg_postrules += qts60plugindeployment + BLD_INF_RULES.prj_exports += \ + "$$S60_INSTALLS_SOURCE_DIR/qsymbianbearer.qtplugin /$${HW_ZDIR}$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" \ + "$$S60_INSTALLS_SOURCE_DIR/qsymbianbearer.qtplugin /epoc32/winscw/c$${QT_PLUGINS_BASE_DIR}/bearer/qsymbianbearer$${QT_LIBINFIX}.qtplugin" } else { # No need to deploy plugins for older platform versions when building on Symbian3 or later bearer_plugin.files = $$QT_BUILD_TREE/plugins/bearer/qsymbianbearer$${QT_LIBINFIX}.dll -- cgit v0.12 From 147ea1d18482c1f64749db52c622dded075dc66c Mon Sep 17 00:00:00 2001 From: Honglei Zhang Date: Mon, 5 Dec 2011 15:05:16 +0200 Subject: QSqlRelationalTableModel doesn't follow relations on the first column QSqlRelationalTableModel doesn't follow relations on the first column of a table. The DisplayRole and the EditRole for indexes on column 0 are always the same. The bug is found in QSqlRelationalTableModel::data. Task-number: QTBUG-20038 Reviewed-by: Charles Yin --- src/sql/models/qsqlrelationaltablemodel.cpp | 2 +- .../tst_qsqlrelationaltablemodel.cpp | 55 ++++++++++++++++++++++ 2 files changed, 56 insertions(+), 1 deletion(-) diff --git a/src/sql/models/qsqlrelationaltablemodel.cpp b/src/sql/models/qsqlrelationaltablemodel.cpp index 0edfaf4..c5764a7 100644 --- a/src/sql/models/qsqlrelationaltablemodel.cpp +++ b/src/sql/models/qsqlrelationaltablemodel.cpp @@ -430,7 +430,7 @@ QVariant QSqlRelationalTableModel::data(const QModelIndex &index, int role) cons { Q_D(const QSqlRelationalTableModel); - if (role == Qt::DisplayRole && index.column() > 0 && index.column() < d->relations.count() && + if (role == Qt::DisplayRole && index.column() >= 0 && index.column() < d->relations.count() && d->relations.value(index.column()).isValid()) { QRelation &relation = d->relations[index.column()]; if (!relation.isDictionaryInitialized()) diff --git a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp index 5f1a621..5ecf514 100644 --- a/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp +++ b/tests/auto/qsqlrelationaltablemodel/tst_qsqlrelationaltablemodel.cpp @@ -93,6 +93,7 @@ private slots: void whiteSpaceInIdentifiers(); void psqlSchemaTest(); void selectAfterUpdate(); + void relationOnFirstColumn(); private: void dropTestTables( QSqlDatabase db ); @@ -1490,5 +1491,59 @@ void tst_QSqlRelationalTableModel::selectAfterUpdate() QCOMPARE(model.data(model.index(0,2)), QVariant("mrs")); } +/** + This test case verifies bug fix for QTBUG-20038. + */ +void tst_QSqlRelationalTableModel::relationOnFirstColumn() +{ + QFETCH_GLOBAL(QString, dbName); + QSqlDatabase db = QSqlDatabase::database(dbName); + CHECK_DATABASE(db); + + QString testTable1 = qTableName("QTBUG_20038_test1", __FILE__); + QString testTable2 = qTableName("QTBUG_20038_test2", __FILE__); + tst_Databases::safeDropTables(db, QStringList() << testTable1 << testTable2); + + //prepare test1 table + QSqlQuery q(db); + QVERIFY_SQL(q, exec("CREATE TABLE " + testTable1 + " (val1 INTEGER, id1 INTEGER PRIMARY KEY);")); + QVERIFY_SQL(q, exec("DELETE FROM " + testTable1 + ";")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(1, 10);")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(2, 20);")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable1 + " (id1, val1) VALUES(3, 30);")); + + //prepare test2 table + QVERIFY_SQL(q, exec("CREATE TABLE " + testTable2 + " (id INTEGER PRIMARY KEY, name TEXT);")); + QVERIFY_SQL(q, exec("DELETE FROM " + testTable2 + ";")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (10, 'Hervanta');")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (20, 'Keskusta');")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (30, 'Annala');")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (40, 'Tammela');")); + QVERIFY_SQL(q, exec("INSERT INTO " + testTable2 + " (id, name) VALUES (50, 'Amuri');")); + + //set test model + QSqlRelationalTableModel model(NULL, db); + model.setTable(testTable1); + model.setRelation(0, QSqlRelation(testTable2, "id", "name")); + QVERIFY_SQL(model, select()); + + //verify the data + QCOMPARE(model.data(model.index(0, 0)), QVariant("Hervanta")); + QCOMPARE(model.data(model.index(1, 0)), QVariant("Keskusta")); + QCOMPARE(model.data(model.index(2, 0)), QVariant("Annala")); + + //modify the model data + QVERIFY_SQL(model, setData(model.index(0, 0), 40)); + QVERIFY_SQL(model, setData(model.index(1, 0), 50)); + QVERIFY_SQL(model, setData(model.index(2, 0), 30)); + + //verify the data after modificaiton + QCOMPARE(model.data(model.index(0, 0)), QVariant("Tammela")); + QCOMPARE(model.data(model.index(1, 0)), QVariant("Amuri")); + QCOMPARE(model.data(model.index(2, 0)), QVariant("Annala")); + + tst_Databases::safeDropTables(db, QStringList() << testTable1 << testTable2); +} + QTEST_MAIN(tst_QSqlRelationalTableModel) #include "tst_qsqlrelationaltablemodel.moc" -- cgit v0.12 From be08fa8280d95c2edda7e2aaee6a5211062b0090 Mon Sep 17 00:00:00 2001 From: mread Date: Mon, 5 Dec 2011 13:30:31 +0000 Subject: Symbian: allow apps to disable GL multisampling On Symbian, QML apps had no way to disable GL multisampling if the hardware supported it. This caused some apps to run out of graphics memory and fail. This change adds a way for apps to indicate that they don't want multisampling, by setting an environment variable. For example: qputenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE", "1"); This non-public API style was used as the use case is platform and application specific, and not appropriate for public API. Task-number: ou1cimx1#947771 Reviewed-by: Gareth Stockwell --- src/opengl/qgl_symbian.cpp | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/opengl/qgl_symbian.cpp b/src/opengl/qgl_symbian.cpp index 94c63fc..0148304 100644 --- a/src/opengl/qgl_symbian.cpp +++ b/src/opengl/qgl_symbian.cpp @@ -181,7 +181,10 @@ bool QGLContext::chooseContext(const QGLContext* shareContext) // almost same as d->ownsEglContext = true; d->eglContext->setApi(QEgl::OpenGL); - if (!QSymbianGraphicsSystemEx::hasBCM2727()) { + // Allow apps to override ability to use multisampling by setting an environment variable. Eg: + // qputenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE", "1"); + // Added to allow camera app to start with limited memory. + if (!QSymbianGraphicsSystemEx::hasBCM2727() && !qgetenv("QT_SYMBIAN_DISABLE_GL_MULTISAMPLE").toInt()) { // Most likely we have hw support for multisampling // so let's enable it. d->glFormat.setSampleBuffers(1); -- cgit v0.12