Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. General talk
  3. Qt 6
  4. Qt for ios save file error? why?

Qt for ios save file error? why?

Scheduled Pinned Locked Moved Unsolved Qt 6
qt for iossave file error
5 Posts 3 Posters 536 Views
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • K Offline
    K Offline
    kkgg
    wrote on 21 Apr 2024, 02:42 last edited by
    #1

    "device not open " Qt for ios

     qDebug()<< "保存中";
        QJsonDocument doc(obj_);
        QByteArray data = doc.toJson();
        QFile file(path);
        file.open(QIODevice::WriteOnly);//打开文件
        qDebug()<<file.error();
        file.write(data);//开始写入数据进去
        file.close();
        qDebug()<< "保存结束";
    
    1 Reply Last reply
    0
    • S Offline
      S Offline
      SGaist
      Lifetime Qt Champion
      wrote on 21 Apr 2024, 19:51 last edited by
      #2

      Hi,

      Which version of Qt ?
      Which version of iOS ?
      What's the path ?
      Does your application have proper permission to access storage ?

      Interested in AI ? www.idiap.ch
      Please read the Qt Code of Conduct - https://forum.qt.io/topic/113070/qt-code-of-conduct

      K 1 Reply Last reply 23 Apr 2024, 13:12
      0
      • S SGaist
        21 Apr 2024, 19:51

        Hi,

        Which version of Qt ?
        Which version of iOS ?
        What's the path ?
        Does your application have proper permission to access storage ?

        K Offline
        K Offline
        kkgg
        wrote on 23 Apr 2024, 13:12 last edited by
        #3

        @SGaist qt6.6 for ios 17.1 , I use QFileDioag::getOpenfilename achieve file path, but the path does not open

        J 1 Reply Last reply 23 Apr 2024, 13:18
        0
        • K kkgg
          23 Apr 2024, 13:12

          @SGaist qt6.6 for ios 17.1 , I use QFileDioag::getOpenfilename achieve file path, but the path does not open

          J Offline
          J Offline
          jsulm
          Lifetime Qt Champion
          wrote on 23 Apr 2024, 13:18 last edited by
          #4

          @kkgg How about answering last to questions?
          What's the path ?
          Does your application have proper permission to access storage?

          https://forum.qt.io/topic/113070/qt-code-of-conduct

          K 1 Reply Last reply 23 Apr 2024, 13:48
          0
          • J jsulm
            23 Apr 2024, 13:18

            @kkgg How about answering last to questions?
            What's the path ?
            Does your application have proper permission to access storage?

            K Offline
            K Offline
            kkgg
            wrote on 23 Apr 2024, 13:48 last edited by kkgg
            #5

            @jsulm Hello, I found that I need to use oc and qt for mixed compilation, but I can't add the Foundation framework in cmake. How should I add it?

            I checked the information and he said that iOS can only read and write at the location "QStandardPaths::standardLocations(QStandardPaths::DocumentsLocation).last()"

            1 Reply Last reply
            0

            5/5

            23 Apr 2024, 13:48

            • Login

            • Login or register to search.
            5 out of 5
            • First post
              5/5
              Last post
            0
            • Categories
            • Recent
            • Tags
            • Popular
            • Users
            • Groups
            • Search
            • Get Qt Extensions
            • Unsolved