thank you for your supply, but your suggest doesnt work to. I have changed my code like this:
Qt Code:
  1. QString savefile = QFileDialog::getSaveFileName(this,"Save File", QDir::currentPath(),fillter0) + ".desktop";
  2. QFile myfile(savefile);
  3.  
  4. if(!myfile.setPermissions(QFile::ReadOwner|QFile::WriteOwner|QFile::ExeOwner|QFile::ReadGroup|QFile::ExeGroup|QFile::ReadOther|QFile::ExeOther))
  5. {
  6. qDebug("Something wrong!");
  7. }
  8.  
  9.  
  10. if(!myfile.open(QIODevice::WriteOnly | QIODevice::Text))
  11. return;
  12. QTextStream out(&myfile);
  13. out << preview;
  14. myfile.close();
To copy to clipboard, switch view to plain text mode 
But it doesnt work. So i guess it is not beacause the ORed statement. Could you please show me how?
I read the Qt help, but couldnt find any thing could help.
Thank you very much.