[QScintilla] Need to get optimal size of buffer when appen o QScintilla object

Roshni Lalwani roshiba81 at gmail.com
Wed Jun 8 05:42:58 BST 2016


I want to know what is optimal size of bufferSize  in following code

class myView : public QScintilla {


void myView::readFile(QString ofilename) {

if (FILE* fp = fopen(ofilename.toLatin1().constData() "r")) {
QTextStream ts(fp, QIODevice::ReadOnly);
        int bufferSize = 8192;
        do {
          QString s =  ts.read(bufferSize);
  append(s);
        } while(!ts.atEnd());
setModified(FALSE);
UFile::close(fp);
d_filename = ofilename;
emit fileNameChanged(ofilename);
      }

}
}
so that we do not see any  run time issues

On Wed, Jun 8, 2016 at 9:31 AM, Roshni Lalwani <roshiba81 at gmail.com> wrote:

> Hi
>    I have an object Q Scintilla . I want to know what is optimal size
> of bufferSize  in following code
>
> if (FILE* fp = fopen(ofilename.toLatin1().constData() "r")) {
> QTextStream ts(fp, QIODevice::ReadOnly);
>         int bufferSize = 8192;
>         do {
>           QString s =  ts.read(bufferSize);
>  append(s);
>         } while(!ts.atEnd());
> setModified(FALSE);
> UFile::close(fp);
> d_filename = ofilename;
> emit fileNameChanged(ofilename);
>       }
>
> so that we do not see any performance issues
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.riverbankcomputing.com/pipermail/qscintilla/attachments/20160608/7fff05ba/attachment.html>


More information about the QScintilla mailing list