##// END OF EJS Templates
Removed the old hovered signal from bar chart...
Titta Heikkala -
r2726:17ddbeb77815
parent child
Show More
@@ -162,10 +162,8 void AbstractBarChartItem::handleDataStructureChanged()
162 162 Bar *bar = new Bar(set, c, this);
163 163 m_bars.append(bar);
164 164 connect(bar, SIGNAL(clicked(int,QBarSet*)), m_series, SIGNAL(clicked(int,QBarSet*)));
165 connect(bar, SIGNAL(hovered(bool,QBarSet*)), m_series, SIGNAL(hovered(bool,QBarSet*)));
166 165 connect(bar, SIGNAL(hovered(bool, int, QBarSet*)), m_series, SIGNAL(hovered(bool, int, QBarSet*)));
167 166 connect(bar, SIGNAL(clicked(int,QBarSet*)), set, SIGNAL(clicked(int)));
168 connect(bar, SIGNAL(hovered(bool,QBarSet*)), set, SIGNAL(hovered(bool)));
169 167 connect(bar, SIGNAL(hovered(bool, int, QBarSet*)), set, SIGNAL(hovered(bool, int)));
170 168 // m_layout.append(QRectF(0, 0, 1, 1));
171 169
@@ -36,10 +36,8 Bar::Bar(QBarSet *barset, int index, QGraphicsItem *parent) : QGraphicsRectItem(
36 36 Bar::~Bar()
37 37 {
38 38 // End hover event, if bar is deleted during it
39 if (m_hovering) {
40 emit hovered(false, m_barset);
39 if (m_hovering)
41 40 emit hovered(false, m_index, m_barset);
42 }
43 41 }
44 42
45 43 void Bar::mousePressEvent(QGraphicsSceneMouseEvent *event)
@@ -53,7 +51,6 void Bar::hoverEnterEvent(QGraphicsSceneHoverEvent *event)
53 51 {
54 52 Q_UNUSED(event)
55 53 m_hovering = true;
56 emit hovered(true, m_barset);
57 54 emit hovered(true, m_index, m_barset);
58 55
59 56 }
@@ -62,7 +59,6 void Bar::hoverLeaveEvent(QGraphicsSceneHoverEvent *event)
62 59 {
63 60 Q_UNUSED(event)
64 61 m_hovering = false;
65 emit hovered(false, m_barset);
66 62 emit hovered(false, m_index, m_barset);
67 63 }
68 64
@@ -52,7 +52,6 public:
52 52
53 53 Q_SIGNALS:
54 54 void clicked(int index, QBarSet *barset);
55 void hovered(bool status, QBarSet *barset);
56 55 void hovered(bool status, int index, QBarSet *barset);
57 56
58 57 private:
@@ -211,14 +211,6 QT_CHARTS_BEGIN_NAMESPACE
211 211 */
212 212
213 213 /*!
214 \fn void QAbstractBarSeries::hovered(bool status, QBarSet* barset)
215
216 The signal is emitted if mouse is hovered on top of series.
217 Parameter \a barset is the pointer of barset, where hover happened.
218 Parameter \a status is true, if mouse entered on top of series, false if mouse left from top of series.
219 */
220
221 /*!
222 214 \fn void QAbstractBarSeries::hovered(bool status, int index, QBarSet* barset)
223 215
224 216 The signal is emitted if mouse is hovered on top of series.
@@ -77,7 +77,6 protected:
77 77
78 78 Q_SIGNALS:
79 79 void clicked(int index, QBarSet *barset);
80 void hovered(bool status, QBarSet *barset);
81 80 void hovered(bool status, int index, QBarSet *barset);
82 81 void countChanged();
83 82 void labelsVisibleChanged();
@@ -134,13 +134,6 QT_CHARTS_BEGIN_NAMESPACE
134 134 */
135 135
136 136 /*!
137 \fn void QBarSet::hovered(bool status)
138
139 The signal is emitted if mouse is hovered on top of bar set.
140 Parameter \a status is true, if mouse entered on top of bar set, false if mouse left from top of bar set.
141 */
142
143 /*!
144 137 \fn void QBarSet::hovered(bool status, int index)
145 138
146 139 The signal is emitted if mouse is hovered on top of bar set.
@@ -84,7 +84,6 public:
84 84
85 85 Q_SIGNALS:
86 86 void clicked(int index);
87 void hovered(bool status);
88 87 void hovered(bool status, int index);
89 88 void penChanged();
90 89 void brushChanged();
@@ -610,10 +610,7 void tst_QBarSeries::mousehovered()
610 610 series->append(set2);
611 611 QList<QBarSet*> barSets = series->barSets();
612 612
613 QSignalSpy seriesSpy(series,SIGNAL(hovered(bool,QBarSet*)));
614 613 QSignalSpy seriesIndexSpy(series, SIGNAL(hovered(bool, int, QBarSet*)));
615 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
616 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
617 614 QSignalSpy setIndexSpy1(set1, SIGNAL(hovered(bool, int)));
618 615 QSignalSpy setIndexSpy2(set2, SIGNAL(hovered(bool, int)));
619 616
@@ -661,37 +658,22 void tst_QBarSeries::mousehovered()
661 658 // move mouse to left border
662 659 QTest::mouseMove(view.viewport(), QPoint(0, layout.at(0).center().y()));
663 660 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
664 TRY_COMPARE(seriesSpy.count(), 0);
665 661 TRY_COMPARE(seriesIndexSpy.count(), 0);
666 TRY_COMPARE(setSpy1.count(), 0);
667 TRY_COMPARE(setSpy2.count(), 0);
668 662 TRY_COMPARE(setIndexSpy1.count(), 0);
669 663 TRY_COMPARE(setIndexSpy2.count(), 0);
670 664
671 665 //=======================================================================
672 666 // move mouse on top of set1
673 667 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
674 TRY_COMPARE(seriesSpy.count(), 1);
675 668 TRY_COMPARE(seriesIndexSpy.count(), 1);
676 TRY_COMPARE(setSpy1.count(), 1);
677 TRY_COMPARE(setSpy2.count(), 0);
678 669 TRY_COMPARE(setIndexSpy1.count(), 1);
679 670 TRY_COMPARE(setIndexSpy2.count(), 0);
680 671
681 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
682 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
683 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
684 QVERIFY(seriesSpyArg.at(0).toBool() == true);
685
686 672 QList<QVariant> seriesIndexSpyArg = seriesIndexSpy.takeFirst();
687 673 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
688 674 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
689 675 QVERIFY(seriesIndexSpyArg.at(0).toBool() == true);
690 676
691 QList<QVariant> setSpyArg = setSpy1.takeFirst();
692 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
693 QVERIFY(setSpyArg.at(0).toBool() == true);
694
695 677 QList<QVariant> setIndexSpyArg = setIndexSpy1.takeFirst();
696 678 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
697 679 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -699,47 +681,26 void tst_QBarSeries::mousehovered()
699 681 //=======================================================================
700 682 // move mouse from top of set1 to top of set2
701 683 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
702 TRY_COMPARE(seriesSpy.count(), 2);
703 684 TRY_COMPARE(seriesIndexSpy.count(), 2);
704 TRY_COMPARE(setSpy1.count(), 1);
705 TRY_COMPARE(setSpy2.count(), 1);
706 685 TRY_COMPARE(setIndexSpy1.count(), 1);
707 686 TRY_COMPARE(setIndexSpy2.count(), 1);
708 687
709 688 // should leave set1
710 seriesSpyArg = seriesSpy.takeFirst();
711 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
712 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
713 QVERIFY(seriesSpyArg.at(0).toBool() == false);
714
715 689 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
716 690 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
717 691 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
718 692 QVERIFY(seriesIndexSpyArg.at(0).toBool() == false);
719 693
720 setSpyArg = setSpy1.takeFirst();
721 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
722 QVERIFY(setSpyArg.at(0).toBool() == false);
723
724 694 setIndexSpyArg = setIndexSpy1.takeFirst();
725 695 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
726 696 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
727 697
728 698 // should enter set2
729 seriesSpyArg = seriesSpy.takeFirst();
730 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
731 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
732 QVERIFY(seriesSpyArg.at(0).toBool() == true);
733
734 699 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
735 700 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
736 701 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
737 702 QVERIFY(seriesIndexSpyArg.at(0).toBool() == true);
738 703
739 setSpyArg = setSpy2.takeFirst();
740 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
741 QVERIFY(setSpyArg.at(0).toBool() == true);
742
743 704 setIndexSpyArg = setIndexSpy2.takeFirst();
744 705 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
745 706 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -747,28 +708,16 void tst_QBarSeries::mousehovered()
747 708 //=======================================================================
748 709 // move mouse from top of set2 to background
749 710 QTest::mouseMove(view.viewport(), QPoint(layout.at(1).center().x(), 0));
750 TRY_COMPARE(seriesSpy.count(), 1);
751 711 TRY_COMPARE(seriesIndexSpy.count(), 1);
752 TRY_COMPARE(setSpy1.count(), 0);
753 TRY_COMPARE(setSpy2.count(), 1);
754 712 TRY_COMPARE(setIndexSpy1.count(), 0);
755 713 TRY_COMPARE(setIndexSpy2.count(), 1);
756 714
757 715 // should leave set2
758 seriesSpyArg = seriesSpy.takeFirst();
759 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
760 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
761 QVERIFY(seriesSpyArg.at(0).toBool() == false);
762
763 716 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
764 717 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
765 718 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
766 719 QVERIFY(seriesIndexSpyArg.at(0).toBool() == false);
767 720
768 setSpyArg = setSpy2.takeFirst();
769 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
770 QVERIFY(setSpyArg.at(0).toBool() == false);
771
772 721 setIndexSpyArg = setIndexSpy2.takeFirst();
773 722 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
774 723 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -777,19 +726,11 void tst_QBarSeries::mousehovered()
777 726 // move mouse on top of set1, bar0 to check the index (hover into set1)
778 727 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
779 728
780 TRY_COMPARE(seriesSpy.count(), 1);
781 729 TRY_COMPARE(seriesIndexSpy.count(), 1);
782 TRY_COMPARE(setSpy1.count(), 1);
783 TRY_COMPARE(setSpy2.count(), 0);
784 730 TRY_COMPARE(setIndexSpy1.count(), 1);
785 731 TRY_COMPARE(setIndexSpy2.count(), 0);
786 732
787 733 //should enter set1, bar0
788 seriesSpyArg = seriesSpy.takeFirst();
789 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
790 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
791 QVERIFY(seriesSpyArg.at(0).toBool() == true);
792
793 734 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
794 735 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
795 736 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -797,10 +738,6 void tst_QBarSeries::mousehovered()
797 738 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
798 739 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 0);
799 740
800 setSpyArg = setSpy1.takeFirst();
801 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
802 QVERIFY(setSpyArg.at(0).toBool() == true);
803
804 741 setIndexSpyArg = setIndexSpy1.takeFirst();
805 742 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
806 743 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -812,19 +749,11 void tst_QBarSeries::mousehovered()
812 749 // hover in set1)
813 750 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
814 751
815 TRY_COMPARE(seriesSpy.count(), 2);
816 752 TRY_COMPARE(seriesIndexSpy.count(), 2);
817 TRY_COMPARE(setSpy1.count(), 1);
818 TRY_COMPARE(setSpy2.count(), 1);
819 753 TRY_COMPARE(setIndexSpy1.count(), 1);
820 754 TRY_COMPARE(setIndexSpy2.count(), 1);
821 755
822 756 // should leave set1, bar0
823 seriesSpyArg = seriesSpy.takeFirst();
824 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
825 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
826 QVERIFY(seriesSpyArg.at(0).toBool() == false);
827
828 757 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
829 758 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
830 759 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -832,10 +761,6 void tst_QBarSeries::mousehovered()
832 761 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
833 762 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 0);
834 763
835 setSpyArg = setSpy1.takeFirst();
836 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
837 QVERIFY(setSpyArg.at(0).toBool() == false);
838
839 764 setIndexSpyArg = setIndexSpy1.takeFirst();
840 765 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
841 766 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -843,11 +768,6 void tst_QBarSeries::mousehovered()
843 768 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
844 769
845 770 // should enter set2, bar0
846 seriesSpyArg = seriesSpy.takeFirst();
847 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
848 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
849 QVERIFY(seriesSpyArg.at(0).toBool() == true);
850
851 771 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
852 772 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
853 773 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -855,10 +775,6 void tst_QBarSeries::mousehovered()
855 775 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
856 776 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 0);
857 777
858 setSpyArg = setSpy2.takeFirst();
859 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
860 QVERIFY(setSpyArg.at(0).toBool() == true);
861
862 778 setIndexSpyArg = setIndexSpy2.takeFirst();
863 779 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
864 780 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -870,19 +786,11 void tst_QBarSeries::mousehovered()
870 786 // hover in set1)
871 787 QTest::mouseMove(view.viewport(), layout.at(2).center().toPoint());
872 788
873 TRY_COMPARE(seriesSpy.count(), 2);
874 789 TRY_COMPARE(seriesIndexSpy.count(), 2);
875 TRY_COMPARE(setSpy1.count(), 1);
876 TRY_COMPARE(setSpy2.count(), 1);
877 790 TRY_COMPARE(setIndexSpy1.count(), 1);
878 791 TRY_COMPARE(setIndexSpy2.count(), 1);
879 792
880 793 // should leave set2, bar0
881 seriesSpyArg = seriesSpy.takeFirst();
882 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
883 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
884 QVERIFY(seriesSpyArg.at(0).toBool() == false);
885
886 794 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
887 795 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
888 796 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -890,10 +798,6 void tst_QBarSeries::mousehovered()
890 798 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
891 799 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 0);
892 800
893 setSpyArg = setSpy2.takeFirst();
894 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
895 QVERIFY(setSpyArg.at(0).toBool() == false);
896
897 801 setIndexSpyArg = setIndexSpy2.takeFirst();
898 802 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
899 803 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -901,11 +805,6 void tst_QBarSeries::mousehovered()
901 805 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
902 806
903 807 // should enter set1, bar1
904 seriesSpyArg = seriesSpy.takeFirst();
905 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
906 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
907 QVERIFY(seriesSpyArg.at(0).toBool() == true);
908
909 808 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
910 809 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
911 810 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -913,10 +812,6 void tst_QBarSeries::mousehovered()
913 812 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
914 813 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 1);
915 814
916 setSpyArg = setSpy1.takeFirst();
917 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
918 QVERIFY(setSpyArg.at(0).toBool() == true);
919
920 815 setIndexSpyArg = setIndexSpy1.takeFirst();
921 816 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
922 817 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -928,19 +823,11 void tst_QBarSeries::mousehovered()
928 823 // (hover out set1)
929 824 QTest::mouseMove(view.viewport(), QPoint((layout.at(2).right() + layout.at(3).left()) / 2, 0));
930 825
931 TRY_COMPARE(seriesSpy.count(), 1);
932 826 TRY_COMPARE(seriesIndexSpy.count(), 1);
933 TRY_COMPARE(setSpy1.count(), 1);
934 TRY_COMPARE(setSpy2.count(), 0);
935 827 TRY_COMPARE(setIndexSpy1.count(), 1);
936 828 TRY_COMPARE(setIndexSpy2.count(), 0);
937 829
938 830 // should leave set1, bar1
939 seriesSpyArg = seriesSpy.takeFirst();
940 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
941 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
942 QVERIFY(seriesSpyArg.at(0).toBool() == false);
943
944 831 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
945 832 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
946 833 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -948,10 +835,6 void tst_QBarSeries::mousehovered()
948 835 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
949 836 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 1);
950 837
951 setSpyArg = setSpy1.takeFirst();
952 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
953 QVERIFY(setSpyArg.at(0).toBool() == false);
954
955 838 setIndexSpyArg = setIndexSpy1.takeFirst();
956 839 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
957 840 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -962,19 +845,11 void tst_QBarSeries::mousehovered()
962 845 // move mouse on top of set2, bar1 to check the index (hover in set2)
963 846 QTest::mouseMove(view.viewport(), layout.at(3).center().toPoint());
964 847
965 TRY_COMPARE(seriesSpy.count(), 1);
966 848 TRY_COMPARE(seriesIndexSpy.count(), 1);
967 TRY_COMPARE(setSpy1.count(), 0);
968 TRY_COMPARE(setSpy2.count(), 1);
969 849 TRY_COMPARE(setIndexSpy1.count(), 0);
970 850 TRY_COMPARE(setIndexSpy2.count(), 1);
971 851
972 852 // should enter set2, bar1
973 seriesSpyArg = seriesSpy.takeFirst();
974 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
975 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
976 QVERIFY(seriesSpyArg.at(0).toBool() == true);
977
978 853 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
979 854 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
980 855 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -982,10 +857,6 void tst_QBarSeries::mousehovered()
982 857 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
983 858 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 1);
984 859
985 setSpyArg = setSpy2.takeFirst();
986 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
987 QVERIFY(setSpyArg.at(0).toBool() == true);
988
989 860 setIndexSpyArg = setIndexSpy2.takeFirst();
990 861 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
991 862 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -997,19 +868,11 void tst_QBarSeries::mousehovered()
997 868 //(hover out set2)
998 869 QTest::mouseMove(view.viewport(), QPoint((layout.at(3).right() + layout.at(3).left()) / 2, 0));
999 870
1000 TRY_COMPARE(seriesSpy.count(), 1);
1001 871 TRY_COMPARE(seriesIndexSpy.count(), 1);
1002 TRY_COMPARE(setSpy1.count(), 0);
1003 TRY_COMPARE(setSpy2.count(), 1);
1004 872 TRY_COMPARE(setIndexSpy1.count(), 0);
1005 873 TRY_COMPARE(setIndexSpy2.count(), 1);
1006 874
1007 875 // should leave set2, bar1
1008 seriesSpyArg = seriesSpy.takeFirst();
1009 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
1010 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
1011 QVERIFY(seriesSpyArg.at(0).toBool() == false);
1012
1013 876 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
1014 877 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
1015 878 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -1017,10 +880,6 void tst_QBarSeries::mousehovered()
1017 880 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
1018 881 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 1);
1019 882
1020 setSpyArg = setSpy2.takeFirst();
1021 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
1022 QVERIFY(setSpyArg.at(0).toBool() == false);
1023
1024 883 setIndexSpyArg = setIndexSpy2.takeFirst();
1025 884 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
1026 885 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -558,10 +558,7 void tst_QHorizontalBarSeries::mousehovered()
558 558
559 559 QList<QBarSet*> barSets = series->barSets();
560 560
561 QSignalSpy seriesSpy(series,SIGNAL(hovered(bool,QBarSet*)));
562 561 QSignalSpy seriesIndexSpy(series, SIGNAL(hovered(bool, int, QBarSet*)));
563 QSignalSpy setSpy1(set1, SIGNAL(hovered(bool)));
564 QSignalSpy setSpy2(set2, SIGNAL(hovered(bool)));
565 562 QSignalSpy setIndexSpy1(set1, SIGNAL(hovered(bool, int)));
566 563 QSignalSpy setIndexSpy2(set2, SIGNAL(hovered(bool, int)));
567 564
@@ -609,37 +606,22 void tst_QHorizontalBarSeries::mousehovered()
609 606 // move mouse to bottom border
610 607 QTest::mouseMove(view.viewport(), QPoint(layout.at(0).center().x(), 300));
611 608 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
612 TRY_COMPARE(seriesSpy.count(), 0);
613 609 TRY_COMPARE(seriesIndexSpy.count(), 0);
614 TRY_COMPARE(setSpy1.count(), 0);
615 TRY_COMPARE(setSpy2.count(), 0);
616 610 TRY_COMPARE(setIndexSpy1.count(), 0);
617 611 TRY_COMPARE(setIndexSpy2.count(), 0);
618 612
619 613 //=======================================================================
620 614 // move mouse on top of set1
621 615 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
622 TRY_COMPARE(seriesSpy.count(), 1);
623 616 TRY_COMPARE(seriesIndexSpy.count(), 1);
624 TRY_COMPARE(setSpy1.count(), 1);
625 TRY_COMPARE(setSpy2.count(), 0);
626 617 TRY_COMPARE(setIndexSpy1.count(), 1);
627 618 TRY_COMPARE(setIndexSpy2.count(), 0);
628 619
629 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
630 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
631 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
632 QVERIFY(seriesSpyArg.at(0).toBool() == true);
633
634 620 QList<QVariant> seriesIndexSpyArg = seriesIndexSpy.takeFirst();
635 621 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
636 622 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
637 623 QVERIFY(seriesIndexSpyArg.at(0).toBool() == true);
638 624
639 QList<QVariant> setSpyArg = setSpy1.takeFirst();
640 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
641 QVERIFY(setSpyArg.at(0).toBool() == true);
642
643 625 QList<QVariant> setIndexSpyArg = setIndexSpy1.takeFirst();
644 626 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
645 627 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -647,47 +629,26 void tst_QHorizontalBarSeries::mousehovered()
647 629 //=======================================================================
648 630 // move mouse from top of set1 to top of set2
649 631 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
650 TRY_COMPARE(seriesSpy.count(), 2);
651 632 TRY_COMPARE(seriesIndexSpy.count(), 2);
652 TRY_COMPARE(setSpy1.count(), 1);
653 TRY_COMPARE(setSpy2.count(), 1);
654 633 TRY_COMPARE(setIndexSpy1.count(), 1);
655 634 TRY_COMPARE(setIndexSpy2.count(), 1);
656 635
657 636 // should leave set1
658 seriesSpyArg = seriesSpy.takeFirst();
659 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
660 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
661 QVERIFY(seriesSpyArg.at(0).toBool() == false);
662
663 637 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
664 638 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
665 639 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
666 640 QVERIFY(seriesIndexSpyArg.at(0).toBool() == false);
667 641
668 setSpyArg = setSpy1.takeFirst();
669 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
670 QVERIFY(setSpyArg.at(0).toBool() == false);
671
672 642 setIndexSpyArg = setIndexSpy1.takeFirst();
673 643 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
674 644 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
675 645
676 646 // should enter set2
677 seriesSpyArg = seriesSpy.takeFirst();
678 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
679 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
680 QVERIFY(seriesSpyArg.at(0).toBool() == true);
681
682 647 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
683 648 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
684 649 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
685 650 QVERIFY(seriesIndexSpyArg.at(0).toBool() == true);
686 651
687 setSpyArg = setSpy2.takeFirst();
688 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
689 QVERIFY(setSpyArg.at(0).toBool() == true);
690
691 652 setIndexSpyArg = setIndexSpy2.takeFirst();
692 653 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
693 654 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -695,28 +656,16 void tst_QHorizontalBarSeries::mousehovered()
695 656 //=======================================================================
696 657 // move mouse from top of set2 to background
697 658 QTest::mouseMove(view.viewport(), QPoint(0, layout.at(0).center().y()));
698 TRY_COMPARE(seriesSpy.count(), 1);
699 659 TRY_COMPARE(seriesIndexSpy.count(), 1);
700 TRY_COMPARE(setSpy1.count(), 0);
701 TRY_COMPARE(setSpy2.count(), 1);
702 660 TRY_COMPARE(setIndexSpy1.count(), 0);
703 661 TRY_COMPARE(setIndexSpy2.count(), 1);
704 662
705 663 // should leave set2
706 seriesSpyArg = seriesSpy.takeFirst();
707 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
708 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
709 QVERIFY(seriesSpyArg.at(0).toBool() == false);
710
711 664 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
712 665 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
713 666 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
714 667 QVERIFY(seriesIndexSpyArg.at(0).toBool() == false);
715 668
716 setSpyArg = setSpy2.takeFirst();
717 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
718 QVERIFY(setSpyArg.at(0).toBool() == false);
719
720 669 setIndexSpyArg = setIndexSpy2.takeFirst();
721 670 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
722 671 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -725,19 +674,11 void tst_QHorizontalBarSeries::mousehovered()
725 674 // move mouse on top of set1, bar0 to check the index (hover into set1)
726 675 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
727 676
728 TRY_COMPARE(seriesSpy.count(), 1);
729 677 TRY_COMPARE(seriesIndexSpy.count(), 1);
730 TRY_COMPARE(setSpy1.count(), 1);
731 TRY_COMPARE(setSpy2.count(), 0);
732 678 TRY_COMPARE(setIndexSpy1.count(), 1);
733 679 TRY_COMPARE(setIndexSpy2.count(), 0);
734 680
735 681 //should enter set1, bar0
736 seriesSpyArg = seriesSpy.takeFirst();
737 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
738 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
739 QVERIFY(seriesSpyArg.at(0).toBool() == true);
740
741 682 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
742 683 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
743 684 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -745,10 +686,6 void tst_QHorizontalBarSeries::mousehovered()
745 686 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
746 687 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 0);
747 688
748 setSpyArg = setSpy1.takeFirst();
749 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
750 QVERIFY(setSpyArg.at(0).toBool() == true);
751
752 689 setIndexSpyArg = setIndexSpy1.takeFirst();
753 690 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
754 691 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -760,19 +697,11 void tst_QHorizontalBarSeries::mousehovered()
760 697 // hover in set1)
761 698 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
762 699
763 TRY_COMPARE(seriesSpy.count(), 2);
764 700 TRY_COMPARE(seriesIndexSpy.count(), 2);
765 TRY_COMPARE(setSpy1.count(), 1);
766 TRY_COMPARE(setSpy2.count(), 1);
767 701 TRY_COMPARE(setIndexSpy1.count(), 1);
768 702 TRY_COMPARE(setIndexSpy2.count(), 1);
769 703
770 704 // should leave set1, bar0
771 seriesSpyArg = seriesSpy.takeFirst();
772 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
773 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
774 QVERIFY(seriesSpyArg.at(0).toBool() == false);
775
776 705 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
777 706 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
778 707 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -780,10 +709,6 void tst_QHorizontalBarSeries::mousehovered()
780 709 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
781 710 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 0);
782 711
783 setSpyArg = setSpy1.takeFirst();
784 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
785 QVERIFY(setSpyArg.at(0).toBool() == false);
786
787 712 setIndexSpyArg = setIndexSpy1.takeFirst();
788 713 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
789 714 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -791,11 +716,6 void tst_QHorizontalBarSeries::mousehovered()
791 716 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
792 717
793 718 // should enter set2, bar0
794 seriesSpyArg = seriesSpy.takeFirst();
795 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
796 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
797 QVERIFY(seriesSpyArg.at(0).toBool() == true);
798
799 719 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
800 720 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
801 721 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -803,10 +723,6 void tst_QHorizontalBarSeries::mousehovered()
803 723 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
804 724 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 0);
805 725
806 setSpyArg = setSpy2.takeFirst();
807 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
808 QVERIFY(setSpyArg.at(0).toBool() == true);
809
810 726 setIndexSpyArg = setIndexSpy2.takeFirst();
811 727 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
812 728 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -818,19 +734,11 void tst_QHorizontalBarSeries::mousehovered()
818 734 // hover in set1)
819 735 QTest::mouseMove(view.viewport(), layout.at(2).center().toPoint());
820 736
821 TRY_COMPARE(seriesSpy.count(), 2);
822 737 TRY_COMPARE(seriesIndexSpy.count(), 2);
823 TRY_COMPARE(setSpy1.count(), 1);
824 TRY_COMPARE(setSpy2.count(), 1);
825 738 TRY_COMPARE(setIndexSpy1.count(), 1);
826 739 TRY_COMPARE(setIndexSpy2.count(), 1);
827 740
828 741 // should leave set2, bar0
829 seriesSpyArg = seriesSpy.takeFirst();
830 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
831 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
832 QVERIFY(seriesSpyArg.at(0).toBool() == false);
833
834 742 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
835 743 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
836 744 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -838,10 +746,6 void tst_QHorizontalBarSeries::mousehovered()
838 746 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
839 747 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 0);
840 748
841 setSpyArg = setSpy2.takeFirst();
842 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
843 QVERIFY(setSpyArg.at(0).toBool() == false);
844
845 749 setIndexSpyArg = setIndexSpy2.takeFirst();
846 750 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
847 751 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -849,11 +753,6 void tst_QHorizontalBarSeries::mousehovered()
849 753 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
850 754
851 755 // should enter set1, bar1
852 seriesSpyArg = seriesSpy.takeFirst();
853 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
854 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
855 QVERIFY(seriesSpyArg.at(0).toBool() == true);
856
857 756 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
858 757 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
859 758 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -861,10 +760,6 void tst_QHorizontalBarSeries::mousehovered()
861 760 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
862 761 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 1);
863 762
864 setSpyArg = setSpy1.takeFirst();
865 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
866 QVERIFY(setSpyArg.at(0).toBool() == true);
867
868 763 setIndexSpyArg = setIndexSpy1.takeFirst();
869 764 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
870 765 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -876,19 +771,11 void tst_QHorizontalBarSeries::mousehovered()
876 771 // (hover out set1)
877 772 QTest::mouseMove(view.viewport(), QPoint(0, (layout.at(2).top() + layout.at(3).bottom()) / 2));
878 773
879 TRY_COMPARE(seriesSpy.count(), 1);
880 774 TRY_COMPARE(seriesIndexSpy.count(), 1);
881 TRY_COMPARE(setSpy1.count(), 1);
882 TRY_COMPARE(setSpy2.count(), 0);
883 775 TRY_COMPARE(setIndexSpy1.count(), 1);
884 776 TRY_COMPARE(setIndexSpy2.count(), 0);
885 777
886 778 // should leave set1, bar1
887 seriesSpyArg = seriesSpy.takeFirst();
888 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
889 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
890 QVERIFY(seriesSpyArg.at(0).toBool() == false);
891
892 779 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
893 780 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
894 781 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -896,10 +783,6 void tst_QHorizontalBarSeries::mousehovered()
896 783 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
897 784 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 1);
898 785
899 setSpyArg = setSpy1.takeFirst();
900 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
901 QVERIFY(setSpyArg.at(0).toBool() == false);
902
903 786 setIndexSpyArg = setIndexSpy1.takeFirst();
904 787 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
905 788 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -910,19 +793,11 void tst_QHorizontalBarSeries::mousehovered()
910 793 // move mouse on top of set2, bar1 to check the index (hover in set2)
911 794 QTest::mouseMove(view.viewport(), layout.at(3).center().toPoint());
912 795
913 TRY_COMPARE(seriesSpy.count(), 1);
914 796 TRY_COMPARE(seriesIndexSpy.count(), 1);
915 TRY_COMPARE(setSpy1.count(), 0);
916 TRY_COMPARE(setSpy2.count(), 1);
917 797 TRY_COMPARE(setIndexSpy1.count(), 0);
918 798 TRY_COMPARE(setIndexSpy2.count(), 1);
919 799
920 800 // should enter set2, bar1
921 seriesSpyArg = seriesSpy.takeFirst();
922 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
923 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
924 QVERIFY(seriesSpyArg.at(0).toBool() == true);
925
926 801 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
927 802 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
928 803 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -930,10 +805,6 void tst_QHorizontalBarSeries::mousehovered()
930 805 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
931 806 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 1);
932 807
933 setSpyArg = setSpy2.takeFirst();
934 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
935 QVERIFY(setSpyArg.at(0).toBool() == true);
936
937 808 setIndexSpyArg = setIndexSpy2.takeFirst();
938 809 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
939 810 QVERIFY(setIndexSpyArg.at(0).toBool() == true);
@@ -945,19 +816,11 void tst_QHorizontalBarSeries::mousehovered()
945 816 //(hover out set2)
946 817 QTest::mouseMove(view.viewport(), QPoint(0, (layout.at(3).top() + layout.at(3).bottom()) / 2));
947 818
948 TRY_COMPARE(seriesSpy.count(), 1);
949 819 TRY_COMPARE(seriesIndexSpy.count(), 1);
950 TRY_COMPARE(setSpy1.count(), 0);
951 TRY_COMPARE(setSpy2.count(), 1);
952 820 TRY_COMPARE(setIndexSpy1.count(), 0);
953 821 TRY_COMPARE(setIndexSpy2.count(), 1);
954 822
955 823 // should leave set2, bar1
956 seriesSpyArg = seriesSpy.takeFirst();
957 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
958 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
959 QVERIFY(seriesSpyArg.at(0).toBool() == false);
960
961 824 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
962 825 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
963 826 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -965,10 +828,6 void tst_QHorizontalBarSeries::mousehovered()
965 828 QVERIFY(seriesIndexSpyArg.at(1).type() == QVariant::Int);
966 829 QVERIFY(seriesIndexSpyArg.at(1).toInt() == 1);
967 830
968 setSpyArg = setSpy2.takeFirst();
969 QVERIFY(setSpyArg.at(0).type() == QVariant::Bool);
970 QVERIFY(setSpyArg.at(0).toBool() == false);
971
972 831 setIndexSpyArg = setIndexSpy2.takeFirst();
973 832 QVERIFY(setIndexSpyArg.at(0).type() == QVariant::Bool);
974 833 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
@@ -306,7 +306,6 void tst_QHorizontalPercentBarSeries::mousehovered()
306 306
307 307 QList<QBarSet*> barSets = series->barSets();
308 308
309 QSignalSpy seriesSpy(series,SIGNAL(hovered(bool,QBarSet*)));
310 309 QSignalSpy seriesIndexSpy(series, SIGNAL(hovered(bool, int, QBarSet*)));
311 310 QSignalSpy setIndexSpy1(set1, SIGNAL(hovered(bool, int)));
312 311 QSignalSpy setIndexSpy2(set2, SIGNAL(hovered(bool, int)));
@@ -355,22 +354,15 void tst_QHorizontalPercentBarSeries::mousehovered()
355 354 // move mouse to left border
356 355 QTest::mouseMove(view.viewport(), QPoint(0, layout.at(4).center().y()));
357 356 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
358 TRY_COMPARE(seriesSpy.count(), 0);
359 357 TRY_COMPARE(seriesIndexSpy.count(), 0);
360 358
361 359 //=======================================================================
362 360 // move mouse on top of set1
363 361 QTest::mouseMove(view.viewport(), layout.at(4).center().toPoint());
364 TRY_COMPARE(seriesSpy.count(), 1);
365 362 TRY_COMPARE(seriesIndexSpy.count(), 1);
366 363 TRY_COMPARE(setIndexSpy1.count(), 1);
367 364 TRY_COMPARE(setIndexSpy2.count(), 0);
368 365
369 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
370 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
371 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
372 QVERIFY(seriesSpyArg.at(0).toBool() == true);
373
374 366 QList<QVariant> seriesIndexSpyArg = seriesIndexSpy.takeFirst();
375 367 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
376 368 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -383,17 +375,11 void tst_QHorizontalPercentBarSeries::mousehovered()
383 375 //=======================================================================
384 376 // move mouse from top of set1 to top of set2
385 377 QTest::mouseMove(view.viewport(), layout.at(5).center().toPoint());
386 TRY_COMPARE(seriesSpy.count(), 2);
387 378 TRY_COMPARE(seriesIndexSpy.count(), 2);
388 379 TRY_COMPARE(setIndexSpy1.count(), 1);
389 380 TRY_COMPARE(setIndexSpy2.count(), 1);
390 381
391 382 // should leave set1
392 seriesSpyArg = seriesSpy.takeFirst();
393 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
394 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
395 QVERIFY(seriesSpyArg.at(0).toBool() == false);
396
397 383 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
398 384 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
399 385 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -404,11 +390,6 void tst_QHorizontalPercentBarSeries::mousehovered()
404 390 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
405 391
406 392 // should enter set2
407 seriesSpyArg = seriesSpy.takeFirst();
408 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
409 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
410 QVERIFY(seriesSpyArg.at(0).toBool() == true);
411
412 393 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
413 394 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
414 395 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -421,17 +402,11 void tst_QHorizontalPercentBarSeries::mousehovered()
421 402 //=======================================================================
422 403 // move mouse from top of set2 to background
423 404 QTest::mouseMove(view.viewport(), QPoint(layout.at(5).center().x(), 0));
424 TRY_COMPARE(seriesSpy.count(), 1);
425 405 TRY_COMPARE(seriesIndexSpy.count(), 1);
426 406 TRY_COMPARE(setIndexSpy1.count(), 0);
427 407 TRY_COMPARE(setIndexSpy2.count(), 1);
428 408
429 409 // should leave set2
430 seriesSpyArg = seriesSpy.takeFirst();
431 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
432 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
433 QVERIFY(seriesSpyArg.at(0).toBool() == false);
434
435 410 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
436 411 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
437 412 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -445,17 +420,11 void tst_QHorizontalPercentBarSeries::mousehovered()
445 420 // move mouse on top of set1, bar0 to check the index (hover into set1)
446 421 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
447 422
448 TRY_COMPARE(seriesSpy.count(), 1);
449 423 TRY_COMPARE(seriesIndexSpy.count(), 1);
450 424 TRY_COMPARE(setIndexSpy1.count(), 1);
451 425 TRY_COMPARE(setIndexSpy2.count(), 0);
452 426
453 427 //should enter set1, bar0
454 seriesSpyArg = seriesSpy.takeFirst();
455 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
456 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
457 QVERIFY(seriesSpyArg.at(0).toBool() == true);
458
459 428 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
460 429 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
461 430 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -475,17 +444,11 void tst_QHorizontalPercentBarSeries::mousehovered()
475 444 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
476 445 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
477 446
478 TRY_COMPARE(seriesSpy.count(), 2);
479 447 TRY_COMPARE(seriesIndexSpy.count(), 2);
480 448 TRY_COMPARE(setIndexSpy1.count(), 1);
481 449 TRY_COMPARE(setIndexSpy2.count(), 1);
482 450
483 451 //should leave set1, bar0
484 seriesSpyArg = seriesSpy.takeFirst();
485 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
486 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
487 QVERIFY(seriesSpyArg.at(0).toBool() == false);
488
489 452 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
490 453 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
491 454 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -500,11 +463,6 void tst_QHorizontalPercentBarSeries::mousehovered()
500 463 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
501 464
502 465 //should enter set2, bar0
503 seriesSpyArg = seriesSpy.takeFirst();
504 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
505 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
506 QVERIFY(seriesSpyArg.at(0).toBool() == true);
507
508 466 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
509 467 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
510 468 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -523,17 +481,11 void tst_QHorizontalPercentBarSeries::mousehovered()
523 481 // hover in set1)
524 482 QTest::mouseMove(view.viewport(), layout.at(2).center().toPoint());
525 483
526 TRY_COMPARE(seriesSpy.count(), 2);
527 484 TRY_COMPARE(seriesIndexSpy.count(), 2);
528 485 TRY_COMPARE(setIndexSpy1.count(), 1);
529 486 TRY_COMPARE(setIndexSpy2.count(), 1);
530 487
531 488 //should leave set2, bar0
532 seriesSpyArg = seriesSpy.takeFirst();
533 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
534 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
535 QVERIFY(seriesSpyArg.at(0).toBool() == false);
536
537 489 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
538 490 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
539 491 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -548,11 +500,6 void tst_QHorizontalPercentBarSeries::mousehovered()
548 500 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
549 501
550 502 //should enter set1, bar1
551 seriesSpyArg = seriesSpy.takeFirst();
552 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
553 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
554 QVERIFY(seriesSpyArg.at(0).toBool() == true);
555
556 503 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
557 504 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
558 505 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -571,17 +518,11 void tst_QHorizontalPercentBarSeries::mousehovered()
571 518 QTest::mouseMove(view.viewport(), QPoint(layout.at(3).left(),
572 519 (layout.at(3).top() + layout.at(4).bottom()) / 2));
573 520
574 TRY_COMPARE(seriesSpy.count(), 1);
575 521 TRY_COMPARE(seriesIndexSpy.count(), 1);
576 522 TRY_COMPARE(setIndexSpy1.count(), 1);
577 523 TRY_COMPARE(setIndexSpy2.count(), 0);
578 524
579 525 //should leave set1, bar1
580 seriesSpyArg = seriesSpy.takeFirst();
581 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
582 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
583 QVERIFY(seriesSpyArg.at(0).toBool() == false);
584
585 526 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
586 527 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
587 528 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -599,17 +540,11 void tst_QHorizontalPercentBarSeries::mousehovered()
599 540 // move mouse on top of set2, bar1 to check the index (hover in set2)
600 541 QTest::mouseMove(view.viewport(), layout.at(3).center().toPoint());
601 542
602 TRY_COMPARE(seriesSpy.count(), 1);
603 543 TRY_COMPARE(seriesIndexSpy.count(), 1);
604 544 TRY_COMPARE(setIndexSpy1.count(), 0);
605 545 TRY_COMPARE(setIndexSpy2.count(), 1);
606 546
607 547 //should enter set2, bar1
608 seriesSpyArg = seriesSpy.takeFirst();
609 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
610 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
611 QVERIFY(seriesSpyArg.at(0).toBool() == true);
612
613 548 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
614 549 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
615 550 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -629,17 +564,11 void tst_QHorizontalPercentBarSeries::mousehovered()
629 564 (layout.at(3).top() + layout.at(4).bottom()) / 2));
630 565
631 566 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
632 TRY_COMPARE(seriesSpy.count(), 1);
633 567 TRY_COMPARE(seriesIndexSpy.count(), 1);
634 568 TRY_COMPARE(setIndexSpy1.count(), 0);
635 569 TRY_COMPARE(setIndexSpy2.count(), 1);
636 570
637 571 //should leave set1, bar1
638 seriesSpyArg = seriesSpy.takeFirst();
639 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
640 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
641 QVERIFY(seriesSpyArg.at(0).toBool() == false);
642
643 572 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
644 573 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
645 574 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -310,7 +310,6 void tst_QHorizontalStackedBarSeries::mousehovered()
310 310
311 311 QList<QBarSet*> barSets = series->barSets();
312 312
313 QSignalSpy seriesSpy(series,SIGNAL(hovered(bool,QBarSet*)));
314 313 QSignalSpy seriesIndexSpy(series, SIGNAL(hovered(bool, int, QBarSet*)));
315 314 QSignalSpy setIndexSpy1(set1, SIGNAL(hovered(bool, int)));
316 315 QSignalSpy setIndexSpy2(set2, SIGNAL(hovered(bool, int)));
@@ -364,22 +363,15 void tst_QHorizontalStackedBarSeries::mousehovered()
364 363 // move mouse to left border
365 364 QTest::mouseMove(view.viewport(), QPoint(0, layout.at(4).center().y()));
366 365 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
367 TRY_COMPARE(seriesSpy.count(), 0);
368 366 TRY_COMPARE(seriesIndexSpy.count(), 0);
369 367
370 368 //=======================================================================
371 369 // move mouse on top of set1
372 370 QTest::mouseMove(view.viewport(), layout.at(4).center().toPoint());
373 TRY_COMPARE(seriesSpy.count(), 1);
374 371 TRY_COMPARE(seriesIndexSpy.count(), 1);
375 372 TRY_COMPARE(setIndexSpy1.count(), 1);
376 373 TRY_COMPARE(setIndexSpy2.count(), 0);
377 374
378 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
379 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
380 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
381 QVERIFY(seriesSpyArg.at(0).toBool() == true);
382
383 375 QList<QVariant> seriesIndexSpyArg = seriesIndexSpy.takeFirst();
384 376 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
385 377 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -392,17 +384,11 void tst_QHorizontalStackedBarSeries::mousehovered()
392 384 //=======================================================================
393 385 // move mouse from top of set1 to top of set2
394 386 QTest::mouseMove(view.viewport(), layout.at(5).center().toPoint());
395 TRY_COMPARE(seriesSpy.count(), 2);
396 387 TRY_COMPARE(seriesIndexSpy.count(), 2);
397 388 TRY_COMPARE(setIndexSpy1.count(), 1);
398 389 TRY_COMPARE(setIndexSpy2.count(), 1);
399 390
400 391 // should leave set1
401 seriesSpyArg = seriesSpy.takeFirst();
402 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
403 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
404 QVERIFY(seriesSpyArg.at(0).toBool() == false);
405
406 392 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
407 393 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
408 394 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -413,11 +399,6 void tst_QHorizontalStackedBarSeries::mousehovered()
413 399 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
414 400
415 401 // should enter set2
416 seriesSpyArg = seriesSpy.takeFirst();
417 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
418 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
419 QVERIFY(seriesSpyArg.at(0).toBool() == true);
420
421 402 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
422 403 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
423 404 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -430,17 +411,11 void tst_QHorizontalStackedBarSeries::mousehovered()
430 411 //=======================================================================
431 412 // move mouse from top of set2 to background
432 413 QTest::mouseMove(view.viewport(), QPoint(layout.at(5).center().y(), 0));
433 TRY_COMPARE(seriesSpy.count(), 1);
434 414 TRY_COMPARE(seriesIndexSpy.count(), 1);
435 415 TRY_COMPARE(setIndexSpy1.count(), 0);
436 416 TRY_COMPARE(setIndexSpy2.count(), 1);
437 417
438 418 // should leave set2
439 seriesSpyArg = seriesSpy.takeFirst();
440 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
441 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
442 QVERIFY(seriesSpyArg.at(0).toBool() == false);
443
444 419 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
445 420 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
446 421 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -454,17 +429,11 void tst_QHorizontalStackedBarSeries::mousehovered()
454 429 // move mouse on top of set1, bar0 to check the index (hover into set1)
455 430 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
456 431
457 TRY_COMPARE(seriesSpy.count(), 1);
458 432 TRY_COMPARE(seriesIndexSpy.count(), 1);
459 433 TRY_COMPARE(setIndexSpy1.count(), 1);
460 434 TRY_COMPARE(setIndexSpy2.count(), 0);
461 435
462 436 //should enter set1, bar0
463 seriesSpyArg = seriesSpy.takeFirst();
464 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
465 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
466 QVERIFY(seriesSpyArg.at(0).toBool() == true);
467
468 437 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
469 438 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
470 439 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -484,17 +453,11 void tst_QHorizontalStackedBarSeries::mousehovered()
484 453 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
485 454 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
486 455
487 TRY_COMPARE(seriesSpy.count(), 2);
488 456 TRY_COMPARE(seriesIndexSpy.count(), 2);
489 457 TRY_COMPARE(setIndexSpy1.count(), 1);
490 458 TRY_COMPARE(setIndexSpy2.count(), 1);
491 459
492 460 //should leave set1, bar0
493 seriesSpyArg = seriesSpy.takeFirst();
494 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
495 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
496 QVERIFY(seriesSpyArg.at(0).toBool() == false);
497
498 461 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
499 462 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
500 463 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -509,11 +472,6 void tst_QHorizontalStackedBarSeries::mousehovered()
509 472 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
510 473
511 474 //should enter set2, bar0
512 seriesSpyArg = seriesSpy.takeFirst();
513 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
514 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
515 QVERIFY(seriesSpyArg.at(0).toBool() == true);
516
517 475 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
518 476 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
519 477 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -532,17 +490,11 void tst_QHorizontalStackedBarSeries::mousehovered()
532 490 // hover in set1)
533 491 QTest::mouseMove(view.viewport(), layout.at(2).center().toPoint());
534 492
535 TRY_COMPARE(seriesSpy.count(), 2);
536 493 TRY_COMPARE(seriesIndexSpy.count(), 2);
537 494 TRY_COMPARE(setIndexSpy1.count(), 1);
538 495 TRY_COMPARE(setIndexSpy2.count(), 1);
539 496
540 497 //should leave set2, bar0
541 seriesSpyArg = seriesSpy.takeFirst();
542 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
543 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
544 QVERIFY(seriesSpyArg.at(0).toBool() == false);
545
546 498 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
547 499 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
548 500 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -557,11 +509,6 void tst_QHorizontalStackedBarSeries::mousehovered()
557 509 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
558 510
559 511 //should enter set1, bar1
560 seriesSpyArg = seriesSpy.takeFirst();
561 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
562 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
563 QVERIFY(seriesSpyArg.at(0).toBool() == true);
564
565 512 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
566 513 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
567 514 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -580,17 +527,11 void tst_QHorizontalStackedBarSeries::mousehovered()
580 527 QTest::mouseMove(view.viewport(), QPoint(layout.at(3).left(),
581 528 (layout.at(3).top() + layout.at(4).bottom()) / 2));
582 529
583 TRY_COMPARE(seriesSpy.count(), 1);
584 530 TRY_COMPARE(seriesIndexSpy.count(), 1);
585 531 TRY_COMPARE(setIndexSpy1.count(), 1);
586 532 TRY_COMPARE(setIndexSpy2.count(), 0);
587 533
588 534 //should leave set1, bar1
589 seriesSpyArg = seriesSpy.takeFirst();
590 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
591 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
592 QVERIFY(seriesSpyArg.at(0).toBool() == false);
593
594 535 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
595 536 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
596 537 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -608,17 +549,11 void tst_QHorizontalStackedBarSeries::mousehovered()
608 549 // move mouse on top of set2, bar1 to check the index (hover in set2)
609 550 QTest::mouseMove(view.viewport(), layout.at(3).center().toPoint());
610 551
611 TRY_COMPARE(seriesSpy.count(), 1);
612 552 TRY_COMPARE(seriesIndexSpy.count(), 1);
613 553 TRY_COMPARE(setIndexSpy1.count(), 0);
614 554 TRY_COMPARE(setIndexSpy2.count(), 1);
615 555
616 556 //should enter set2, bar1
617 seriesSpyArg = seriesSpy.takeFirst();
618 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
619 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
620 QVERIFY(seriesSpyArg.at(0).toBool() == true);
621
622 557 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
623 558 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
624 559 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -638,17 +573,11 void tst_QHorizontalStackedBarSeries::mousehovered()
638 573 (layout.at(3).top() + layout.at(4).bottom()) / 2));
639 574
640 575 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
641 TRY_COMPARE(seriesSpy.count(), 1);
642 576 TRY_COMPARE(seriesIndexSpy.count(), 1);
643 577 TRY_COMPARE(setIndexSpy1.count(), 0);
644 578 TRY_COMPARE(setIndexSpy2.count(), 1);
645 579
646 580 //should leave set1, bar1
647 seriesSpyArg = seriesSpy.takeFirst();
648 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
649 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
650 QVERIFY(seriesSpyArg.at(0).toBool() == false);
651
652 581 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
653 582 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
654 583 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -308,7 +308,6 void tst_QPercentBarSeries::mousehovered()
308 308
309 309 QList<QBarSet*> barSets = series->barSets();
310 310
311 QSignalSpy seriesSpy(series,SIGNAL(hovered(bool,QBarSet*)));
312 311 QSignalSpy seriesIndexSpy(series, SIGNAL(hovered(bool, int, QBarSet*)));
313 312 QSignalSpy setIndexSpy1(set1, SIGNAL(hovered(bool, int)));
314 313 QSignalSpy setIndexSpy2(set2, SIGNAL(hovered(bool, int)));
@@ -359,22 +358,15 void tst_QPercentBarSeries::mousehovered()
359 358 // move mouse to left border
360 359 QTest::mouseMove(view.viewport(), QPoint(0, layout.at(0).center().y()));
361 360 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
362 TRY_COMPARE(seriesSpy.count(), 0);
363 361 TRY_COMPARE(seriesIndexSpy.count(), 0);
364 362
365 363 //=======================================================================
366 364 // move mouse on top of set1
367 365 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
368 TRY_COMPARE(seriesSpy.count(), 1);
369 366 TRY_COMPARE(seriesIndexSpy.count(), 1);
370 367 TRY_COMPARE(setIndexSpy1.count(), 1);
371 368 TRY_COMPARE(setIndexSpy2.count(), 0);
372 369
373 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
374 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
375 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
376 QVERIFY(seriesSpyArg.at(0).toBool() == true);
377
378 370 QList<QVariant> seriesIndexSpyArg = seriesIndexSpy.takeFirst();
379 371 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
380 372 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -387,17 +379,11 void tst_QPercentBarSeries::mousehovered()
387 379 //=======================================================================
388 380 // move mouse from top of set1 to top of set2
389 381 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
390 TRY_COMPARE(seriesSpy.count(), 2);
391 382 TRY_COMPARE(seriesIndexSpy.count(), 2);
392 383 TRY_COMPARE(setIndexSpy1.count(), 1);
393 384 TRY_COMPARE(setIndexSpy2.count(), 1);
394 385
395 386 // should leave set1
396 seriesSpyArg = seriesSpy.takeFirst();
397 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
398 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
399 QVERIFY(seriesSpyArg.at(0).toBool() == false);
400
401 387 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
402 388 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
403 389 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -408,11 +394,6 void tst_QPercentBarSeries::mousehovered()
408 394 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
409 395
410 396 // should enter set2
411 seriesSpyArg = seriesSpy.takeFirst();
412 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
413 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
414 QVERIFY(seriesSpyArg.at(0).toBool() == true);
415
416 397 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
417 398 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
418 399 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -425,17 +406,11 void tst_QPercentBarSeries::mousehovered()
425 406 //=======================================================================
426 407 // move mouse from top of set2 to background
427 408 QTest::mouseMove(view.viewport(), QPoint(layout.at(1).center().x(), 0));
428 TRY_COMPARE(seriesSpy.count(), 1);
429 409 TRY_COMPARE(seriesIndexSpy.count(), 1);
430 410 TRY_COMPARE(setIndexSpy1.count(), 0);
431 411 TRY_COMPARE(setIndexSpy2.count(), 1);
432 412
433 413 // should leave set2
434 seriesSpyArg = seriesSpy.takeFirst();
435 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
436 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
437 QVERIFY(seriesSpyArg.at(0).toBool() == false);
438
439 414 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
440 415 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
441 416 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -449,17 +424,11 void tst_QPercentBarSeries::mousehovered()
449 424 // move mouse on top of set1, bar0 to check the index (hover into set1)
450 425 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
451 426
452 TRY_COMPARE(seriesSpy.count(), 1);
453 427 TRY_COMPARE(seriesIndexSpy.count(), 1);
454 428 TRY_COMPARE(setIndexSpy1.count(), 1);
455 429 TRY_COMPARE(setIndexSpy2.count(), 0);
456 430
457 431 //should enter set1, bar0
458 seriesSpyArg = seriesSpy.takeFirst();
459 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
460 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
461 QVERIFY(seriesSpyArg.at(0).toBool() == true);
462
463 432 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
464 433 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
465 434 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -478,17 +447,11 void tst_QPercentBarSeries::mousehovered()
478 447 // hover in set2)
479 448 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
480 449
481 TRY_COMPARE(seriesSpy.count(), 2);
482 450 TRY_COMPARE(seriesIndexSpy.count(), 2);
483 451 TRY_COMPARE(setIndexSpy1.count(), 1);
484 452 TRY_COMPARE(setIndexSpy2.count(), 1);
485 453
486 454 //should leave set1, bar0
487 seriesSpyArg = seriesSpy.takeFirst();
488 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
489 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
490 QVERIFY(seriesSpyArg.at(0).toBool() == false);
491
492 455 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
493 456 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
494 457 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -503,11 +466,6 void tst_QPercentBarSeries::mousehovered()
503 466 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
504 467
505 468 //should enter set2, bar0
506 seriesSpyArg = seriesSpy.takeFirst();
507 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
508 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
509 QVERIFY(seriesSpyArg.at(0).toBool() == true);
510
511 469 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
512 470 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
513 471 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -526,17 +484,11 void tst_QPercentBarSeries::mousehovered()
526 484 // hover in set1)
527 485 QTest::mouseMove(view.viewport(), layout.at(2).center().toPoint());
528 486
529 TRY_COMPARE(seriesSpy.count(), 2);
530 487 TRY_COMPARE(seriesIndexSpy.count(), 2);
531 488 TRY_COMPARE(setIndexSpy1.count(), 1);
532 489 TRY_COMPARE(setIndexSpy2.count(), 1);
533 490
534 491 //should leave set2, bar0
535 seriesSpyArg = seriesSpy.takeFirst();
536 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
537 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
538 QVERIFY(seriesSpyArg.at(0).toBool() == false);
539
540 492 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
541 493 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
542 494 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -551,11 +503,6 void tst_QPercentBarSeries::mousehovered()
551 503 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
552 504
553 505 //should enter set1, bar1
554 seriesSpyArg = seriesSpy.takeFirst();
555 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
556 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
557 QVERIFY(seriesSpyArg.at(0).toBool() == true);
558
559 506 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
560 507 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
561 508 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -575,17 +522,11 void tst_QPercentBarSeries::mousehovered()
575 522 layout.at(2).top()));
576 523
577 524 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
578 TRY_COMPARE(seriesSpy.count(), 1);
579 525 TRY_COMPARE(seriesIndexSpy.count(), 1);
580 526 TRY_COMPARE(setIndexSpy1.count(), 1);
581 527 TRY_COMPARE(setIndexSpy2.count(), 0);
582 528
583 529 //should leave set1, bar1
584 seriesSpyArg = seriesSpy.takeFirst();
585 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
586 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
587 QVERIFY(seriesSpyArg.at(0).toBool() == false);
588
589 530 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
590 531 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
591 532 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -603,17 +544,11 void tst_QPercentBarSeries::mousehovered()
603 544 // move mouse on top of set2, bar1 to check the index (hover in set2)
604 545 QTest::mouseMove(view.viewport(), layout.at(3).center().toPoint());
605 546
606 TRY_COMPARE(seriesSpy.count(), 1);
607 547 TRY_COMPARE(seriesIndexSpy.count(), 1);
608 548 TRY_COMPARE(setIndexSpy1.count(), 0);
609 549 TRY_COMPARE(setIndexSpy2.count(), 1);
610 550
611 551 //should enter set2, bar1
612 seriesSpyArg = seriesSpy.takeFirst();
613 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
614 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
615 QVERIFY(seriesSpyArg.at(0).toBool() == true);
616
617 552 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
618 553 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
619 554 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -633,17 +568,11 void tst_QPercentBarSeries::mousehovered()
633 568 layout.at(2).top()));
634 569
635 570 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
636 TRY_COMPARE(seriesSpy.count(), 1);
637 571 TRY_COMPARE(seriesIndexSpy.count(), 1);
638 572 TRY_COMPARE(setIndexSpy1.count(), 0);
639 573 TRY_COMPARE(setIndexSpy2.count(), 1);
640 574
641 575 //should leave set1, bar1
642 seriesSpyArg = seriesSpy.takeFirst();
643 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
644 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
645 QVERIFY(seriesSpyArg.at(0).toBool() == false);
646
647 576 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
648 577 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
649 578 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -310,7 +310,6 void tst_QStackedBarSeries::mousehovered()
310 310
311 311 QList<QBarSet*> barSets = series->barSets();
312 312
313 QSignalSpy seriesSpy(series,SIGNAL(hovered(bool,QBarSet*)));
314 313 QSignalSpy seriesIndexSpy(series, SIGNAL(hovered(bool, int, QBarSet*)));
315 314 QSignalSpy setIndexSpy1(set1, SIGNAL(hovered(bool, int)));
316 315 QSignalSpy setIndexSpy2(set2, SIGNAL(hovered(bool, int)));
@@ -365,22 +364,15 void tst_QStackedBarSeries::mousehovered()
365 364 // move mouse to left border
366 365 QTest::mouseMove(view.viewport(), QPoint(0, layout.at(0).center().y()));
367 366 QCoreApplication::processEvents(QEventLoop::AllEvents, 10000);
368 TRY_COMPARE(seriesSpy.count(), 0);
369 367 TRY_COMPARE(seriesIndexSpy.count(), 0);
370 368
371 369 //=======================================================================
372 370 // move mouse on top of set1
373 371 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
374 TRY_COMPARE(seriesSpy.count(), 1);
375 372 TRY_COMPARE(seriesIndexSpy.count(), 1);
376 373 TRY_COMPARE(setIndexSpy1.count(), 1);
377 374 TRY_COMPARE(setIndexSpy2.count(), 0);
378 375
379 QList<QVariant> seriesSpyArg = seriesSpy.takeFirst();
380 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
381 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
382 QVERIFY(seriesSpyArg.at(0).toBool() == true);
383
384 376 QList<QVariant> seriesIndexSpyArg = seriesIndexSpy.takeFirst();
385 377 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
386 378 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -393,17 +385,11 void tst_QStackedBarSeries::mousehovered()
393 385 //=======================================================================
394 386 // move mouse from top of set1 to top of set2
395 387 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
396 TRY_COMPARE(seriesSpy.count(), 2);
397 388 TRY_COMPARE(seriesIndexSpy.count(), 2);
398 389 TRY_COMPARE(setIndexSpy1.count(), 1);
399 390 TRY_COMPARE(setIndexSpy2.count(), 1);
400 391
401 392 // should leave set1
402 seriesSpyArg = seriesSpy.takeFirst();
403 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
404 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
405 QVERIFY(seriesSpyArg.at(0).toBool() == false);
406
407 393 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
408 394 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
409 395 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -414,11 +400,6 void tst_QStackedBarSeries::mousehovered()
414 400 QVERIFY(setIndexSpyArg.at(0).toBool() == false);
415 401
416 402 // should enter set2
417 seriesSpyArg = seriesSpy.takeFirst();
418 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
419 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
420 QVERIFY(seriesSpyArg.at(0).toBool() == true);
421
422 403 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
423 404 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
424 405 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -431,17 +412,11 void tst_QStackedBarSeries::mousehovered()
431 412 //=======================================================================
432 413 // move mouse from top of set2 to background
433 414 QTest::mouseMove(view.viewport(), QPoint(layout.at(1).center().x(), 0));
434 TRY_COMPARE(seriesSpy.count(), 1);
435 415 TRY_COMPARE(seriesIndexSpy.count(), 1);
436 416 TRY_COMPARE(setIndexSpy1.count(), 0);
437 417 TRY_COMPARE(setIndexSpy2.count(), 1);
438 418
439 419 // should leave set2
440 seriesSpyArg = seriesSpy.takeFirst();
441 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
442 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
443 QVERIFY(seriesSpyArg.at(0).toBool() == false);
444
445 420 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
446 421 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
447 422 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -455,17 +430,11 void tst_QStackedBarSeries::mousehovered()
455 430 // move mouse on top of set1, bar0 to check the index (hover into set1)
456 431 QTest::mouseMove(view.viewport(), layout.at(0).center().toPoint());
457 432
458 TRY_COMPARE(seriesSpy.count(), 1);
459 433 TRY_COMPARE(seriesIndexSpy.count(), 1);
460 434 TRY_COMPARE(setIndexSpy1.count(), 1);
461 435 TRY_COMPARE(setIndexSpy2.count(), 0);
462 436
463 437 //should enter set1, bar0
464 seriesSpyArg = seriesSpy.takeFirst();
465 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
466 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
467 QVERIFY(seriesSpyArg.at(0).toBool() == true);
468
469 438 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
470 439 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
471 440 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -484,17 +453,11 void tst_QStackedBarSeries::mousehovered()
484 453 // hover in set2)
485 454 QTest::mouseMove(view.viewport(), layout.at(1).center().toPoint());
486 455
487 TRY_COMPARE(seriesSpy.count(), 2);
488 456 TRY_COMPARE(seriesIndexSpy.count(), 2);
489 457 TRY_COMPARE(setIndexSpy1.count(), 1);
490 458 TRY_COMPARE(setIndexSpy2.count(), 1);
491 459
492 460 //should leave set1, bar0
493 seriesSpyArg = seriesSpy.takeFirst();
494 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
495 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
496 QVERIFY(seriesSpyArg.at(0).toBool() == false);
497
498 461 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
499 462 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
500 463 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -509,11 +472,6 void tst_QStackedBarSeries::mousehovered()
509 472 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
510 473
511 474 //should enter set2, bar0
512 seriesSpyArg = seriesSpy.takeFirst();
513 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
514 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
515 QVERIFY(seriesSpyArg.at(0).toBool() == true);
516
517 475 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
518 476 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
519 477 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -532,17 +490,11 void tst_QStackedBarSeries::mousehovered()
532 490 // hover in set1)
533 491 QTest::mouseMove(view.viewport(), layout.at(2).center().toPoint());
534 492
535 TRY_COMPARE(seriesSpy.count(), 2);
536 493 TRY_COMPARE(seriesIndexSpy.count(), 2);
537 494 TRY_COMPARE(setIndexSpy1.count(), 1);
538 495 TRY_COMPARE(setIndexSpy2.count(), 1);
539 496
540 497 //should leave set2, bar0
541 seriesSpyArg = seriesSpy.takeFirst();
542 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
543 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
544 QVERIFY(seriesSpyArg.at(0).toBool() == false);
545
546 498 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
547 499 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
548 500 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -557,11 +509,6 void tst_QStackedBarSeries::mousehovered()
557 509 QVERIFY(setIndexSpyArg.at(1).toInt() == 0);
558 510
559 511 //should enter set1, bar1
560 seriesSpyArg = seriesSpy.takeFirst();
561 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
562 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
563 QVERIFY(seriesSpyArg.at(0).toBool() == true);
564
565 512 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
566 513 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
567 514 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -581,17 +528,11 void tst_QStackedBarSeries::mousehovered()
581 528 layout.at(2).top()));
582 529
583 530 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
584 TRY_COMPARE(seriesSpy.count(), 1);
585 531 TRY_COMPARE(seriesIndexSpy.count(), 1);
586 532 TRY_COMPARE(setIndexSpy1.count(), 1);
587 533 TRY_COMPARE(setIndexSpy2.count(), 0);
588 534
589 535 //should leave set1, bar1
590 seriesSpyArg = seriesSpy.takeFirst();
591 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set1);
592 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
593 QVERIFY(seriesSpyArg.at(0).toBool() == false);
594
595 536 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
596 537 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set1);
597 538 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -609,17 +550,11 void tst_QStackedBarSeries::mousehovered()
609 550 // move mouse on top of set2, bar1 to check the index (hover in set2)
610 551 QTest::mouseMove(view.viewport(), layout.at(3).center().toPoint());
611 552
612 TRY_COMPARE(seriesSpy.count(), 1);
613 553 TRY_COMPARE(seriesIndexSpy.count(), 1);
614 554 TRY_COMPARE(setIndexSpy1.count(), 0);
615 555 TRY_COMPARE(setIndexSpy2.count(), 1);
616 556
617 557 //should enter set2, bar1
618 seriesSpyArg = seriesSpy.takeFirst();
619 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
620 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
621 QVERIFY(seriesSpyArg.at(0).toBool() == true);
622
623 558 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
624 559 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
625 560 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
@@ -639,17 +574,11 void tst_QStackedBarSeries::mousehovered()
639 574 layout.at(2).top()));
640 575
641 576 QCoreApplication::processEvents(QEventLoop::AllEvents, 1000);
642 TRY_COMPARE(seriesSpy.count(), 1);
643 577 TRY_COMPARE(seriesIndexSpy.count(), 1);
644 578 TRY_COMPARE(setIndexSpy1.count(), 0);
645 579 TRY_COMPARE(setIndexSpy2.count(), 1);
646 580
647 581 //should leave set1, bar1
648 seriesSpyArg = seriesSpy.takeFirst();
649 QCOMPARE(qvariant_cast<QBarSet*>(seriesSpyArg.at(1)), set2);
650 QVERIFY(seriesSpyArg.at(0).type() == QVariant::Bool);
651 QVERIFY(seriesSpyArg.at(0).toBool() == false);
652
653 582 seriesIndexSpyArg = seriesIndexSpy.takeFirst();
654 583 QCOMPARE(qvariant_cast<QBarSet*>(seriesIndexSpyArg.at(2)), set2);
655 584 QVERIFY(seriesIndexSpyArg.at(0).type() == QVariant::Bool);
General Comments 0
You need to be logged in to leave comments. Login now