Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. vector<uint8_t> File saving
Forum Updated to NodeBB v4.3 + New Features

vector<uint8_t> File saving

Scheduled Pinned Locked Moved Solved General and Desktop
6 Posts 4 Posters 643 Views 1 Watching
  • 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.
  • Z Offline
    Z Offline
    Zeyad Khaled
    wrote on last edited by
    #1

    i have a vector<uint8_t> and i want to save it to a file , here is my code in my button ,

    QString text =ui->plainTextEdit->toPlainText();
        string x=text.toStdString();
        string Result=Huffman_encoding(x);
        vector<uint8_t> Result2=toBinary(Result);
    

    thx in advance

    JonBJ 1 Reply Last reply
    0
    • Z Zeyad Khaled

      i have a vector<uint8_t> and i want to save it to a file , here is my code in my button ,

      QString text =ui->plainTextEdit->toPlainText();
          string x=text.toStdString();
          string Result=Huffman_encoding(x);
          vector<uint8_t> Result2=toBinary(Result);
      

      thx in advance

      JonBJ Offline
      JonBJ Offline
      JonB
      wrote on last edited by JonB
      #2

      @Zeyad-Khaled
      Use QFile to save any data to a file, type does not matter.

      Depending on your intentions, maybe (or maybe not) wrap it in a QDataStream.

      You use just about nothing which is Qt code, so you could equally go use the iostream/fstream library methods instead.

      1 Reply Last reply
      0
      • Christian EhrlicherC Online
        Christian EhrlicherC Online
        Christian Ehrlicher
        Lifetime Qt Champion
        wrote on last edited by
        #3

        And why do you open a new thread even it's the same like here https://forum.qt.io/topic/132871 (and the deleted one from you before this)?

        Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
        Visit the Qt Academy at https://academy.qt.io/catalog

        Z 1 Reply Last reply
        0
        • Christian EhrlicherC Christian Ehrlicher

          And why do you open a new thread even it's the same like here https://forum.qt.io/topic/132871 (and the deleted one from you before this)?

          Z Offline
          Z Offline
          Zeyad Khaled
          wrote on last edited by
          #4

          @Christian-Ehrlicher Because i Used Another Code and iam Completly new to Qt And there is'nt that much tutorial about this framwork

          artwawA Christian EhrlicherC 2 Replies Last reply
          0
          • Z Zeyad Khaled

            @Christian-Ehrlicher Because i Used Another Code and iam Completly new to Qt And there is'nt that much tutorial about this framwork

            artwawA Offline
            artwawA Offline
            artwaw
            wrote on last edited by
            #5

            @Zeyad-Khaled said in vector<uint8_t> File saving:

            there is'nt that much tutorial about this framwork

            WHAT
            Qt is one of the most documented frameworks I worked with. And I had to deliver in Object Pascal, Delphi, Python and Qt C++, among abominations like typescript/js/node.

            For more information please re-read.

            Kind Regards,
            Artur

            1 Reply Last reply
            1
            • Z Zeyad Khaled

              @Christian-Ehrlicher Because i Used Another Code and iam Completly new to Qt And there is'nt that much tutorial about this framwork

              Christian EhrlicherC Online
              Christian EhrlicherC Online
              Christian Ehrlicher
              Lifetime Qt Champion
              wrote on last edited by
              #6

              @Zeyad-Khaled You already found QFile::write() - so why can't you pass the pointer and length to this function? Don't see what this has to do with Qt...

              Qt Online Installer direct download: https://download.qt.io/official_releases/online_installers/
              Visit the Qt Academy at https://academy.qt.io/catalog

              1 Reply Last reply
              0

              • Login

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