tst_qabstractaxis.cpp
863 lines
| 26.2 KiB
| text/x-c
|
CppLexer
Michal Klocek
|
r1699 | /**************************************************************************** | ||
** | ||||
** Copyright (C) 2012 Digia Plc | ||||
** All rights reserved. | ||||
** For any questions to Digia, please use contact form at http://qt.digia.com | ||||
** | ||||
** This file is part of the Qt Commercial Charts Add-on. | ||||
** | ||||
** $QT_BEGIN_LICENSE$ | ||||
** Licensees holding valid Qt Commercial licenses may use this file in | ||||
** accordance with the Qt Commercial 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 | ||||
** $QT_END_LICENSE$ | ||||
** | ||||
****************************************************************************/ | ||||
#include "tst_qabstractaxis.h" | ||||
Q_DECLARE_METATYPE(QPen) | ||||
Michal Klocek
|
r1704 | Q_DECLARE_METATYPE(Qt::Orientation) | ||
Michal Klocek
|
r1699 | |||
void tst_QAbstractAxis::initTestCase() | ||||
{ | ||||
} | ||||
void tst_QAbstractAxis::cleanupTestCase() | ||||
{ | ||||
} | ||||
Marek Rosa
|
r1708 | void tst_QAbstractAxis::init(QAbstractAxis* axis, QAbstractSeries* series) | ||
Michal Klocek
|
r1699 | { | ||
m_axis = axis; | ||||
Michal Klocek
|
r1704 | m_series = series; | ||
Michal Klocek
|
r1699 | m_view = new QChartView(new QChart()); | ||
m_chart = m_view->chart(); | ||||
} | ||||
void tst_QAbstractAxis::cleanup() | ||||
{ | ||||
delete m_view; | ||||
m_view = 0; | ||||
m_chart = 0; | ||||
m_axis = 0; | ||||
} | ||||
void tst_QAbstractAxis::qabstractaxis() | ||||
{ | ||||
Marek Rosa
|
r1844 | QCOMPARE(m_axis->linePen(), QPen()); | ||
Michal Klocek
|
r1699 | //TODO QCOMPARE(m_axis->axisPenColor(), QColor()); | ||
QCOMPARE(m_axis->gridLinePen(), QPen()); | ||||
Marek Rosa
|
r1844 | QCOMPARE(m_axis->isLineVisible(), true); | ||
Michal Klocek
|
r1699 | QCOMPARE(m_axis->isGridLineVisible(), true); | ||
QCOMPARE(m_axis->isVisible(), false); | ||||
QCOMPARE(m_axis->labelsAngle(), 0); | ||||
QCOMPARE(m_axis->labelsBrush(), QBrush()); | ||||
//TODO QCOMPARE(m_axis->labelsColor(), QColor()); | ||||
QCOMPARE(m_axis->labelsFont(), QFont()); | ||||
QCOMPARE(m_axis->labelsPen(), QPen()); | ||||
QCOMPARE(m_axis->labelsVisible(), true); | ||||
QCOMPARE(m_axis->orientation(), Qt::Orientation(0)); | ||||
Marek Rosa
|
r1844 | m_axis->setLineVisible(false); | ||
m_axis->setLinePen(QPen()); | ||||
m_axis->setLinePenColor(QColor()); | ||||
Michal Klocek
|
r1699 | m_axis->setGridLinePen(QPen()); | ||
m_axis->setGridLineVisible(false); | ||||
m_axis->setLabelsAngle(-1); | ||||
m_axis->setLabelsBrush(QBrush()); | ||||
m_axis->setLabelsColor(QColor()); | ||||
m_axis->setLabelsFont(QFont()); | ||||
m_axis->setLabelsPen(QPen()); | ||||
m_axis->setLabelsVisible(false); | ||||
m_axis->setMax(QVariant()); | ||||
m_axis->setMin(QVariant()); | ||||
m_axis->setRange(QVariant(), QVariant()); | ||||
m_axis->setShadesBorderColor(QColor()); | ||||
m_axis->setShadesBrush(QBrush()); | ||||
m_axis->setShadesColor(QColor()); | ||||
m_axis->setShadesPen(QPen()); | ||||
m_axis->setShadesVisible(false); | ||||
m_axis->setVisible(false); | ||||
//TODO QCOMPARE(m_axis->shadesBorderColor(), QColor()); | ||||
//TODO QCOMPARE(m_axis->shadesBrush(), QBrush()); | ||||
//TODO QCOMPARE(m_axis->shadesColor(), QColor()); | ||||
QCOMPARE(m_axis->shadesPen(), QPen()); | ||||
QCOMPARE(m_axis->shadesVisible(), false); | ||||
m_axis->show(); | ||||
m_axis->hide(); | ||||
} | ||||
void tst_QAbstractAxis::axisPen_data() | ||||
{ | ||||
QTest::addColumn<QPen>("axisPen"); | ||||
QTest::newRow("null") << QPen(); | ||||
QTest::newRow("blue") << QPen(Qt::blue); | ||||
QTest::newRow("black") << QPen(Qt::black); | ||||
QTest::newRow("red") << QPen(Qt::red); | ||||
} | ||||
void tst_QAbstractAxis::axisPen() | ||||
{ | ||||
QFETCH(QPen, axisPen); | ||||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1699 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Marek Rosa
|
r1844 | m_axis->setLinePen(axisPen); | ||
QCOMPARE(m_axis->linePen(), axisPen); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | m_chart->setAxisX(m_axis, m_series); | ||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
//TODO QCOMPARE(m_axis->axisPen(), axisPen); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::axisPenColor_data() | ||||
{ | ||||
} | ||||
void tst_QAbstractAxis::axisPenColor() | ||||
{ | ||||
Marek Rosa
|
r2055 | #ifdef QT5_QUICK_1 | ||
QSKIP("Test is not implemented. This is depreciated function"); | ||||
#else | ||||
Michal Klocek
|
r1704 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); | ||
Marek Rosa
|
r2055 | #endif | ||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::gridLinePen_data() | ||||
{ | ||||
QTest::addColumn<QPen>("gridLinePen"); | ||||
QTest::newRow("null") << QPen(); | ||||
QTest::newRow("blue") << QPen(Qt::blue); | ||||
QTest::newRow("black") << QPen(Qt::black); | ||||
QTest::newRow("red") << QPen(Qt::red); | ||||
} | ||||
void tst_QAbstractAxis::gridLinePen() | ||||
{ | ||||
QFETCH(QPen, gridLinePen); | ||||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1699 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
m_axis->setGridLinePen(gridLinePen); | ||||
QCOMPARE(m_axis->gridLinePen(), gridLinePen); | ||||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | m_chart->setAxisX(m_axis, m_series); | ||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
//TODO QCOMPARE(m_axis->gridLinePen(), gridLinePen); | ||||
Michal Klocek
|
r1699 | } | ||
Marek Rosa
|
r1845 | void tst_QAbstractAxis::lineVisible_data() | ||
Michal Klocek
|
r1699 | { | ||
Marek Rosa
|
r1845 | QTest::addColumn<bool>("lineVisible"); | ||
Michal Klocek
|
r1699 | QTest::newRow("true") << true; | ||
QTest::newRow("false") << false; | ||||
} | ||||
Marek Rosa
|
r1845 | void tst_QAbstractAxis::lineVisible() | ||
Michal Klocek
|
r1699 | { | ||
Marek Rosa
|
r1845 | QFETCH(bool, lineVisible); | ||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | m_axis->setLineVisible(!lineVisible); | ||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | m_axis->setLineVisible(lineVisible); | ||
QCOMPARE(m_axis->isLineVisible(), lineVisible); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | QCOMPARE(spy0.count(), 1); | ||
Michal Klocek
|
r1699 | QCOMPARE(spy1.count(), 0); | ||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | |||
m_chart->setAxisX(m_axis, m_series); | ||||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
Marek Rosa
|
r1845 | QCOMPARE(m_axis->isLineVisible(), lineVisible); | ||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::gridLineVisible_data() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | QTest::addColumn<bool>("gridLineVisible"); | ||
Michal Klocek
|
r1699 | QTest::newRow("true") << true; | ||
QTest::newRow("false") << false; | ||||
} | ||||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::gridLineVisible() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | QFETCH(bool, gridLineVisible); | ||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setGridLineVisible(!gridLineVisible); | ||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setGridLineVisible(gridLineVisible); | ||
QCOMPARE(m_axis->isGridLineVisible(), gridLineVisible); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
Michal Klocek
|
r1704 | QCOMPARE(spy2.count(), 1); | ||
Michal Klocek
|
r1699 | QCOMPARE(spy3.count(), 0); | ||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | |||
m_chart->setAxisX(m_axis, m_series); | ||||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->isGridLineVisible(), gridLineVisible); | ||||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::visible_data() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | QTest::addColumn<bool>("visible"); | ||
Michal Klocek
|
r1699 | QTest::newRow("true") << true; | ||
QTest::newRow("false") << false; | ||||
} | ||||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::visible() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | QFETCH(bool, visible); | ||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setVisible(!visible); | ||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setVisible(visible); | ||
QCOMPARE(m_axis->isVisible(), visible); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
Michal Klocek
|
r1704 | QCOMPARE(spy8.count(), 1); | ||
m_chart->setAxisX(m_axis, m_series); | ||||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->isVisible(), true); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsAngle_data() | ||||
{ | ||||
QTest::addColumn<int>("labelsAngle"); | ||||
QTest::newRow("0") << 0; | ||||
Michal Klocek
|
r1704 | QTest::newRow("45") << 45; | ||
QTest::newRow("90") << 90; | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsAngle() | ||||
{ | ||||
QFETCH(int, labelsAngle); | ||||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setLabelsAngle(labelsAngle); | ||
QCOMPARE(m_axis->labelsAngle(), labelsAngle); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | |||
m_chart->setAxisX(m_axis, m_series); | ||||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->labelsAngle(), labelsAngle); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsBrush_data() | ||||
{ | ||||
QTest::addColumn<QBrush>("labelsBrush"); | ||||
QTest::newRow("null") << QBrush(); | ||||
Michal Klocek
|
r1704 | QTest::newRow("blue") << QBrush(Qt::blue); | ||
QTest::newRow("black") << QBrush(Qt::black); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsBrush() | ||||
{ | ||||
Michal Klocek
|
r1704 | QFETCH(QBrush, labelsBrush); | ||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setLabelsBrush(labelsBrush); | ||
QCOMPARE(m_axis->labelsBrush(), labelsBrush); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
Michal Klocek
|
r1704 | //TODO QCOMPARE(spy6.count(), 0); | ||
Michal Klocek
|
r1699 | QCOMPARE(spy7.count(), 0); | ||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | |||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->labelsBrush(), labelsBrush); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsColor_data() | ||||
{ | ||||
Michal Klocek
|
r1704 | |||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsColor() | ||||
{ | ||||
Marek Rosa
|
r2055 | #ifdef QT5_QUICK_1 | ||
QSKIP("Test is not implemented. This is depreciated function"); | ||||
#else | ||||
Michal Klocek
|
r1704 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); | ||
Marek Rosa
|
r2055 | #endif | ||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsFont_data() | ||||
{ | ||||
QTest::addColumn<QFont>("labelsFont"); | ||||
QTest::newRow("null") << QFont(); | ||||
Michal Klocek
|
r1704 | QTest::newRow("serif") << QFont("SansSerif"); | ||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsFont() | ||||
{ | ||||
Michal Klocek
|
r1704 | QFETCH(QFont, labelsFont); | ||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setLabelsFont(labelsFont); | ||
QCOMPARE(m_axis->labelsFont(), labelsFont); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | |||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->labelsFont(), labelsFont); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsPen_data() | ||||
{ | ||||
QTest::addColumn<QPen>("labelsPen"); | ||||
QTest::newRow("null") << QPen(); | ||||
Michal Klocek
|
r1704 | QTest::newRow("blue") << QPen(Qt::blue); | ||
QTest::newRow("black") << QPen(Qt::black); | ||||
QTest::newRow("red") << QPen(Qt::red); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsPen() | ||||
{ | ||||
QFETCH(QPen, labelsPen); | ||||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setLabelsPen(labelsPen); | ||
QCOMPARE(m_axis->labelsPen(), labelsPen); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | |||
m_chart->setAxisX(m_axis, m_series); | ||||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
//TODO QCOMPARE(m_axis->labelsPen(), labelsPen); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::labelsVisible_data() | ||||
{ | ||||
QTest::addColumn<bool>("labelsVisible"); | ||||
QTest::newRow("true") << true; | ||||
QTest::newRow("false") << false; | ||||
} | ||||
void tst_QAbstractAxis::labelsVisible() | ||||
{ | ||||
QFETCH(bool, labelsVisible); | ||||
Michal Klocek
|
r1704 | m_axis->setLabelsVisible(!labelsVisible); | ||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setLabelsVisible(labelsVisible); | ||
QCOMPARE(m_axis->labelsVisible(), labelsVisible); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
Michal Klocek
|
r1704 | QCOMPARE(spy4.count(), 1); | ||
Michal Klocek
|
r1699 | QCOMPARE(spy5.count(), 0); | ||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | |||
m_chart->setAxisX(m_axis, m_series); | ||||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->labelsVisible(), labelsVisible); | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::orientation_data() | ||||
{ | ||||
QTest::addColumn<Qt::Orientation>("orientation"); | ||||
Michal Klocek
|
r1704 | QTest::newRow("Vertical") << Qt::Vertical; | ||
QTest::newRow("Horizontal") << Qt::Horizontal; | ||||
Michal Klocek
|
r1699 | } | ||
void tst_QAbstractAxis::orientation() | ||||
{ | ||||
QFETCH(Qt::Orientation, orientation); | ||||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | if(orientation==Qt::Vertical){ | ||
m_chart->setAxisY(m_axis,m_series); | ||||
}else{ | ||||
m_chart->setAxisX(m_axis,m_series); | ||||
} | ||||
QCOMPARE(m_axis->orientation(), orientation); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
Michal Klocek
|
r1704 | QCOMPARE(spy8.count(), 1); | ||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->orientation(), orientation); | ||||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::setMax_data() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | //just check if it does not crash | ||
QTest::addColumn<QVariant>("max"); | ||||
QTest::newRow("something") << QVariant("something"); | ||||
QTest::newRow("1.0") << QVariant(1.0); | ||||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::setMax() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | QFETCH(QVariant, max); | ||
m_axis->setMax(max); | ||||
} | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::setMin_data() | ||
{ | ||||
//just check if it does not crash | ||||
QTest::addColumn<QVariant>("min"); | ||||
QTest::newRow("something") << QVariant("something"); | ||||
QTest::newRow("1.0") << QVariant(1.0); | ||||
} | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | // public void setMin(QVariant const& min) | ||
void tst_QAbstractAxis::setMin() | ||||
{ | ||||
QFETCH(QVariant, min); | ||||
m_axis->setMin(min); | ||||
} | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::setRange_data() | ||
{ | ||||
//just check if it does not crash | ||||
QTest::addColumn<QVariant>("min"); | ||||
QTest::addColumn<QVariant>("max"); | ||||
QTest::newRow("something") << QVariant("something0") << QVariant("something1"); | ||||
QTest::newRow("-1 1") << QVariant(-1.0) << QVariant(1.0); | ||||
} | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | // public void setRange(QVariant const& min, QVariant const& max) | ||
void tst_QAbstractAxis::setRange() | ||||
{ | ||||
QFETCH(QVariant, min); | ||||
QFETCH(QVariant, max); | ||||
m_axis->setRange(min,max); | ||||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::shadesBorderColor_data() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | |||
} | ||||
void tst_QAbstractAxis::shadesBorderColor() | ||||
{ | ||||
Marek Rosa
|
r2055 | #ifdef QT5_QUICK_1 | ||
QSKIP("Test is not implemented. This is depreciated function"); | ||||
#else | ||||
Michal Klocek
|
r1704 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); | ||
Marek Rosa
|
r2055 | #endif | ||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::shadesBrush_data() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | QTest::addColumn<QBrush>("shadesBrush"); | ||
QTest::newRow("null") << QBrush(); | ||||
QTest::newRow("blue") << QBrush(Qt::blue); | ||||
QTest::newRow("black") << QBrush(Qt::black); | ||||
} | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::shadesBrush() | ||
{ | ||||
QFETCH(QBrush, shadesBrush); | ||||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setShadesBrush(shadesBrush); | ||
QCOMPARE(m_axis->shadesBrush(), shadesBrush); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
Michal Klocek
|
r1704 | //TODO QCOMPARE(spy6.count(), 0); | ||
Michal Klocek
|
r1699 | QCOMPARE(spy7.count(), 0); | ||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | |||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->shadesBrush(), shadesBrush); | ||||
} | ||||
void tst_QAbstractAxis::shadesColor_data() | ||||
{ | ||||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | // public QColor shadesColor() const | ||
void tst_QAbstractAxis::shadesColor() | ||||
Michal Klocek
|
r1699 | { | ||
Marek Rosa
|
r2055 | #ifdef QT5_QUICK_1 | ||
QSKIP("Test is not implemented. This is depreciated function"); | ||||
#else | ||||
Michal Klocek
|
r1704 | QSKIP("Test is not implemented. This is depreciated function", SkipAll); | ||
Marek Rosa
|
r2055 | #endif | ||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::shadesPen_data() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | QTest::addColumn<QPen>("shadesPen"); | ||
QTest::newRow("null") << QPen(); | ||||
QTest::newRow("blue") << QPen(Qt::blue); | ||||
QTest::newRow("black") << QPen(Qt::black); | ||||
QTest::newRow("red") << QPen(Qt::red); | ||||
} | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::shadesPen() | ||
{ | ||||
QFETCH(QPen, shadesPen); | ||||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setShadesPen(shadesPen); | ||
QCOMPARE(m_axis->shadesPen(), shadesPen); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
QCOMPARE(spy8.count(), 0); | ||||
Michal Klocek
|
r1704 | m_chart->setAxisX(m_axis, m_series); | ||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->shadesPen(), shadesPen); | ||||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::shadesVisible_data() | ||
Michal Klocek
|
r1699 | { | ||
QTest::addColumn<bool>("shadesVisible"); | ||||
QTest::newRow("true") << true; | ||||
QTest::newRow("false") << false; | ||||
} | ||||
void tst_QAbstractAxis::shadesVisible() | ||||
{ | ||||
QFETCH(bool, shadesVisible); | ||||
Michal Klocek
|
r1704 | m_axis->setShadesVisible(!shadesVisible); | ||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->setShadesVisible(shadesVisible); | ||
QCOMPARE(m_axis->shadesVisible(), shadesVisible); | ||||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
Michal Klocek
|
r1704 | QCOMPARE(spy7.count(), 1); | ||
Michal Klocek
|
r1699 | QCOMPARE(spy8.count(), 0); | ||
Michal Klocek
|
r1704 | m_chart->setAxisX(m_axis, m_series); | ||
m_view->show(); | ||||
QTest::qWaitForWindowShown(m_view); | ||||
QCOMPARE(m_axis->shadesVisible(), shadesVisible); | ||||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::show_data() | ||
Michal Klocek
|
r1699 | { | ||
} | ||||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::show() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | m_axis->hide(); | ||
QCOMPARE(m_axis->isVisible(), false); | ||||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->show(); | ||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
Michal Klocek
|
r1704 | QCOMPARE(spy8.count(), 1); | ||
QCOMPARE(m_axis->isVisible(), true); | ||||
Michal Klocek
|
r1699 | } | ||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::hide_data() | ||
Michal Klocek
|
r1699 | { | ||
} | ||||
Michal Klocek
|
r1704 | void tst_QAbstractAxis::hide() | ||
Michal Klocek
|
r1699 | { | ||
Michal Klocek
|
r1704 | m_axis->show(); | ||
QCOMPARE(m_axis->isVisible(),true); | ||||
Michal Klocek
|
r1699 | |||
Marek Rosa
|
r1845 | QSignalSpy spy0(m_axis, SIGNAL(lineVisibleChanged(bool))); | ||
Michal Klocek
|
r1704 | QSignalSpy spy1(m_axis, SIGNAL(colorChanged(QColor))); | ||
QSignalSpy spy2(m_axis, SIGNAL(gridVisibleChanged(bool))); | ||||
QSignalSpy spy3(m_axis, SIGNAL(labelsColorChanged(QColor))); | ||||
QSignalSpy spy4(m_axis, SIGNAL(labelsVisibleChanged(bool))); | ||||
QSignalSpy spy5(m_axis, SIGNAL(shadesBorderColorChanged(QColor))); | ||||
QSignalSpy spy6(m_axis, SIGNAL(shadesColorChanged(QColor))); | ||||
QSignalSpy spy7(m_axis, SIGNAL(shadesVisibleChanged(bool))); | ||||
QSignalSpy spy8(m_axis, SIGNAL(visibleChanged(bool))); | ||||
Michal Klocek
|
r1699 | |||
Michal Klocek
|
r1704 | m_axis->hide(); | ||
Michal Klocek
|
r1699 | |||
QCOMPARE(spy0.count(), 0); | ||||
QCOMPARE(spy1.count(), 0); | ||||
QCOMPARE(spy2.count(), 0); | ||||
QCOMPARE(spy3.count(), 0); | ||||
QCOMPARE(spy4.count(), 0); | ||||
QCOMPARE(spy5.count(), 0); | ||||
QCOMPARE(spy6.count(), 0); | ||||
QCOMPARE(spy7.count(), 0); | ||||
Michal Klocek
|
r1704 | QCOMPARE(spy8.count(), 1); | ||
QCOMPARE(m_axis->isVisible(),false); | ||||
Michal Klocek
|
r1699 | } | ||