Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. 3rd Party Software
  4. Google-diff-patch-match ported to 5.3 (based on 4.8), having issues with a "compatible with 4.3 to 4.7" compatible function

Google-diff-patch-match ported to 5.3 (based on 4.8), having issues with a "compatible with 4.3 to 4.7" compatible function

Scheduled Pinned Locked Moved 3rd Party Software
4 Posts 2 Posters 1.7k 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.
  • T Offline
    T Offline
    thistleknot
    wrote on last edited by
    #1

    https://github.com/thistleknot/DiffMatchPatch/commit/acd4314becc078414f3722780e52df2244c21c0f

    line 208

    compiler error I get is

    C:\Dev\DiffMatchPatch\diffmatchpatch.cpp:208: error: no matching function for call to 'diff_match_patch::patch_apply(QList<Patch>, QString&)'
    QPair<QString, QVector<bool> > out = dmp.patch_apply(dmp.patch_fromText(strPatch), str1);
    ^
    As you can see around the area i've added, i've tried assigning the var using a different method by breaking it down in pieces, but so far my tests have not been fruitful. Sometimes I can get it to compile, but then the .exe deletes itself if I try to push to my plainTextEdit.

    I think it has something to do with the way I'm loading the text file as a readAll() and then trying to feed that into the google-diff-patch-match as a QList of type Patch

    btw, I did use a properly formatted exported patch file as my input.

    1 Reply Last reply
    0
    • SGaistS Offline
      SGaistS Offline
      SGaist
      Lifetime Qt Champion
      wrote on last edited by
      #2

      Hi,

      What is the original function signature ?

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

      1 Reply Last reply
      0
      • T Offline
        T Offline
        thistleknot
        wrote on last edited by
        #3

        public:
        QPair<QString,QVector<bool> > patch_apply(QList<Patch> &patches, const QString &text);

        1 Reply Last reply
        0
        • T Offline
          T Offline
          thistleknot
          wrote on last edited by
          #4

          this is the original function example provided in the header file.

          diff_match_patch dmp;
          QString str1 = QString("First string in diff");
          QString str2 = QString("Second string in diff");

          QString strPatch = dmp.patch_toText(dmp.patch_make(str1, str2));
          QPair<QString, QVector<bool> > out
          = dmp.patch_apply(dmp.patch_fromText(strPatch), str1);
          QString strResult = out.first;

          Header:
          https://github.com/thistleknot/DiffMatchPatch/blob/acd4314becc078414f3722780e52df2244c21c0f/diff_match_patch.h

          throws same error, even when using default strings provided

          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