Sailfish.Share API Documentation

probably simplest way from c++:

  QTemporaryFile *tmpFile = new QTemporaryFile(
    QDir::tempPath() + QDir::separator() + "event-XXXXXX.ics", 
    this); // destructed and file deleted with this object

  if (tmpFile->open()) {
    QTextStream stream( tmpFile );
    stream << "BEGIN:VCALENDAR" << '\n'
           << "..." << '\n'
           << "END:VCALENDAR" << '\n';
    tmpFile->close();

    qDebug() << "Opening" << tmpFile->fileName();
    if (!QDesktopServices::openUrl("file://" + tmpFile->fileName())) {
      qWarning() << "QDesktopServices::openUrl fails!";
    }
  }
1 Like