##// END OF EJS Templates
Fix manifest file generation for examples...
Fix manifest file generation for examples Change-Id: I70d3a19f334ef6c9da0af7d041bf87f37ff8625e Reviewed-by: Titta Heikkala <titta.heikkala@theqtcompany.com>

File last commit:

r2740:377e4516d036
r2745:704036e35c0a
Show More
tst_chartviewsignals.qml
71 lines | 2.0 KiB | application/x-qml | QmlLexer
/ tests / auto / qml-qtquicktest / tst_chartviewsignals.qml
Tero Ahola
Unit test module for QML API
r2206 /****************************************************************************
**
Titta Heikkala
Update copyright year...
r2688 ** Copyright (C) 2014 Digia Plc
Tero Ahola
Unit test module for QML API
r2206 ** All rights reserved.
Titta Heikkala
Updated license headers...
r2740 ** For any questions to Digia, please use contact form at http://qt.io
Tero Ahola
Unit test module for QML API
r2206 **
Titta Heikkala
Updated license headers...
r2740 ** This file is part of the Qt Charts module.
Tero Ahola
Unit test module for QML API
r2206 **
Titta Heikkala
Updated license headers...
r2740 ** 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.
Tero Ahola
Unit test module for QML API
r2206 **
** If you have questions regarding the use of this file, please use
Titta Heikkala
Updated license headers...
r2740 ** contact form at http://qt.io
Tero Ahola
Unit test module for QML API
r2206 **
****************************************************************************/
Titta Heikkala
Fix Charts QML api auto test...
r2638 import QtQuick 2.0
import QtTest 1.0
Titta Heikkala
Qt Charts project file structure change...
r2712 import QtCharts 2.0
Tero Ahola
Unit test module for QML API
r2206
Rectangle {
width: 400
height: 300
TestCase {
id: tc1
Tero Ahola
Renamed QML QtQuick tests to match the naming convention
r2228 name: "tst_qml-qtquicktest ChartView Signals"
Tero Ahola
Unit test module for QML API
r2206 when: windowShown
// Verify onSeriesAdded and onSeriesRemoved signals
function test_chartView() {
var series = chartView.createSeries(ChartView.SeriesTypeLine, "line");
seriesAddedSpy.wait();
compare(seriesAddedSpy.count, 1, "ChartView.onSeriesAdded");
// Modifying layout triggers more than one plotAreaChanged signal
chartView.titleFont.pixelSize = 50;
verify(plotAreaChangedSpy.count > 0, "ChartView.onPlotAreaChanged");
chartView.removeSeries(series);
seriesRemovedSpy.wait();
compare(seriesRemovedSpy.count, 1, "ChartView.onSeriesAdded");
}
}
ChartView {
id: chartView
anchors.fill: parent
title: "Chart"
SignalSpy {
id: plotAreaChangedSpy
target: chartView
signalName: "plotAreaChanged"
}
SignalSpy {
id: seriesAddedSpy
target: chartView
signalName: "seriesAdded"
}
SignalSpy {
id: seriesRemovedSpy
target: chartView
signalName: "seriesRemoved"
}
}
}