Пример #1
0
void MainWindow::buildStartButton()
{
    // Create theme pic
    themePixmapItem = new QGraphicsPixmapItem();
    themePixmapItem->setPixmap(QPixmap(":/image/theme.png"));
    themePixmapItem->setPos(210,50);
    scene->addItem(themePixmapItem);

    // Create start button
    startButton = new QPushButton();
    startButton->setText("PLAY");
    startButton->setFlat(true);
    startButton->setAutoFillBackground(true);
    startButton->setGeometry(QRect(430, 320, 100, 35));
    scene->addWidget(startButton);
    otherSceneObjectList.push_back(startButton);

    // Create quit button
    quitButton = new QPushButton();
    quitButton->setText("QUIT");
    quitButton->setFlat(true);
    quitButton->setAutoFillBackground(true);
    quitButton->setGeometry(QRect(430, 375, 100, 35));
    scene->addWidget(quitButton);
    otherSceneObjectList.push_back(quitButton);

    // connect startButton
    // delete button and call buildGameScene
    connect(startButton, SIGNAL(clicked()), this,SLOT(onStartButton()));

    // connect quitButton
    // cout something
    connect(quitButton, SIGNAL(clicked()), this,SLOT(QUITSLOT()));
}
Пример #2
0
RealTimePlotWindow::RealTimePlotWindow(QWidget *parent) :
    QMainWindow(parent),
    keyCounter(0),
    wait(0),
    MPS(0),
   // dialogWindow(0),
    measurementState(false),
    triger(false),
    ui(new Ui::RealTimePlotWindow)
{
    ui->setupUi(this);

    setWindowTitle("SkateboardAnalyzer v0.5 measuring");
    setWindowIcon(QIcon(":/skate"));

    //--------------SETS VARIABLES--------------//
    dialogWindow = new DialogWindow(this);
    instValWindow = new instValuesWindow(this);
    saveGraphWindow = new SaveGraphWindow(this);

    timer = new QTimer(this);
    timer->start(200);

    instValues = new QVector<double> (10);

    //---------------------------------------------------//
    //-----------------CONNECTS--------------------------//
    //---------------------------------------------------//
    //buttons
  //  connect(ui->closeButton, SIGNAL(clicked()), this, SLOT(close()));
    connect(ui->terminalButton, SIGNAL(clicked()), SLOT(onTerminalButton()));
    connect(ui->instantValuesButton, SIGNAL(clicked()), SLOT(onInstButton()));

    connect(ui->stopButton, SIGNAL(clicked()), SLOT(onStopButton()));
    connect(ui->startButton, SIGNAL(clicked()), SLOT(onStartButton()));

    connect(saveGraphWindow, SIGNAL(putGraphsAsPNG(QString)),this, SLOT(saveAsPNG(QString)));
    connect(saveGraphWindow, SIGNAL(putGraphsAsBMP(QString)),this, SLOT(saveAsBMP(QString)));
    connect(saveGraphWindow, SIGNAL(putGraphsAsPDF(QString)),this, SLOT(saveAsPDF(QString)));
    connect(saveGraphWindow, SIGNAL(putGraphsAsJPG(QString)),this, SLOT(saveAsJPG(QString)));

    connect(ui->saveGraphButton, SIGNAL(clicked()), SLOT(onSaveGraphButton()));

    //dialog window
    connect(dialogWindow, SIGNAL(dataAvaible(QByteArray)), this, SLOT(dataAvaible(QByteArray)));
    //timers
    connect(timer, SIGNAL(timeout()), this, SLOT(onTimer()));


    //--------------ON PLOTS-----------------//
     ui->accPlot->replot();
     ui->gyroPlot->replot();
     startGraph(ui->accPlot, ui->gyroPlot/*, ui->an_gyroPlot*/);
}