コード例 #1
0
ファイル: main.cpp プロジェクト: Wushaowei001/mksPlanner
 void testReferenceArea()
 {
      Legend* l = new Legend( );
      QCOMPARE( l->referenceArea(), ( const QWidget* )0 );
      l->setReferenceArea( m_chart );
      QCOMPARE( dynamic_cast< const Chart * >(l->referenceArea()), const_cast< const Chart * >(m_chart) );
      Legend* l1 = new Legend( m_chart );
      QCOMPARE( dynamic_cast< const Chart * >(l1->referenceArea()), const_cast< const Chart * >(m_chart) );
      Legend* l2 = new Legend( m_lines,  m_chart );
      QCOMPARE( dynamic_cast< const Chart * >(l2->referenceArea()), const_cast< const Chart * >(m_chart) );
 }