From 335532793ad504af1865fdf8438926d6dac7b827 Mon Sep 17 00:00:00 2001 From: Paul Olav Tvete <paul.tvete@qt.io> Date: Tue, 22 May 2018 16:07:53 +0200 Subject: [PATCH] Fix things moved to the Qt:: namespace --- t14/cannon.cpp | 24 ++++++++++++------------ t14/gamebrd.cpp | 4 ++-- t14/lcdrange.cpp | 2 +- 3 files changed, 15 insertions(+), 15 deletions(-) diff --git a/t14/cannon.cpp b/t14/cannon.cpp index 5a3208c..6ae4b20 100644 --- a/t14/cannon.cpp +++ b/t14/cannon.cpp @@ -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 ); diff --git a/t14/gamebrd.cpp b/t14/gamebrd.cpp index 679e93d..3bf14c9 100644 --- a/t14/gamebrd.cpp +++ b/t14/gamebrd.cpp @@ -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 ); diff --git a/t14/lcdrange.cpp b/t14/lcdrange.cpp index 89795a4..f5664d2 100644 --- a/t14/lcdrange.cpp +++ b/t14/lcdrange.cpp @@ -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)) ); -- GitLab