コード例 #1
0
ファイル: main.cpp プロジェクト: Wushaowei001/mksPlanner
 void testLegendSettings()
 {
    Legend* l = new Legend( m_lines,  m_chart );
    QVERIFY( l->position() == Position::NorthEast );
    QVERIFY( l->alignment() == Qt::AlignCenter );
    QVERIFY( l->orientation() == Qt::Vertical );
    QVERIFY( l->showLines() == false );
    QVERIFY( !l->titleText().isEmpty() );
    QVERIFY( l->spacing() == 1 );
    QVERIFY( l->legendStyle() == Legend::MarkersOnly );
    l->setPosition( Position::North );
    l->setAlignment( Qt::AlignLeft );
    l->setOrientation( Qt::Horizontal );
    l->setShowLines( true );
    l->setTitleText( QString( tr( "Lines" ) ) );
    l->setSpacing( 2 );
    l->setLegendStyle( Legend::LinesOnly );
    QVERIFY( l->position() == Position::North );
    QVERIFY( l->alignment() == Qt::AlignLeft );
    QVERIFY( l->orientation() == Qt::Horizontal );
    QVERIFY( l->showLines() == true );
    QVERIFY( l->titleText() == QString( tr( "Lines" ) ) );
    QVERIFY( l->spacing() == 2 );
    QVERIFY( l->legendStyle() == Legend::LinesOnly );
 }