Skip to content
Snippets Groups Projects
Commit 33553279 authored by Paul Tvete's avatar Paul Tvete
Browse files

Fix things moved to the Qt:: namespace

parent 2cbda78a
No related branches found
No related tags found
No related merge requests found
...@@ -128,9 +128,9 @@ void CannonField::paintEvent( QPaintEvent *e ) ...@@ -128,9 +128,9 @@ void CannonField::paintEvent( QPaintEvent *e )
if ( updateR.intersects( barrierRect() ) ) if ( updateR.intersects( barrierRect() ) )
paintBarrier( &p ); paintBarrier( &p );
if ( gameEnded ) { if ( gameEnded ) {
p.setPen( black ); p.setPen( Qt::black );
p.setFont( QFont( "Courier", 48, QFont::Bold ) ); p.setFont( QFont( "Courier", 48, QFont::Bold ) );
p.drawText( rect(), AlignCenter, "Game Over" ); p.drawText( rect(), Qt::AlignCenter, "Game Over" );
} else { } else {
if ( shooting && updateR.intersects( shotRect() ) ) if ( shooting && updateR.intersects( shotRect() ) )
paintShot( &p ); paintShot( &p );
...@@ -142,7 +142,7 @@ void CannonField::paintEvent( QPaintEvent *e ) ...@@ -142,7 +142,7 @@ void CannonField::paintEvent( QPaintEvent *e )
void CannonField::mousePressEvent( QMouseEvent *e ) void CannonField::mousePressEvent( QMouseEvent *e )
{ {
if ( e->button() != LeftButton ) if ( e->button() != Qt::LeftButton )
return; return;
if ( barrelHit( e->pos() ) ) if ( barrelHit( e->pos() ) )
barrelPressed = true; barrelPressed = true;
...@@ -163,7 +163,7 @@ void CannonField::mouseMoveEvent( QMouseEvent *e ) ...@@ -163,7 +163,7 @@ void CannonField::mouseMoveEvent( QMouseEvent *e )
void CannonField::mouseReleaseEvent( QMouseEvent *e ) void CannonField::mouseReleaseEvent( QMouseEvent *e )
{ {
if ( e->button() == LeftButton ) if ( e->button() == Qt::LeftButton )
barrelPressed = false; barrelPressed = false;
} }
...@@ -175,22 +175,22 @@ void CannonField::stopShooting() ...@@ -175,22 +175,22 @@ void CannonField::stopShooting()
void CannonField::paintShot( QPainter *p ) void CannonField::paintShot( QPainter *p )
{ {
p->setBrush( black ); p->setBrush( Qt::black );
p->setPen( NoPen ); p->setPen( Qt::NoPen );
p->drawRect( shotRect() ); p->drawRect( shotRect() );
} }
void CannonField::paintTarget( QPainter *p ) void CannonField::paintTarget( QPainter *p )
{ {
p->setBrush( red ); p->setBrush( Qt::red );
p->setPen( black ); p->setPen( Qt::black );
p->drawRect( targetRect() ); p->drawRect( targetRect() );
} }
void CannonField::paintBarrier( QPainter *p ) void CannonField::paintBarrier( QPainter *p )
{ {
p->setBrush( yellow ); p->setBrush( Qt::yellow );
p->setPen( black ); p->setPen( Qt::black );
p->drawRect( barrierRect() ); p->drawRect( barrierRect() );
} }
...@@ -205,8 +205,8 @@ void CannonField::paintCannon( QPainter *p ) ...@@ -205,8 +205,8 @@ void CannonField::paintCannon( QPainter *p )
pix.fill( this, cr.topLeft() ); pix.fill( this, cr.topLeft() );
tmp.begin( &pix ); tmp.begin( &pix );
tmp.setBrush( blue ); tmp.setBrush( Qt::blue );
tmp.setPen( NoPen ); tmp.setPen( Qt::NoPen );
tmp.translate( 0, pix.height() - 1 ); tmp.translate( 0, pix.height() - 1 );
tmp.drawPie( QRect( -35,-35, 70, 70 ), 0, 90*16 ); tmp.drawPie( QRect( -35,-35, 70, 70 ), 0, 90*16 );
......
...@@ -66,8 +66,8 @@ GameBoard::GameBoard( QWidget *parent, const char *name ) ...@@ -66,8 +66,8 @@ GameBoard::GameBoard( QWidget *parent, const char *name )
QLabel *shotsLeftL = new QLabel( "SHOTS LEFT", this, "shotsleftLabel" ); QLabel *shotsLeftL = new QLabel( "SHOTS LEFT", this, "shotsleftLabel" );
QAccel *accel = new QAccel( this ); QAccel *accel = new QAccel( this );
accel->connectItem( accel->insertItem( Key_Space), this, SLOT(fire()) ); accel->connectItem( accel->insertItem( Qt::Key_Space), this, SLOT(fire()) );
accel->connectItem( accel->insertItem( Key_Q), qApp, SLOT(quit()) ); accel->connectItem( accel->insertItem( Qt::Key_Q), qApp, SLOT(quit()) );
quit->setGeometry( 10, 10, 75, 30 ); quit->setGeometry( 10, 10, 75, 30 );
angle->setGeometry( 10, quit->y() + quit->height() + 10, 75, 130 ); angle->setGeometry( 10, quit->y() + quit->height() + 10, 75, 130 );
......
...@@ -33,7 +33,7 @@ void LCDRange::init() ...@@ -33,7 +33,7 @@ void LCDRange::init()
QScrollBar::Horizontal, // orientation QScrollBar::Horizontal, // orientation
this, "scrollbar" ); this, "scrollbar" );
label = new QLabel( this, "label" ); 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)), lcd, SLOT(display(int)) );
connect( sBar, SIGNAL(valueChanged(int)), SIGNAL(valueChanged(int)) ); connect( sBar, SIGNAL(valueChanged(int)), SIGNAL(valueChanged(int)) );
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment