main_gui.cpp
Go to the documentation of this file.
00001 #include <QApplication>
00002 #include <QFont>
00003 #include <QPushButton>
00004 #include <QVBoxLayout>
00005 #include <QWidget>
00006 #include <segbot_controller/qnode.hpp>
00007 
00008 class MyWidget : public QWidget
00009 {
00010 public:
00011     MyWidget(QWidget *parent = 0,int argc = 0, char *argv[]=0);
00012 private:
00013     segbot_controller::QNode rosnode;
00014 };
00015   MyWidget::MyWidget(QWidget *parent, int argc, char *argv[])
00016   : QWidget(parent),rosnode(argc,argv)
00017   {
00018     QPushButton *quit = new QPushButton(tr("Quit"));
00019     quit->setFont(QFont("Times", 18, QFont::Bold));
00020 
00021     QPushButton *stop = new QPushButton(tr("Stop"));
00022     stop->setFont(QFont("Times", 18, QFont::Bold));
00023 
00024     QPushButton *cont = new QPushButton(tr("Continue"));
00025     cont->setFont(QFont("Times", 18, QFont::Bold));
00026 
00027     connect(quit, SIGNAL(clicked()), qApp, SLOT(quit()));
00028     QObject::connect(stop, SIGNAL(clicked()), &rosnode, SLOT(stop()));
00029     QObject::connect(cont, SIGNAL(clicked()), &rosnode, SLOT(cont()));
00030                                                                                 
00031     QVBoxLayout *layout = new QVBoxLayout;
00032     layout->addWidget(stop);
00033     layout->addWidget(cont);
00034     layout->addWidget(quit);
00035     setLayout(layout);
00036   }
00037 
00038 int main(int argc, char *argv[])
00039 {
00040   QApplication app(argc, argv);
00041   MyWidget widget(NULL, argc, argv);
00042   widget.show();
00043   return app.exec();
00044 }
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends


segbot_controller
Author(s): lab
autogenerated on Sun Mar 24 2013 17:17:27