[Solved]Save image with dynamic name
I’m a beginning “developer” and i’m newbie to qt and c++.
So, my problem: I’ve a custom c++ class that save an image to a file(in symbian device), it works perfectly. Now i want to set a dynamic filename for it,with current date and time. I’ve tried different solutions but i failed. Here’s code. Can any one help me to get an easy solution?
- {
- }
- void SaveImage::save(QDeclarativeItem *item)
- {
- QStyleOptionGraphicsItem option;
- item->paint(&painter, &option, NULL);
- //i've tried this but doesn't work: pix.save("E:/Images/"image"+dateTimeString+".jpg");
- }
6 replies
Thanks, you were right symbian doesn’t support colons in file names. So here the working code.
- {
- }
- void SaveImage::save(QDeclarativeItem *item)
- {
- QStyleOptionGraphicsItem option;
- item->paint(&painter, &option, NULL);
- pix.save("E:/Images/"+dateTimeString+".jpg");
- qDebug() << "Captured on Symbian,here: E:/Images/";
- }
You must log in to post a reply. Not a member yet? Register here!



