public class GroupEntryDelegate extends QItemDelegate {

 protected void drawDisplay(QPainter painter, QStyleOptionViewItem option,
QRect rect, String text) {
  rect.setHeight(16);
  super.drawDisplay(painter, option, rect, text);
  rect.moveTop(rect.top() + 16);
  option.setFont(new QFont("Helvetica [Cronyx]", 12));
  painter.setBrush(QColor.gray);
  super.drawDisplay(painter, option, rect, "test");
  System.out.println(rect.size().width() + " " + rect.size().height());
  System.out.println("drawing");
 }
}

I extend the QItemDelegate to feature myself's QTreeItem. But why the
painter doesn't work? The "test" should be in blue and brush style, but it
isn't. I want to solve it, how can I correct it?

And if I want to set two Icons and rich text in each Item of a QListView. Is
there any solutions? As I know, the default QStandardItem can only set a
single Icon, and with plain text.

Thanks a lot for your attention.
_______________________________________________
Qt-jambi-interest mailing list
[email protected]
http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest

Reply via email to