From b736a2dbb246a7832d79320897c43457a3467320 Mon Sep 17 00:00:00 2001 From: Yasser Date: Thu, 6 Feb 2020 16:42:12 +0100 Subject: [PATCH] adding the simulation tools widget --- Gui/simulationtoolswidget.cpp | 15 ++ Gui/simulationtoolswidget.h | 22 ++ Gui/simulationtoolswidget.ui | 377 ++++++++++++++++++++++++++++++++++ OpensimQtGUI.pro | 3 + mainwindow.cpp | 6 + mainwindow.h | 3 + mainwindow.ui | 11 + 7 files changed, 437 insertions(+) create mode 100644 Gui/simulationtoolswidget.cpp create mode 100644 Gui/simulationtoolswidget.h create mode 100644 Gui/simulationtoolswidget.ui diff --git a/Gui/simulationtoolswidget.cpp b/Gui/simulationtoolswidget.cpp new file mode 100644 index 0000000..61a4d67 --- /dev/null +++ b/Gui/simulationtoolswidget.cpp @@ -0,0 +1,15 @@ +#include "simulationtoolswidget.h" +#include "ui_simulationtoolswidget.h" + +SimulationToolsWidget::SimulationToolsWidget(QWidget *parent) : + QWidget(parent), + ui(new Ui::SimulationToolsWidget) +{ + ui->setupUi(this); + +} + +SimulationToolsWidget::~SimulationToolsWidget() +{ + delete ui; +} diff --git a/Gui/simulationtoolswidget.h b/Gui/simulationtoolswidget.h new file mode 100644 index 0000000..b939d23 --- /dev/null +++ b/Gui/simulationtoolswidget.h @@ -0,0 +1,22 @@ +#ifndef SIMULATIONTOOLSWIDGET_H +#define SIMULATIONTOOLSWIDGET_H + +#include + +namespace Ui { +class SimulationToolsWidget; +} + +class SimulationToolsWidget : public QWidget +{ + Q_OBJECT + +public: + explicit SimulationToolsWidget(QWidget *parent = nullptr); + ~SimulationToolsWidget(); + +private: + Ui::SimulationToolsWidget *ui; +}; + +#endif // SIMULATIONTOOLSWIDGET_H diff --git a/Gui/simulationtoolswidget.ui b/Gui/simulationtoolswidget.ui new file mode 100644 index 0000000..b97b883 --- /dev/null +++ b/Gui/simulationtoolswidget.ui @@ -0,0 +1,377 @@ + + + SimulationToolsWidget + + + + 0 + 0 + 1058 + 56 + + + + + 0 + 0 + + + + Form + + + + 1 + + + 1 + + + + + Undo + + + + :/Images/DefaultIcon/arrow-1-backward.png:/Images/DefaultIcon/arrow-1-backward.png + + + + 24 + 24 + + + + Qt::ToolButtonTextUnderIcon + + + Qt::NoArrow + + + + + + + Redo + + + + :/Images/DefaultIcon/arrow-1-forward.png:/Images/DefaultIcon/arrow-1-forward.png + + + + 24 + 24 + + + + Qt::ToolButtonTextUnderIcon + + + Qt::NoArrow + + + + + + + + 0 + 0 + + + + + + + + 1 + + + 1 + + + + + Simulate : + + + + + + + Run + + + + :/Images/DefaultIcon/user-refresh.png:/Images/DefaultIcon/user-refresh.png + + + + 24 + 24 + + + + Qt::ToolButtonTextUnderIcon + + + + + + + Stop + + + + :/Images/DefaultIcon/power-standby.png:/Images/DefaultIcon/power-standby.png + + + + 24 + 24 + + + + Qt::ToolButtonTextUnderIcon + + + + + + + + + + + + + false + + + + 1 + + + 1 + + + 1 + + + + + + 0 + 0 + + + + ... + + + + :/Images/DefaultIcon/MD-fast-forward-alt.png:/Images/DefaultIcon/MD-fast-forward-alt.png + + + + + + + + 0 + 0 + + + + ... + + + + :/Images/DefaultIcon/arrow-3-left.png:/Images/DefaultIcon/arrow-3-left.png + + + + + + + + 0 + 0 + + + + ... + + + + :/Images/DefaultIcon/arrow-3-right.png:/Images/DefaultIcon/arrow-3-right.png + + + + + + + false + + + + 0 + 0 + + + + + + + + Qt::Horizontal + + + + + + + + 0 + 0 + + + + ... + + + + :/Images/DefaultIcon/MD-fast-backward-alt.png:/Images/DefaultIcon/MD-fast-backward-alt.png + + + + + + + + 0 + 0 + + + + Time : + + + + + + + + 0 + 0 + + + + ... + + + + :/Images/DefaultIcon/MD-pause.png:/Images/DefaultIcon/MD-pause.png + + + + + + + false + + + + 0 + 0 + + + + + + + + + 0 + 0 + + + + ... + + + + :/Images/DefaultIcon/MD-next.png:/Images/DefaultIcon/MD-next.png + + + + + + + + 0 + 0 + + + + Motion + + + + + + + + 0 + 0 + + + + Speed : + + + + + + + + 0 + 0 + + + + ... + + + + :/Images/DefaultIcon/MD-previous.png:/Images/DefaultIcon/MD-previous.png + + + + + + + false + + + + 0 + 0 + + + + No Motion + + + + + + + + + + + + + diff --git a/OpensimQtGUI.pro b/OpensimQtGUI.pro index e270140..3283f60 100644 --- a/OpensimQtGUI.pro +++ b/OpensimQtGUI.pro @@ -16,13 +16,16 @@ DEFINES += QT_DEPRECATED_WARNINGS #DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0 SOURCES += \ + Gui/simulationtoolswidget.cpp \ main.cpp \ mainwindow.cpp HEADERS += \ + Gui/simulationtoolswidget.h \ mainwindow.h FORMS += \ + Gui/simulationtoolswidget.ui \ mainwindow.ui TRANSLATIONS += \ diff --git a/mainwindow.cpp b/mainwindow.cpp index 41a26bd..e40ea9f 100644 --- a/mainwindow.cpp +++ b/mainwindow.cpp @@ -1,11 +1,17 @@ #include "mainwindow.h" #include "ui_mainwindow.h" +#include + MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent) , ui(new Ui::MainWindow) { ui->setupUi(this); + //adding the Simulation Tools Widget to the toolBar + + simulationWidget = new SimulationToolsWidget(this); + ui->simulationToolBar->addWidget(simulationWidget); } MainWindow::~MainWindow() diff --git a/mainwindow.h b/mainwindow.h index 4643e32..3a89885 100644 --- a/mainwindow.h +++ b/mainwindow.h @@ -3,6 +3,8 @@ #include +#include + QT_BEGIN_NAMESPACE namespace Ui { class MainWindow; } QT_END_NAMESPACE @@ -17,5 +19,6 @@ class MainWindow : public QMainWindow private: Ui::MainWindow *ui; + SimulationToolsWidget *simulationWidget; }; #endif // MAINWINDOW_H diff --git a/mainwindow.ui b/mainwindow.ui index 2923eff..65011f6 100644 --- a/mainwindow.ui +++ b/mainwindow.ui @@ -322,6 +322,17 @@ + + + toolBar + + + TopToolBarArea + + + false + +