-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmainwindow.cpp
More file actions
48 lines (41 loc) · 1.44 KB
/
Copy pathmainwindow.cpp
File metadata and controls
48 lines (41 loc) · 1.44 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#include "mainwindow.h"
#include "ui_mainwindow.h"
#include "eventlist.h"
/*
* Constructors and destructor
*/
MainWindow::MainWindow(QWidget *parent) : QMainWindow(parent), ui(new Ui::MainWindow)
{
ui->setupUi(this);
//CODE BELOW IS IN ITS CURRENT STATE FOR TESTING PURPOSES
EventList* eventList = new EventList();
eventList->Push(new Event());
eventList->Get(0)->inputs.Push(new Molecule, true); eventList->Get(0)->inputs.Get(0)->setName("InputMolecule1"); //eventList->Get(0)->inputs.Get(0)->
eventList->Get(0)->inputs.Push(new Molecule,true); eventList->Get(0)->inputs.Get(1)->setName("InputMolecule2");
eventList->Get(0)->inputs.Push(new Molecule, true); eventList->Get(0)->inputs.Get(2)->setName("InputMolecule3");
eventList->Get(0)->outputs.Push(new Molecule, false); eventList->Get(0)->outputs.Get(0)->setName("OutputMolecule");
visualizer = new Visualizer(this, eventList->Get(0));
ui->dragFrame->addWidget(visualizer);
}
MainWindow::~MainWindow()
{
delete ui;
}
/*
* Slot and signals
*/
void MainWindow::on_addStateButton_clicked()
{
//AddState();
//visualizer->newMolecule();
}
/*
* Functions
*/
//adds a new state to the list
void MainWindow::AddState()
{
QListWidgetItem *NewListItem = new QListWidgetItem("New State");
NewListItem->setFlags(NewListItem->flags() | Qt::ItemIsEditable);
ui->mainList->addItem(NewListItem);
}