File size limitation in qt
I have a text file size of 3.33MB which i need to render in the text browser. But only 1MB of text file data is read and rendered.
It would be helpfull i could know the text file size limit to render in qt.
I am using the following code.
Code:
#include "file.h"
#include "ui_file.h"
#include<QFile>
#include<QTextStream>
#include<QMessageBox>
ui(new Ui::file)
{
ui->setupUi(this);
}
file::~file()
{
delete ui;
}
void file::on_pushButton_clicked()
{
QFile file ("D:\\Users\\aisu1452\\Thales_db_frgbsa9.pc");
{
QMessageBox :: information(0,
"info",
file.
errorString());
}
else
{
ui->textBrowser->setText(in.readAll());
}
}
Re: File size limitation in qt
There is no "text file size limit" in Qt.
Re: File size limitation in qt
Have you tried QTextBrowser::setSource() to let the widget load the document as it sees fit, instead of loading the whole contents in RAM?
Re: File size limitation in qt
If your text file contains a null character (0x0), the QString returned by readAll() will be effectively truncated at that point. Likewise, I think QTextBrowser will stop loading when it hits a null.