diff options
author | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2014-11-10 13:57:31 +0200 |
---|---|---|
committer | Miikka Heikkinen <miikka.heikkinen@theqtcompany.com> | 2014-11-10 13:57:37 +0200 |
commit | 0f324106dcda14089ce28aa5db585a1ef65f43da (patch) | |
tree | 9e53fe650612efda15c0c128cb78b357def0c4d5 /tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp | |
parent | bc317e1ea56c85a41413a5ddde4112623a1b4913 (diff) | |
parent | b6ee023cedb7e249a8dd94ae79b7ce61884adadf (diff) |
Merge branch 'develop'
Change-Id: Iaf433860fb57187c5628403cb1cfbe027f175cc3
Diffstat (limited to 'tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp')
-rw-r--r-- | tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp | 37 |
1 files changed, 20 insertions, 17 deletions
diff --git a/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp b/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp index 9d5cea90..65856191 100644 --- a/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp +++ b/tests/auto/cpptest/q3dscatter-modelproxy/tst_proxy.cpp @@ -2,17 +2,17 @@ ** ** Copyright (C) 2014 Digia Plc ** All rights reserved. -** For any questions to Digia, please use contact form at http://qt.digia.com +** For any questions to Digia, please use contact form at http://qt.io ** -** This file is part of the QtDataVisualization module. +** This file is part of the Qt Data Visualization module. ** -** Licensees holding valid Qt Enterprise licenses may use this file in -** accordance with the Qt Enterprise License Agreement provided with the -** Software or, alternatively, in accordance with the terms contained in -** a written agreement between you and Digia. +** Licensees holding valid commercial license for Qt may use this file in +** accordance with the Qt License Agreement provided with the Software +** or, alternatively, in accordance with the terms contained in a written +** agreement between you and Digia. ** ** If you have questions regarding the use of this file, please use -** contact form at http://qt.digia.com +** contact form at http://qt.io ** ****************************************************************************/ @@ -120,9 +120,9 @@ void tst_proxy::initializeProperties() { QVERIFY(m_proxy); - QTableWidget *table = new QTableWidget(); + QTableWidget table; - m_proxy->setItemModel(table->model()); + m_proxy->setItemModel(table.model()); m_proxy->setRotationRole("rotation"); m_proxy->setRotationRolePattern(QRegExp("/-/")); m_proxy->setRotationRoleReplace("\\\\1"); @@ -153,26 +153,26 @@ void tst_proxy::initializeProperties() void tst_proxy::addModel() { - QTableWidget *table = new QTableWidget(); + QTableWidget table; QStringList rows; rows << "row 1"; QStringList columns; columns << "col 1"; const char *values[1][2] = {{"0/0/5.5/30", "0/0/10.5/30"}}; - table->setRowCount(2); - table->setColumnCount(1); + table.setRowCount(2); + table.setColumnCount(1); for (int col = 0; col < columns.size(); col++) { for (int row = 0; row < rows.size(); row++) { - QModelIndex index = table->model()->index(col, row); - table->model()->setData(index, values[col][row]); + QModelIndex index = table.model()->index(col, row); + table.model()->setData(index, values[col][row]); } } - m_proxy->setItemModel(table->model()); - m_proxy->setXPosRole(table->model()->roleNames().value(Qt::DisplayRole)); - m_proxy->setZPosRole(table->model()->roleNames().value(Qt::DisplayRole)); + m_proxy->setItemModel(table.model()); + m_proxy->setXPosRole(table.model()->roleNames().value(Qt::DisplayRole)); + m_proxy->setZPosRole(table.model()->roleNames().value(Qt::DisplayRole)); m_proxy->setXPosRolePattern(QRegExp(QStringLiteral("^(\\d*)\\/(\\d*)\\/\\d*[\\.\\,]?\\d*\\/\\d*[\\.\\,]?\\d*$"))); m_proxy->setXPosRoleReplace(QStringLiteral("\\2")); m_proxy->setYPosRolePattern(QRegExp(QStringLiteral("^\\d*(\\/)(\\d*)\\/(\\d*[\\.\\,]?\\d*)\\/\\d*[\\.\\,]?\\d*$"))); @@ -187,6 +187,9 @@ void tst_proxy::addModel() QCOMPARE(m_proxy->itemCount(), 2); QVERIFY(m_proxy->series()); + + delete series; + m_proxy = 0; // proxy gets deleted with series } QTEST_MAIN(tst_proxy) |