Commit 33553279 authored by Paul Tvete's avatar Paul Tvete
Browse files

Fix things moved to the Qt:: namespace

parent 2cbda78a
Loading
Loading
Loading
Loading
+12 −12
Original line number Diff line number Diff line
@@ -128,9 +128,9 @@ void CannonField::paintEvent( QPaintEvent *e )
    if ( updateR.intersects( barrierRect() ) )
        paintBarrier( &p );
    if ( gameEnded ) {
        p.setPen( black );
    p.setPen( Qt::black );
        p.setFont( QFont( "Courier", 48, QFont::Bold ) );
        p.drawText( rect(), AlignCenter, "Game Over" );
        p.drawText( rect(), Qt::AlignCenter, "Game Over" );
    } else {
        if ( shooting &&  updateR.intersects( shotRect() ) )
            paintShot( &p );
@@ -142,7 +142,7 @@ void CannonField::paintEvent( QPaintEvent *e )

void CannonField::mousePressEvent( QMouseEvent *e )
{
    if ( e->button() != LeftButton )
    if ( e->button() != Qt::LeftButton )
        return;
    if ( barrelHit( e->pos() ) )
        barrelPressed = true;
@@ -163,7 +163,7 @@ void CannonField::mouseMoveEvent( QMouseEvent *e )

void CannonField::mouseReleaseEvent( QMouseEvent *e )
{
    if ( e->button() == LeftButton )
    if ( e->button() == Qt::LeftButton )
        barrelPressed = false;
}

@@ -175,22 +175,22 @@ void CannonField::stopShooting()

void CannonField::paintShot( QPainter *p )
{
    p->setBrush( black );
    p->setPen( NoPen );
    p->setBrush( Qt::black );
    p->setPen( Qt::NoPen );
    p->drawRect( shotRect() );
}

void CannonField::paintTarget( QPainter *p )
{
    p->setBrush( red );
    p->setPen( black );
    p->setBrush( Qt::red );
    p->setPen( Qt::black );
    p->drawRect( targetRect() );
}

void CannonField::paintBarrier( QPainter *p )
{
    p->setBrush( yellow );
    p->setPen( black );
    p->setBrush( Qt::yellow );
    p->setPen( Qt::black );
    p->drawRect( barrierRect() );
}

@@ -205,8 +205,8 @@ void CannonField::paintCannon( QPainter *p )
    pix.fill( this, cr.topLeft() );

    tmp.begin( &pix );
    tmp.setBrush( blue );
    tmp.setPen( NoPen );
    tmp.setBrush( Qt::blue );
    tmp.setPen( Qt::NoPen );

    tmp.translate( 0, pix.height() - 1 );
    tmp.drawPie( QRect( -35,-35, 70, 70 ), 0, 90*16 );
+2 −2
Original line number Diff line number Diff line
@@ -66,8 +66,8 @@ GameBoard::GameBoard( QWidget *parent, const char *name )
    QLabel *shotsLeftL = new QLabel( "SHOTS LEFT", this, "shotsleftLabel" );

    QAccel *accel = new QAccel( this );
    accel->connectItem( accel->insertItem( Key_Space), this, SLOT(fire()) );
    accel->connectItem( accel->insertItem( Key_Q), qApp, SLOT(quit()) );
    accel->connectItem( accel->insertItem( Qt::Key_Space), this, SLOT(fire()) );
    accel->connectItem( accel->insertItem( Qt::Key_Q), qApp, SLOT(quit()) );

    quit->setGeometry( 10, 10, 75, 30 );
    angle->setGeometry( 10, quit->y() + quit->height() + 10, 75, 130 );
+1 −1
Original line number Diff line number Diff line
@@ -33,7 +33,7 @@ void LCDRange::init()
                           QScrollBar::Horizontal, 	// orientation
                           this, "scrollbar" );
    label  = new QLabel( this, "label"  );
    label->setAlignment( AlignCenter );
    label->setAlignment( Qt::AlignCenter );
    connect( sBar, SIGNAL(valueChanged(int)), lcd, SLOT(display(int)) );
    connect( sBar, SIGNAL(valueChanged(int)), SIGNAL(valueChanged(int)) );