Ejemplo n.º 1
0
 void testReplacing()
 {
     Legend* l = new Legend( m_chart );
     QPointer<Legend> oldLegend = m_chart->legend();
     QCOMPARE( dynamic_cast< LineDiagram * >(oldLegend->diagram()), m_lines );
     m_chart->replaceLegend( l, oldLegend );
     QVERIFY( oldLegend.isNull() );
     QCOMPARE( l->diagram(), (AbstractDiagram*)0 );
     l->setDiagram( m_lines );
     QCOMPARE( dynamic_cast< LineDiagram * >(l->diagram()), m_lines );
 }