Commit 884b4792 authored by Paul Tvete's avatar Paul Tvete

Remove "name" argument

All constructors of QObject subclasses used to take the object name
as a parameter.
parent 33553279
......@@ -16,8 +16,8 @@
#include <math.h>
#include <stdlib.h>
CannonField::CannonField( QWidget *parent, const char *name )
: QWidget( parent, name )
CannonField::CannonField(QWidget *parent)
: QWidget( parent )
{
ang = 45;
f = 0;
......
......@@ -14,7 +14,7 @@ class CannonField : public QWidget
{
Q_OBJECT
public:
CannonField( QWidget *parent=0, const char *name=0 );
CannonField( QWidget *parent=0 );
int angle() const { return ang; }
int force() const { return f; }
......
......@@ -16,26 +16,26 @@
#include "lcdrange.h"
#include "cannon.h"
GameBoard::GameBoard( QWidget *parent, const char *name )
: QWidget( parent, name )
GameBoard::GameBoard(QWidget *parent)
: QWidget( parent )
{
setMinimumSize( 500, 355 );
quit = new QPushButton( "Quit", this, "quit" );
quit = new QPushButton( "Quit", this );
quit->setFont( QFont( "Times", 18, QFont::Bold ) );
connect( quit, SIGNAL(clicked()), qApp, SLOT(quit()) );
angle = new LCDRange( "ANGLE", this, "angle" );
angle = new LCDRange( "ANGLE", this );
angle->setRange( 5, 70 );
force = new LCDRange( "FORCE", this, "force" );
force = new LCDRange( "FORCE", this );
force->setRange( 10, 50 );
frame = new QFrame( this, "cannonFrame" );
frame = new QFrame( this );
frame->setFrameStyle( QFrame::WinPanel | QFrame::Sunken );
cannonField = new CannonField( this, "cannonField" );
cannonField = new CannonField( this );
cannonField->setBackgroundColor( QColor( 250, 250, 200) );
connect( angle,SIGNAL(valueChanged(int)), cannonField,SLOT(setAngle(int)));
......@@ -50,20 +50,20 @@ GameBoard::GameBoard( QWidget *parent, const char *name )
angle->setValue( 60 );
force->setValue( 25 );
shoot = new QPushButton( "Shoot", this, "shoot" );
shoot = new QPushButton( "Shoot", this );
shoot->setFont( QFont( "Times", 18, QFont::Bold ) );
connect( shoot, SIGNAL(clicked()), SLOT(fire()) );
restart = new QPushButton( "New Game", this, "newgame" );
restart = new QPushButton( "New Game", this );
restart->setFont( QFont( "Times", 18, QFont::Bold ) );
connect( restart, SIGNAL(clicked()), SLOT(newGame()) );
hits = new QLCDNumber( 2, this, "hits" );
shotsLeft = new QLCDNumber( 2, this, "shotsleft" );
QLabel *hitsL = new QLabel( "HITS", this, "hitsLabel" );
QLabel *shotsLeftL = new QLabel( "SHOTS LEFT", this, "shotsleftLabel" );
hits = new QLCDNumber( 2, this );
shotsLeft = new QLCDNumber( 2, this );
QLabel *hitsL = new QLabel( "HITS", this );
QLabel *shotsLeftL = new QLabel( "SHOTS LEFT", this );
QAccel *accel = new QAccel( this );
accel->connectItem( accel->insertItem( Qt::Key_Space), this, SLOT(fire()) );
......
......@@ -23,7 +23,7 @@ class GameBoard : public QWidget
{
Q_OBJECT
public:
GameBoard( QWidget *parent=0, const char *name=0 );
GameBoard( QWidget *parent=0 );
protected:
void resizeEvent( QResizeEvent * );
protected slots:
......
......@@ -10,14 +10,14 @@
#include <qlcdnumber.h>
#include <qlabel.h>
LCDRange::LCDRange( QWidget *parent, const char *name )
: QWidget( parent, name )
LCDRange::LCDRange(QWidget *parent)
: QWidget( parent )
{
init();
}
LCDRange::LCDRange( const char *s, QWidget *parent, const char *name )
: QWidget( parent, name )
LCDRange::LCDRange(const char *s, QWidget *parent)
: QWidget( parent )
{
init();
setText( s );
......@@ -25,14 +25,14 @@ LCDRange::LCDRange( const char *s, QWidget *parent, const char *name )
void LCDRange::init()
{
lcd = new QLCDNumber( 2, this, "lcd" );
lcd = new QLCDNumber( 2, this );
lcd->move( 0, 0 );
sBar = new QScrollBar( 0, 99, // range
1, 10, // line/page steps
0, // inital value
QScrollBar::Horizontal, // orientation
this, "scrollbar" );
label = new QLabel( this, "label" );
this );
label = new QLabel( this );
label->setAlignment( Qt::AlignCenter );
connect( sBar, SIGNAL(valueChanged(int)), lcd, SLOT(display(int)) );
connect( sBar, SIGNAL(valueChanged(int)), SIGNAL(valueChanged(int)) );
......
......@@ -18,8 +18,8 @@ class LCDRange : public QWidget
{
Q_OBJECT
public:
LCDRange( QWidget *parent=0, const char *name=0 );
LCDRange( const char *s, QWidget *parent=0, const char *name=0 );
LCDRange( QWidget *parent=0 );
LCDRange( const char *s, QWidget *parent=0 );
int value() const;
const char *text() const;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment