<div dir="ltr">A gentle reminder. I am stuck in my problem and your help will he really helpful</div><div class="gmail_extra"><br><div class="gmail_quote">On Sat, Jun 11, 2016 at 4:01 PM, Roshni Lalwani <span dir="ltr"><<a href="mailto:roshiba81@gmail.com" target="_blank">roshiba81@gmail.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px">If we load the fiile a file in in object of QScintilla  using folllowing code</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px">Header myEditor.h</p><pre style="white-space:pre-wrap;margin-top:0px;margin-bottom:1em;padding:5px;border:0px;font-size:13px;width:auto;max-height:600px;overflow:auto;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;color:rgb(57,51,24);word-wrap:normal;background-color:rgb(239,240,241)"><code style="margin:0px;padding:0px;border:0px;font-family:Consolas,Menlo,Monaco,"Lucida Console","Liberation Mono","DejaVu Sans Mono","Bitstream Vera Sans Mono","Courier New",monospace,sans-serif;white-space:inherit"><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">class</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> myScintilla</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">:</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">public</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">QScintilla</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
     </span><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">public</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> readFile</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">();</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">};</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">

</span><span style="margin:0px;padding:0px;border:0px;color:rgb(133,140,147)">#include</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">  </span><span style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"myEditor.h"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">void</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> myEditor</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">::</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">readFile</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">()</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">

   </span><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">if</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">FILE</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">*</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> fp </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> fopen</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">ofilename</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">toLatin1</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(),</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">"r"</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">))</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">QTextStream</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> ts</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">fp</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">,</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">QIODevice</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">::</span><span style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">ReadOnly</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">);</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">int</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> bufferSize </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1024</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">*</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">1024</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">)/</span><span style="margin:0px;padding:0px;border:0px;color:rgb(125,39,39)">2</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">;</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">do</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">{</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
      </span><span style="margin:0px;padding:0px;border:0px;color:rgb(43,145,175)">QString</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> s </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">=</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> ts</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">read</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">bufferSize</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">);</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
      append</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">s</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">);</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
    </span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">}</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)"> </span><span style="margin:0px;padding:0px;border:0px;color:rgb(16,16,148)">while</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">(!</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">ts</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">.</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">atEnd</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">());</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">
</span><span style="margin:0px;padding:0px;border:0px;color:rgb(48,51,54)">}</span></code></pre><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px"><br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px">there will be still performance issue while reading large files. It took around<br></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px">1) 25 seconds to read a file of size 1.5 GB. (Machine cores 4 , 16 GB RAM) 2 10 seconds of file of size 512MB (on same machine)</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px">Is there any way we can load the file in QScintilla object incrementally based on movement of scrollbar?</p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px">There is  <span style="color:rgb(31,73,125);font-family:arial,sans-serif;font-size:small;line-height:normal">ILoader</span><span style="color:rgb(31,73,125);font-family:arial,sans-serif;font-size:small;line-height:normal"> in </span><span style="color:rgb(31,73,125);font-family:arial,sans-serif;font-size:small;line-height:normal">Scintilla::ScintillaEdit that has the capabilty . How Can we have same capability in object of </span>QScintilla  and how Can we use <span style="color:rgb(31,73,125);font-family:arial,sans-serif;font-size:small;line-height:normal">ILoader</span><span style="color:rgb(31,73,125);font-family:arial,sans-serif;font-size:small;line-height:normal">  in object of </span>QScintilla  </p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px"><br></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">The Scintilla documentation can be found at:</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">Here’s the basic mechanism to load the source into Scintilla using ILoader. dEditorPtr is an instance of Scintilla::ScintillaEdit. lFileSize is the size of the source file in bytes.</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)"> </span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">char lBuffer[8192];</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">size_t lCnt;</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">ILoader *lLoader = (ILoader*) dEditorPtr->createLoader(lFileSize);</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">FILE* lFP = fopen(ofilename.toLatin1(), “r”);</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">while (!feof(lFP)) {</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">   lCnt = fread(lBuffer, 1, sizeof(lBuffer), lFP);</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">   if (lLoader->AddData(lBuffer, lCnt) != SC_STATUS_OK) {</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">      // report error</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">   }</span></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">}</span></p><p style="margin:0px 0px 1em;padding:0px;border:0px;font-size:15px;clear:both;color:rgb(36,39,41);font-family:Arial,"Helvetica Neue",Helvetica,sans-serif;line-height:19.5px"></p><p class="MsoNormal" style="font-size:12.8px"><span lang="EN-US" style="color:rgb(31,73,125)">dEditorPtr->setDocPointer(lLoader->ConvertToDocument());</span></p><div><span lang="EN-US" style="color:rgb(31,73,125)"><br></span></div></div>
</blockquote></div><br></div>