#include "Dialog.h"
#include "ui_Dialog.h"
ui(new Ui::Dialog),
x( 20 ),
y( 20 )
{
ui->setupUi(this);
connect( &m_timer, SIGNAL( timeout() ),
this, SLOT( slotUpdate() ) );
m_timer.start( 50 );
//this->setStyleSheet( "background-color: rgb(177, 177, 177);" "color: black;" );
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::slotUpdate()
{
horse1->setGeometry( 20+x, 20+y, 50, 50 );
//horse1->setStyleSheet("background-color: rgb(177, 177, 177);" "color: black;");
//m_horses.push_back( horse1 );
horse1->show();
++x;
++y;
//this->setStyleSheet( "background-color: rgb(177, 177, 177);" "color: black;" );
update();
}
#include "Dialog.h"
#include "ui_Dialog.h"
Dialog::Dialog(QWidget *parent) :
QDialog(parent),
ui(new Ui::Dialog),
x( 20 ),
y( 20 )
{
ui->setupUi(this);
connect( &m_timer, SIGNAL( timeout() ),
this, SLOT( slotUpdate() ) );
m_timer.start( 50 );
//this->setStyleSheet( "background-color: rgb(177, 177, 177);" "color: black;" );
}
Dialog::~Dialog()
{
delete ui;
}
void Dialog::slotUpdate()
{
QPushButton *horse1 = new QPushButton( this );
horse1->setGeometry( 20+x, 20+y, 50, 50 );
//horse1->setStyleSheet("background-color: rgb(177, 177, 177);" "color: black;");
//m_horses.push_back( horse1 );
horse1->show();
++x;
++y;
//this->setStyleSheet( "background-color: rgb(177, 177, 177);" "color: black;" );
update();
}
To copy to clipboard, switch view to plain text mode
Bookmarks