20 #include "simplecontrol.h"
24 #include <QPushButton>
25 #include "renderworld.h"
32 cui->setParent(
this );
35 QBoxLayout* toplay =
new QVBoxLayout(
this );
40 infoObject =
new QLabel(
"Info about selected Object",
this );
41 infoObject->setFixedHeight( 50 );
42 connect( rw, SIGNAL( drawFinished(
bool) ),
44 toplay->addWidget( infoObject );
46 toplay->addWidget( cui );
48 QBoxLayout* inlay =
new QHBoxLayout( );
49 toplay->addLayout( inlay );
51 QPushButton* bt =
new QPushButton(
"Play",
this );
52 connect( bt, SIGNAL( clicked() ),
53 world, SLOT( play() ), Qt::DirectConnection );
54 inlay->addWidget( bt );
56 bt =
new QPushButton(
"Pause",
this );
57 connect( bt, SIGNAL( clicked() ),
58 world, SLOT( pause() ), Qt::DirectConnection );
59 inlay->addWidget( bt );
61 bt =
new QPushButton(
"Stop",
this );
62 connect( bt, SIGNAL( clicked() ),
63 world, SLOT( stop() ), Qt::DirectConnection );
64 inlay->addWidget( bt );
66 bt =
new QPushButton(
"Step",
this );
67 connect( bt, SIGNAL( clicked() ),
68 world, SLOT( advance() ), Qt::DirectConnection );
69 bt->setAutoRepeat(
true );
70 inlay->addWidget( bt );
81 QString name = rw->
graphics()[i]->object()->name();
83 infoObject->setText( QString(
"Name: %1 \t Pos: %2, %3, %4").arg(name).arg(pos[0]).arg(pos[1]).arg(pos[2]) );
void onQuit()
Destroy all data before exiting.
void updateInfoObject()
update information about selected Object
int selectedName() const
Returns the name (an integer value) of the entity that was last selected by select().
const QVector< RenderWObject * > graphics()
return all RenderWObject presents
SimpleControl(QWidget *centralUI, World *world, QWidget *parent=0)
Construct an SimpleControl.