mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-14 04:10:31 +02:00
save nearly done, i guess
need help with the open, if(end of fileName = ".idf")
This commit is contained in:
@@ -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;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user