[Qt-interest] Widget to use on Model/View
Arnold Krille
arnold at arnoldarts.de
Thu Aug 20 11:20:06 CEST 2009
Hi,
On Thursday 20 August 2009 07:03:26 João Mesquita wrote:
> I am developing an application that has a console like interface and I
> thought of using QListView to represent this console. Each line on the
> console would be an item that is then appended to the QListView model. The
> advantage of using such a widget is that the console log messages can be
> sorted easily. I could easily make checkboxes to hide certain messages that
> do not belong to certain log levels or apply Regex or even filters using a
> custom QSortProxyModel. If anyone is familiar with Wireshark, that is
> exactly the same behavior I am trying to achieve.
> Problem here is performance. When sorting, not a problem, but when
> inserting a large number of lines per second, I make the UI unresponsive
> and even unusable. Should I change the widget, the model or not possible at
> all?
For these requirements you should write your own model (its not that hard!).
When appending new lines, you would then cache the indizes of the new rows
until a certain amount of time has passed (like 0.1 seconds). Otherwise the
gui (and all asorted proxymodels used for sorting and filtering) would update
on every appended/changed row, which makes the gui very slow when lots of
lines are appended.
Arnold
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 197 bytes
Desc: This is a digitally signed message part.
Url : http://lists.qt-project.org/pipermail/qt-interest-old/attachments/20090820/b902d461/attachment.bin
More information about the Qt-interest-old
mailing list