mirror of
https://github.com/creyD/intelliphoto.git
synced 2026-04-17 13:50:35 +02:00
save nearly done, i guess
need help with the open, if(end of fileName = ".idf")
This commit is contained in:
@@ -61,10 +61,12 @@ void IntelliPhotoGui::slotOpen(){
|
|||||||
IntelliDatamanager::loadProject(paintingArea,fileName);
|
IntelliDatamanager::loadProject(paintingArea,fileName);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
paintingArea->open(fileName);
|
}
|
||||||
|
//paintingArea->open(fileName);
|
||||||
|
//TODO remove datamanager funciton and enable painting area function
|
||||||
|
IntelliDatamanager::loadProject(paintingArea,fileName);
|
||||||
UpdateGui();
|
UpdateGui();
|
||||||
}
|
}
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// Called when the user clicks Save As in the menu
|
// Called when the user clicks Save As in the menu
|
||||||
|
|||||||
@@ -1,13 +1,24 @@
|
|||||||
#include "IntelliDatamanager.h"
|
#include "IntelliDatamanager.h"
|
||||||
#include "Layer/PaintingArea.h"
|
#include "Layer/PaintingArea.h"
|
||||||
|
|
||||||
|
|
||||||
bool IntelliDatamanager::saveProject(PaintingArea* Canvas, QString filePath){
|
bool IntelliDatamanager::saveProject(PaintingArea* Canvas, QString filePath){
|
||||||
QFile openFile(filePath);
|
QFile openFile(filePath);
|
||||||
|
|
||||||
if(openFile.open(QIODevice::WriteOnly)){
|
if(openFile.open(QIODevice::WriteOnly)){
|
||||||
qDebug() << "works.";
|
QTextStream out(&openFile);
|
||||||
openFile.write("Hahaha");
|
|
||||||
|
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();
|
openFile.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -19,7 +30,7 @@ bool IntelliDatamanager::loadProject(PaintingArea* Canvas, QString filePath){
|
|||||||
QFile openFile(filePath);
|
QFile openFile(filePath);
|
||||||
|
|
||||||
if(openFile.open(QIODevice::ReadOnly)){
|
if(openFile.open(QIODevice::ReadOnly)){
|
||||||
qDebug() << openFile.readAll();
|
qDebug() << openFile.readLine();
|
||||||
openFile.close();
|
openFile.close();
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user