Make buttons toggleable by single clicking

This commit is contained in:
xypwn
2020-04-04 14:07:16 +02:00
parent 5340635389
commit 7ade16be8b
20 changed files with 80 additions and 65 deletions

View File

@@ -4,6 +4,7 @@
#include <QTextStream>
#include <QFile>
#include <QDir>
#include "Scene.h"
#include "Part.h"
#include "Wire.h"
@@ -14,8 +15,6 @@
#include "Parts/IntegratedCircuit.h"
#include <QDebug>
FileHandler::FileHandler(Logic* logic)
:m_logic(logic)
{
@@ -74,11 +73,12 @@ bool FileHandler::open(QString filename)
enum Sector
{
None,
Parts,
Wires
};
Sector currentSector;
Sector currentSector = None;
// A .csim file stores all parts with IDs, this map simply keeps track of which ID corresponds to which pointer
QMap<QString, Part*> idPartPointerMap;
@@ -116,6 +116,9 @@ bool FileHandler::open(QString filename)
if(words.length() < 4)
return false;
if(currentSector == None)
return false;
if(currentSector == Parts)
{
PartType::PartType type = (PartType::PartType)words[1].toInt();