summaryrefslogtreecommitdiffstats
path: root/tests
diff options
context:
space:
mode:
authorTitta Heikkala <titta.heikkala@digia.com>2013-10-14 12:07:58 +0300
committerTitta Heikkala <titta.heikkala@digia.com>2013-10-16 09:49:27 +0300
commitd3155254bba40236bc1e7ee3764c88e0d32b36cc (patch)
treeff6f66e91c0699a58674ef1abc446803c03ec8bb /tests
parent51946a166e86f7de72df00958448edd8818f7fe8 (diff)
Fix crash with boxplottertester brush
The test sets the brush for the second set in the first series. It is checked that the set exists before setting the brush for it. Change-Id: Id677ab781953bf7cc789f316d92c137873d4f624 Reviewed-by: Miikka Heikkinen <miikka.heikkinen@digia.com>
Diffstat (limited to 'tests')
-rw-r--r--tests/boxplottester/mainwidget.cpp5
1 files changed, 4 insertions, 1 deletions
diff --git a/tests/boxplottester/mainwidget.cpp b/tests/boxplottester/mainwidget.cpp
index 2f95d141..4890b1fb 100644
--- a/tests/boxplottester/mainwidget.cpp
+++ b/tests/boxplottester/mainwidget.cpp
@@ -366,7 +366,10 @@ void MainWidget::setBrush()
if (m_seriesCount > 0) {
QList<QBoxSet *> sets = m_series[0]->boxSets();
- sets.at(1)->setBrush(QBrush(QColor(Qt::yellow)));
+ if (sets.count() > 1)
+ sets.at(1)->setBrush(QBrush(QColor(Qt::yellow)));
+ else
+ qDebug() << "Create a series with at least two items first";
} else {
qDebug() << "Create a series first";
}