save nearly done, i guess

need help with the open, if(end of fileName = ".idf")
This commit is contained in:
Jan Schuffenhauer
2020-01-23 14:43:33 +01:00
parent 083368dcab
commit 189f070016
2 changed files with 20 additions and 7 deletions

View File

@@ -61,10 +61,12 @@ void IntelliPhotoGui::slotOpen(){
IntelliDatamanager::loadProject(paintingArea,fileName);
}
}
paintingArea->open(fileName);
}
//paintingArea->open(fileName);
//TODO remove datamanager funciton and enable painting area function
IntelliDatamanager::loadProject(paintingArea,fileName);
UpdateGui();
}
}
}
}
// Called when the user clicks Save As in the menu

View File

@@ -1,13 +1,24 @@
#include "IntelliDatamanager.h"
#include "Layer/PaintingArea.h"
bool IntelliDatamanager::saveProject(PaintingArea* Canvas, QString filePath){
QFile openFile(filePath);
if(openFile.open(QIODevice::WriteOnly)){
qDebug() << "works.";
openFile.write("Hahaha");
QTextStream out(&openFile);
out << "Format: idf\n" << "Version: 0.7\n" << endl;
out << "Resolution: " << Canvas->getMaxWidth() << "x" << Canvas->getMaxHeight() << endl;
out << "Layers: " << "0" << endl;
if(false){
out << "width: " << endl;
out << "height: " << endl;
out << "xoffset: " << endl;
out << "yoffset: " << endl;
out << "alpha: " << endl;
out << "imageData: " << endl;
}
openFile.close();
return true;
}
@@ -19,7 +30,7 @@ bool IntelliDatamanager::loadProject(PaintingArea* Canvas, QString filePath){
QFile openFile(filePath);
if(openFile.open(QIODevice::ReadOnly)){
qDebug() << openFile.readAll();
qDebug() << openFile.readLine();
openFile.close();
return true;
}