##// END OF EJS Templates
Fix deprecation errors from Qt5
Jani Honkonen -
r2241:9223452f638c
parent child
Show More
@@ -31,21 +31,21 BrushTool::BrushTool(QString title, QWidget *parent)
31 31
32 32 m_colorButton = new QPushButton();
33 33 m_styleCombo = new QComboBox();
34 m_styleCombo->addItem("Nobrush", Qt::NoBrush);
35 m_styleCombo->addItem("Solidpattern", Qt::SolidPattern);
36 m_styleCombo->addItem("Dense1pattern", Qt::Dense1Pattern);
37 m_styleCombo->addItem("Dense2attern", Qt::Dense2Pattern);
38 m_styleCombo->addItem("Dense3Pattern", Qt::Dense3Pattern);
39 m_styleCombo->addItem("Dense4Pattern", Qt::Dense4Pattern);
40 m_styleCombo->addItem("Dense5Pattern", Qt::Dense5Pattern);
41 m_styleCombo->addItem("Dense6Pattern", Qt::Dense6Pattern);
42 m_styleCombo->addItem("Dense7Pattern", Qt::Dense7Pattern);
43 m_styleCombo->addItem("HorPattern", Qt::HorPattern);
44 m_styleCombo->addItem("VerPattern", Qt::VerPattern);
45 m_styleCombo->addItem("CrossPattern", Qt::CrossPattern);
46 m_styleCombo->addItem("BDiagPattern", Qt::BDiagPattern);
47 m_styleCombo->addItem("FDiagPattern", Qt::FDiagPattern);
48 m_styleCombo->addItem("DiagCrossPattern", Qt::DiagCrossPattern);
34 m_styleCombo->addItem("Nobrush", (int) Qt::NoBrush);
35 m_styleCombo->addItem("Solidpattern", (int) Qt::SolidPattern);
36 m_styleCombo->addItem("Dense1pattern", (int) Qt::Dense1Pattern);
37 m_styleCombo->addItem("Dense2attern", (int) Qt::Dense2Pattern);
38 m_styleCombo->addItem("Dense3Pattern", (int) Qt::Dense3Pattern);
39 m_styleCombo->addItem("Dense4Pattern", (int) Qt::Dense4Pattern);
40 m_styleCombo->addItem("Dense5Pattern", (int) Qt::Dense5Pattern);
41 m_styleCombo->addItem("Dense6Pattern", (int) Qt::Dense6Pattern);
42 m_styleCombo->addItem("Dense7Pattern", (int) Qt::Dense7Pattern);
43 m_styleCombo->addItem("HorPattern", (int) Qt::HorPattern);
44 m_styleCombo->addItem("VerPattern", (int) Qt::VerPattern);
45 m_styleCombo->addItem("CrossPattern", (int) Qt::CrossPattern);
46 m_styleCombo->addItem("BDiagPattern", (int) Qt::BDiagPattern);
47 m_styleCombo->addItem("FDiagPattern", (int) Qt::FDiagPattern);
48 m_styleCombo->addItem("DiagCrossPattern", (int) Qt::DiagCrossPattern);
49 49
50 50 QFormLayout *layout = new QFormLayout();
51 51 layout->addRow("Color", m_colorButton);
@@ -48,8 +48,13 TableWidget::TableWidget(QWidget *parent)
48 48 QTableView *tableView = new QTableView;
49 49 tableView->setModel(model);
50 50 tableView->setMinimumWidth(300);
51 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
52 tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
53 tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
54 #else
51 55 tableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
52 56 tableView->verticalHeader()->setResizeMode(QHeaderView::Stretch);
57 #endif
53 58 //! [2]
54 59
55 60 //! [3]
@@ -43,8 +43,13 TableWidget::TableWidget(QWidget *parent)
43 43 // create table view and add model to it
44 44 QTableView *tableView = new QTableView;
45 45 tableView->setModel(model);
46 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
47 tableView->horizontalHeader()->setSectionResizeMode(QHeaderView::Stretch);
48 tableView->verticalHeader()->setSectionResizeMode(QHeaderView::Stretch);
49 #else
46 50 tableView->horizontalHeader()->setResizeMode(QHeaderView::Stretch);
47 51 tableView->verticalHeader()->setResizeMode(QHeaderView::Stretch);
52 #endif
48 53 //! [2]
49 54
50 55 //! [3]
@@ -50,7 +50,7 QVariant AbstractBarAnimation::interpolated(const QVariant &from, const QVariant
50 50
51 51 void AbstractBarAnimation::updateCurrentValue(const QVariant &value)
52 52 {
53 QVector<QRectF> layout = qVariantValue<QVector<QRectF> >(value);
53 QVector<QRectF> layout = qvariant_cast<QVector<QRectF> >(value);
54 54 m_item->setLayout(layout);
55 55 }
56 56
@@ -113,8 +113,8 void AxisAnimation::setValues(QVector<qreal> &oldLayout, QVector<qreal> &newLayo
113 113
114 114 QVariant AxisAnimation::interpolated(const QVariant &start, const QVariant &end, qreal progress) const
115 115 {
116 QVector<qreal> startVector = qVariantValue<QVector<qreal> >(start);
117 QVector<qreal> endVecotr = qVariantValue<QVector<qreal> >(end);
116 QVector<qreal> startVector = qvariant_cast<QVector<qreal> >(start);
117 QVector<qreal> endVecotr = qvariant_cast<QVector<qreal> >(end);
118 118 QVector<qreal> result;
119 119
120 120 Q_ASSERT(startVector.count() == endVecotr.count()) ;
@@ -130,7 +130,7 QVariant AxisAnimation::interpolated(const QVariant &start, const QVariant &end,
130 130 void AxisAnimation::updateCurrentValue(const QVariant &value)
131 131 {
132 132 if (state() != QAbstractAnimation::Stopped) { //workaround
133 QVector<qreal> vector = qVariantValue<QVector<qreal> >(value);
133 QVector<qreal> vector = qvariant_cast<QVector<qreal> >(value);
134 134 Q_ASSERT(vector.count() != 0);
135 135 m_axis->setLayout(vector);
136 136 m_axis->updateGeometry();
@@ -38,8 +38,8 BarAnimation::~BarAnimation()
38 38
39 39 QVariant BarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
40 40 {
41 QVector<QRectF> startVector = qVariantValue<QVector<QRectF> >(from);
42 QVector<QRectF> endVector = qVariantValue<QVector<QRectF> >(to);
41 QVector<QRectF> startVector = qvariant_cast<QVector<QRectF> >(from);
42 QVector<QRectF> endVector = qvariant_cast<QVector<QRectF> >(to);
43 43 QVector<QRectF> result;
44 44
45 45 Q_ASSERT(startVector.count() == endVector.count());
@@ -39,8 +39,8 HorizontalBarAnimation::~HorizontalBarAnimation()
39 39
40 40 QVariant HorizontalBarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
41 41 {
42 QVector<QRectF> startVector = qVariantValue<QVector<QRectF> >(from);
43 QVector<QRectF> endVector = qVariantValue<QVector<QRectF> >(to);
42 QVector<QRectF> startVector = qvariant_cast<QVector<QRectF> >(from);
43 QVector<QRectF> endVector = qvariant_cast<QVector<QRectF> >(to);
44 44 QVector<QRectF> result;
45 45
46 46 Q_ASSERT(startVector.count() == endVector.count());
@@ -39,8 +39,8 HorizontalPercentBarAnimation::~HorizontalPercentBarAnimation()
39 39
40 40 QVariant HorizontalPercentBarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
41 41 {
42 QVector<QRectF> startVector = qVariantValue<QVector<QRectF> >(from);
43 QVector<QRectF> endVector = qVariantValue<QVector<QRectF> >(to);
42 QVector<QRectF> startVector = qvariant_cast<QVector<QRectF> >(from);
43 QVector<QRectF> endVector = qvariant_cast<QVector<QRectF> >(to);
44 44 QVector<QRectF> result;
45 45
46 46 Q_ASSERT(startVector.count() == endVector.count());
@@ -39,8 +39,8 HorizontalStackedBarAnimation::~HorizontalStackedBarAnimation()
39 39
40 40 QVariant HorizontalStackedBarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
41 41 {
42 QVector<QRectF> startVector = qVariantValue<QVector<QRectF> >(from);
43 QVector<QRectF> endVector = qVariantValue<QVector<QRectF> >(to);
42 QVector<QRectF> startVector = qvariant_cast<QVector<QRectF> >(from);
43 QVector<QRectF> endVector = qvariant_cast<QVector<QRectF> >(to);
44 44 QVector<QRectF> result;
45 45
46 46 Q_ASSERT(startVector.count() == endVector.count());
@@ -39,8 +39,8 PercentBarAnimation::~PercentBarAnimation()
39 39
40 40 QVariant PercentBarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
41 41 {
42 QVector<QRectF> startVector = qVariantValue<QVector<QRectF> >(from);
43 QVector<QRectF> endVector = qVariantValue<QVector<QRectF> >(to);
42 QVector<QRectF> startVector = qvariant_cast<QVector<QRectF> >(from);
43 QVector<QRectF> endVector = qvariant_cast<QVector<QRectF> >(to);
44 44 QVector<QRectF> result;
45 45
46 46 Q_ASSERT(startVector.count() == endVector.count());
@@ -99,8 +99,8 PieSliceData PieSliceAnimation::currentSliceValue()
99 99
100 100 QVariant PieSliceAnimation::interpolated(const QVariant &start, const QVariant &end, qreal progress) const
101 101 {
102 PieSliceData startValue = qVariantValue<PieSliceData>(start);
103 PieSliceData endValue = qVariantValue<PieSliceData>(end);
102 PieSliceData startValue = qvariant_cast<PieSliceData>(start);
103 PieSliceData endValue = qvariant_cast<PieSliceData>(end);
104 104
105 105 PieSliceData result;
106 106 result = endValue;
@@ -118,7 +118,7 QVariant PieSliceAnimation::interpolated(const QVariant &start, const QVariant &
118 118 void PieSliceAnimation::updateCurrentValue(const QVariant &value)
119 119 {
120 120 if (state() != QAbstractAnimation::Stopped) { //workaround
121 m_currentValue = qVariantValue<PieSliceData>(value);
121 m_currentValue = qvariant_cast<PieSliceData>(value);
122 122 m_sliceItem->setLayout(m_currentValue);
123 123 }
124 124 }
@@ -120,8 +120,8 void SplineAnimation::setup(QVector<QPointF> &oldPoints, QVector<QPointF> &newPo
120 120 QVariant SplineAnimation::interpolated(const QVariant &start, const QVariant &end, qreal progress) const
121 121 {
122 122
123 SplineVector startPair = qVariantValue< SplineVector >(start);
124 SplineVector endPair = qVariantValue< SplineVector >(end);
123 SplineVector startPair = qvariant_cast< SplineVector >(start);
124 SplineVector endPair = qvariant_cast< SplineVector >(end);
125 125 SplineVector result;
126 126
127 127 switch (animationType()) {
@@ -170,7 +170,7 QVariant SplineAnimation::interpolated(const QVariant &start, const QVariant &en
170 170 void SplineAnimation::updateCurrentValue(const QVariant &value)
171 171 {
172 172 if (state() != QAbstractAnimation::Stopped && m_valid) { //workaround
173 QPair<QVector<QPointF >, QVector<QPointF > > pair = qVariantValue< QPair< QVector<QPointF>, QVector<QPointF> > >(value);
173 QPair<QVector<QPointF >, QVector<QPointF > > pair = qvariant_cast< QPair< QVector<QPointF>, QVector<QPointF> > >(value);
174 174 m_item->setGeometryPoints(pair.first);
175 175 m_item->setControlGeometryPoints(pair.second);
176 176 m_item->updateGeometry();
@@ -38,8 +38,8 StackedBarAnimation::~StackedBarAnimation()
38 38
39 39 QVariant StackedBarAnimation::interpolated(const QVariant &from, const QVariant &to, qreal progress) const
40 40 {
41 QVector<QRectF> startVector = qVariantValue<QVector<QRectF> >(from);
42 QVector<QRectF> endVector = qVariantValue<QVector<QRectF> >(to);
41 QVector<QRectF> startVector = qvariant_cast<QVector<QRectF> >(from);
42 QVector<QRectF> endVector = qvariant_cast<QVector<QRectF> >(to);
43 43 QVector<QRectF> result;
44 44
45 45 Q_ASSERT(startVector.count() == endVector.count());
@@ -88,8 +88,8 void XYAnimation::setup(const QVector<QPointF> &oldPoints, const QVector<QPointF
88 88
89 89 QVariant XYAnimation::interpolated(const QVariant &start, const QVariant &end, qreal progress) const
90 90 {
91 QVector<QPointF> startVector = qVariantValue<QVector<QPointF> >(start);
92 QVector<QPointF> endVector = qVariantValue<QVector<QPointF> >(end);
91 QVector<QPointF> startVector = qvariant_cast<QVector<QPointF> >(start);
92 QVector<QPointF> endVector = qvariant_cast<QVector<QPointF> >(end);
93 93 QVector<QPointF> result;
94 94
95 95 switch (m_type) {
@@ -125,7 +125,7 void XYAnimation::updateCurrentValue(const QVariant &value)
125 125 {
126 126 if (state() != QAbstractAnimation::Stopped) { //workaround
127 127
128 QVector<QPointF> vector = qVariantValue<QVector<QPointF> >(value);
128 QVector<QPointF> vector = qvariant_cast<QVector<QPointF> >(value);
129 129 m_item->setGeometryPoints(vector);
130 130 m_item->updateGeometry();
131 131 m_item->setDirty(true);
@@ -78,10 +78,10 void ChartAxis::setLayout(QVector<qreal> &layout)
78 78
79 79 void ChartAxis::createItems(int count)
80 80 {
81 if (m_arrow->children().size() == 0)
81 if (m_arrow->childItems().size() == 0)
82 82 m_arrow->addToGroup(new AxisItem(this, presenter()->rootItem()));
83 83
84 if (m_intervalAxis && m_grid->children().size() == 0) {
84 if (m_intervalAxis && m_grid->childItems().size() == 0) {
85 85 for (int i = 0 ; i < 2 ; i ++)
86 86 m_grid->addToGroup(new QGraphicsLineItem(presenter()->rootItem()));
87 87 }
@@ -440,7 +440,7 QStringList ChartAxis::createValueLabels(int ticks) const
440 440 labels << QString::number(value, 'f', n);
441 441 }
442 442 } else {
443 QByteArray array = format.toAscii();
443 QByteArray array = format.toLatin1();
444 444 for (int i = 0; i < ticks; i++) {
445 445 qreal value = m_min + (i * (m_max - m_min) / (ticks - 1));
446 446 labels << QString().sprintf(array, value);
@@ -43,7 +43,7 LegendMarkerItem::LegendMarkerItem(QLegendMarkerPrivate *marker, QGraphicsObject
43 43 m_pressPos(0, 0)
44 44 {
45 45 m_rectItem->setRect(m_markerRect);
46 setAcceptsHoverEvents(true);
46 setAcceptHoverEvents(true);
47 47 }
48 48
49 49 LegendMarkerItem::~LegendMarkerItem()
@@ -24,6 +24,17
24 24 #include <QtTest/QtTest>
25 25 #include <QPushButton>
26 26
27 #if (QT_VERSION >= QT_VERSION_CHECK(5, 0, 0))
28 namespace QTest
29 {
30 // This was deprecated in Qt5. This is a small hack for the sake of compatibility.
31 inline static bool qWaitForWindowShown(QWidget *window)
32 {
33 return QTest::qWaitForWindowExposed(window);
34 }
35 }
36 #endif
37
27 38 #define TRY_COMPARE(actual, expected) { \
28 39 do { \
29 40 const int timeout(1000); \
@@ -22,6 +22,7
22 22 #include <qbarset.h>
23 23 #include <qbarseries.h>
24 24 #include <qchartview.h>
25 #include "tst_definitions.h"
25 26
26 27 QTCOMMERCIALCHART_USE_NAMESPACE
27 28
@@ -31,6 +31,7
31 31 #include <qstackedbarseries.h>
32 32 #include <qvalueaxis.h>
33 33 #include <qbarcategoryaxis.h>
34 #include "tst_definitions.h"
34 35
35 36 QTCOMMERCIALCHART_USE_NAMESPACE
36 37
@@ -466,10 +467,10 void tst_QChart::removeSeries()
466 467
467 468 void tst_QChart::scroll_right_data()
468 469 {
469 QTest::addColumn<QAbstractSeries *>("series");
470 QTest::addColumn<QAbstractSeries *>("series");
470 471
471 QLineSeries* series0 = new QLineSeries(this);
472 *series0 << QPointF(0, 0) << QPointF(100, 100);
472 QLineSeries* series0 = new QLineSeries(this);
473 *series0 << QPointF(0, 0) << QPointF(100, 100);
473 474
474 475 QTest::newRow("lineSeries") << (QAbstractSeries*) series0;
475 476
@@ -490,77 +491,77 void tst_QChart::scroll_right()
490 491 {
491 492 case QAbstractAxis::AxisTypeValue:{
492 493 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
493 QVERIFY(vaxis!=0);
494 qreal min = vaxis->min();
495 qreal max = vaxis->max();
496 QVERIFY(max>min);
497 m_chart->scroll(50, 0);
498 QVERIFY(min<vaxis->min());
499 QVERIFY(max<vaxis->max());
500 break;
501 }
494 QVERIFY(vaxis!=0);
495 qreal min = vaxis->min();
496 qreal max = vaxis->max();
497 QVERIFY(max>min);
498 m_chart->scroll(50, 0);
499 QVERIFY(min<vaxis->min());
500 QVERIFY(max<vaxis->max());
501 break;
502 }
502 503 case QAbstractAxis::AxisTypeBarCategory:{
503 504 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
504 QVERIFY(caxis!=0);
505 qreal min = caxis->min().toDouble();
506 qreal max = caxis->max().toDouble();
507 m_chart->scroll(50, 0);
508 QVERIFY(min<caxis->min().toDouble());
509 QVERIFY(max<caxis->max().toDouble());
510 break;
511 }
512 default:
513 qFatal("Unsupported type");
514 break;
505 QVERIFY(caxis!=0);
506 qreal min = caxis->min().toDouble();
507 qreal max = caxis->max().toDouble();
508 m_chart->scroll(50, 0);
509 QVERIFY(min<caxis->min().toDouble());
510 QVERIFY(max<caxis->max().toDouble());
511 break;
512 }
513 default:
514 qFatal("Unsupported type");
515 break;
515 516 }
516 517 }
517 518
518 519 void tst_QChart::scroll_left_data()
519 520 {
520 scroll_right_data();
521 scroll_right_data();
521 522 }
522 523
523 524 void tst_QChart::scroll_left()
524 525 {
525 QFETCH(QAbstractSeries *, series);
526 m_chart->addSeries(series);
527 m_chart->createDefaultAxes();
528 m_view->show();
529 QTest::qWaitForWindowShown(m_view);
530 QAbstractAxis * axis = m_chart->axisX();
531 QVERIFY(axis!=0);
526 QFETCH(QAbstractSeries *, series);
527 m_chart->addSeries(series);
528 m_chart->createDefaultAxes();
529 m_view->show();
530 QTest::qWaitForWindowShown(m_view);
531 QAbstractAxis * axis = m_chart->axisX();
532 QVERIFY(axis!=0);
532 533
533 switch(axis->type())
534 {
534 switch(axis->type())
535 {
535 536 case QAbstractAxis::AxisTypeValue:{
536 537 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
537 QVERIFY(vaxis!=0);
538 qreal min = vaxis->min();
539 qreal max = vaxis->max();
540 m_chart->scroll(-50, 0);
541 QVERIFY(min>vaxis->min());
542 QVERIFY(max>vaxis->max());
543 break;
544 }
538 QVERIFY(vaxis!=0);
539 qreal min = vaxis->min();
540 qreal max = vaxis->max();
541 m_chart->scroll(-50, 0);
542 QVERIFY(min>vaxis->min());
543 QVERIFY(max>vaxis->max());
544 break;
545 }
545 546 case QAbstractAxis::AxisTypeBarCategory:{
546 547 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
547 QVERIFY(caxis!=0);
548 qreal min = caxis->min().toDouble();
549 qreal max = caxis->max().toDouble();
550 m_chart->scroll(-50, 0);
551 QVERIFY(min>caxis->min().toDouble());
552 QVERIFY(max>caxis->max().toDouble());
553 break;
554 }
555 default:
556 qFatal("Unsupported type");
557 break;
558 }
548 QVERIFY(caxis!=0);
549 qreal min = caxis->min().toDouble();
550 qreal max = caxis->max().toDouble();
551 m_chart->scroll(-50, 0);
552 QVERIFY(min>caxis->min().toDouble());
553 QVERIFY(max>caxis->max().toDouble());
554 break;
555 }
556 default:
557 qFatal("Unsupported type");
558 break;
559 }
559 560 }
560 561
561 562 void tst_QChart::scroll_up_data()
562 563 {
563 scroll_right_data();
564 scroll_right_data();
564 565 }
565 566
566 567 void tst_QChart::scroll_up()
@@ -577,71 +578,71 void tst_QChart::scroll_up()
577 578 {
578 579 case QAbstractAxis::AxisTypeValue:{
579 580 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
580 QVERIFY(vaxis!=0);
581 qreal min = vaxis->min();
582 qreal max = vaxis->max();
583 m_chart->scroll(0, 50);
584 QVERIFY(min<vaxis->min());
585 QVERIFY(max<vaxis->max());
586 break;
587 }
581 QVERIFY(vaxis!=0);
582 qreal min = vaxis->min();
583 qreal max = vaxis->max();
584 m_chart->scroll(0, 50);
585 QVERIFY(min<vaxis->min());
586 QVERIFY(max<vaxis->max());
587 break;
588 }
588 589 case QAbstractAxis::AxisTypeBarCategory:{
589 590 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
590 QVERIFY(caxis!=0);
591 qreal min = caxis->min().toDouble();
592 qreal max = caxis->max().toDouble();
593 m_chart->scroll(0, 50);
594 QVERIFY(min<caxis->min().toDouble());
595 QVERIFY(max<caxis->max().toDouble());
596 break;
597 }
598 default:
599 qFatal("Unsupported type");
600 break;
591 QVERIFY(caxis!=0);
592 qreal min = caxis->min().toDouble();
593 qreal max = caxis->max().toDouble();
594 m_chart->scroll(0, 50);
595 QVERIFY(min<caxis->min().toDouble());
596 QVERIFY(max<caxis->max().toDouble());
597 break;
598 }
599 default:
600 qFatal("Unsupported type");
601 break;
601 602 }
602 603 }
603 604
604 605 void tst_QChart::scroll_down_data()
605 606 {
606 scroll_right_data();
607 scroll_right_data();
607 608 }
608 609
609 610 void tst_QChart::scroll_down()
610 611 {
611 QFETCH(QAbstractSeries *, series);
612 m_chart->addSeries(series);
613 m_chart->createDefaultAxes();
614 m_view->show();
615 QTest::qWaitForWindowShown(m_view);
616 QAbstractAxis * axis = m_chart->axisY();
617 QVERIFY(axis!=0);
612 QFETCH(QAbstractSeries *, series);
613 m_chart->addSeries(series);
614 m_chart->createDefaultAxes();
615 m_view->show();
616 QTest::qWaitForWindowShown(m_view);
617 QAbstractAxis * axis = m_chart->axisY();
618 QVERIFY(axis!=0);
618 619
619 switch(axis->type())
620 {
620 switch(axis->type())
621 {
621 622 case QAbstractAxis::AxisTypeValue:{
622 623 QValueAxis* vaxis = qobject_cast<QValueAxis*>(axis);
623 QVERIFY(vaxis!=0);
624 qreal min = vaxis->min();
625 qreal max = vaxis->max();
626 m_chart->scroll(0, -50);
627 QVERIFY(min>vaxis->min());
628 QVERIFY(max>vaxis->max());
629 break;
630 }
624 QVERIFY(vaxis!=0);
625 qreal min = vaxis->min();
626 qreal max = vaxis->max();
627 m_chart->scroll(0, -50);
628 QVERIFY(min>vaxis->min());
629 QVERIFY(max>vaxis->max());
630 break;
631 }
631 632 case QAbstractAxis::AxisTypeBarCategory:{
632 633 QBarCategoryAxis* caxis = qobject_cast<QBarCategoryAxis*>(axis);
633 QVERIFY(caxis!=0);
634 qreal min = caxis->min().toDouble();
635 qreal max = caxis->max().toDouble();
636 m_chart->scroll(0, -50);
637 QVERIFY(min>caxis->min().toDouble());
638 QVERIFY(max>caxis->max().toDouble());
639 break;
640 }
641 default:
642 qFatal("Unsupported type");
643 break;
644 }
634 QVERIFY(caxis!=0);
635 qreal min = caxis->min().toDouble();
636 qreal max = caxis->max().toDouble();
637 m_chart->scroll(0, -50);
638 QVERIFY(min>caxis->min().toDouble());
639 QVERIFY(max>caxis->max().toDouble());
640 break;
641 }
642 default:
643 qFatal("Unsupported type");
644 break;
645 }
645 646 }
646 647
647 648 void tst_QChart::theme_data()
General Comments 0
You need to be logged in to leave comments. Login now