PDA

View Full Version : QStandardItem, QStyledItemDelegate, and QWebView



enlightened_j
11th August 2010, 02:56
Hi all,

Reading the post <HTML and QStandardItem ? (http://www.qtcentre.org/threads/22863-HTML-and-QStandardItem)>, a question came across my mind:

Is it possible to use QGraphicsWebView as items inside QListView? So instead of static HTML text being displayed, I have a specified number of mini-browser window in a QListView.

My first thought was to simply replace QTextDocument with QGraphicsWebView in the paint function of the delegate, but then I am not sure how to actually draw the QGraphicsWebView. Please let me know which area I should look into if I would like to implement this. Thanks.

axeljaeger
16th August 2010, 08:44
This should be possible. See for the first shot "setItemWidget". But as with all question regarding pimping itemviews and the always asked question whether it is possible to embed widgets within a listview for example, keep in mind that there is a reason for the delegate architecture and the reason is: Performance of large lists. How many items do you want to have in your list? If it is 20, then 20 QGraphicsWebViews should not be a problem. If you have 100, think about other solutions. If you have 1000 or more, you might get angry customers.