diff --git a/main.cpp b/main.cpp index aab39bb8..94e1c1b8 100755 --- a/main.cpp +++ b/main.cpp @@ -4,6 +4,7 @@ int main(int argc, char *argv[]) { QApplication a(argc, argv); + a.setStyle("fusion"); MainWindow w; w.show(); diff --git a/mainwindow.h b/mainwindow.h index f9a911e1..34c94d63 100755 --- a/mainwindow.h +++ b/mainwindow.h @@ -94,7 +94,7 @@ private: enum MapListUserRoles { GroupRole = Qt::UserRole + 1, // Used to hold the map group number. - TypeRole = Qt::UserRole + 10, // Used to differentiate between the different layers of the map list tree view. + TypeRole = Qt::UserRole + 2, // Used to differentiate between the different layers of the map list tree view. }; #endif // MAINWINDOW_H diff --git a/map.h b/map.h index ec2343e3..c49d833e 100755 --- a/map.h +++ b/map.h @@ -193,13 +193,4 @@ signals: public slots: }; -class MapGroup : public QObject -{ - Q_OBJECT -public: - QString name; - int group_num; - QList maps; -}; - #endif // MAP_H diff --git a/project.cpp b/project.cpp index f68b0f30..cbe6f65d 100755 --- a/project.cpp +++ b/project.cpp @@ -232,6 +232,7 @@ void Project::readMapAttributesTable() { } } + // Deep copy mapAttributesTableMaster = mapAttributesTable; mapAttributesTableMaster.detach(); } @@ -357,7 +358,6 @@ void Project::readAllMapAttributes() { if (!mapAttributes.contains(altMapName)) { mapAttributes.insert(altMapName, QMap()); } - mapAttributes[altMapName]["attributes_label"] = attributeMapLabel; mapAttributes[altMapName].insert("attributes_label", attributeMapLabel); mapAttributes[altMapName].insert("width", attrWidth); mapAttributes[altMapName].insert("height", attrHeight); @@ -372,6 +372,7 @@ void Project::readAllMapAttributes() { } } + // Deep copy mapAttributesMaster = mapAttributes; mapAttributesMaster.detach(); } @@ -687,6 +688,7 @@ void Project::saveMap(Map *map) { void Project::updateMapAttributes(Map* map) { mapAttributesTableMaster.insert(map->index.toInt(nullptr, 0), map->name); + // Deep copy QMap attrs = mapAttributes.value(map->name); attrs.detach(); mapAttributesMaster.insert(map->name, attrs); diff --git a/project.h b/project.h index 4edab894..37ae487f 100755 --- a/project.h +++ b/project.h @@ -54,13 +54,6 @@ public: void getTilesets(Map*); void loadTilesetAssets(Tileset*); - void setNewMapHeader(Map* map, int mapIndex); - void setNewMapAttributes(Map* map); - void setNewMapBlockdata(Map* map); - void setNewMapBorder(Map *map); - void setNewMapEvents(Map *map); - void setNewMapConnections(Map *map); - QString getBlockdataPath(Map*); void saveBlockdata(Map*); void saveMapBorder(Map*); @@ -102,6 +95,13 @@ private: void saveMapHeader(Map*); void saveMapAttributesTable(); void updateMapAttributes(Map* map); + + void setNewMapHeader(Map* map, int mapIndex); + void setNewMapAttributes(Map* map); + void setNewMapBlockdata(Map* map); + void setNewMapBorder(Map *map); + void setNewMapEvents(Map *map); + void setNewMapConnections(Map *map); }; #endif // PROJECT_H