QTextEdit takes more and more time to draw text

I use QTextEdit, and I update the text (in particular setHTML) at a speed of 1 Hz.

Initially, the method setHTMLworks quickly (only a few ms); but after 12 hours of work setHTML, 256 ms is required to return , the data is a simple table with 5 columns and 10 rows.

This increase lasts longer than the program runs.

Does anyone understand what is happening? And, more importantly, how can I make him stop?

Basically what I do:

// get the start time
boost::posix_time::ptime start_time = boost::posix_time::microsec_clock::universal_time();

display->setHtml(text);

boost::posix_time::ptime end_time = boost::posix_time::microsec_clock::universal_time();

boost::posix_time::time_duration time_diff = end_time - start_time;

m_renderTimeDebug = double(time_diff.fractional_seconds() / 1000 );
std::cout << "DRAW TIME; took " << m_renderTimeDebug << " ms " << std::endl;

Example here link

+4
source share
2 answers

I found that this problem was resolved in Qt 5.9.

, Qt . Qt 5.8 QTBUG: 61137

+1

. - ? , , , valgrind, UNIX . ?

0

Source: https://habr.com/ru/post/1677924/


All Articles