QDirModel *dm = new QDirModel(this);QTreeView *tw = new QTreeView(this);tw->setModel(dm);
QPalette::ColorGroup cg = option.state & QStyle::State_Enabled ? QPalette::Normal : QPalette::Disabled;if(option.state & QStyle::State_Selected){ painter->fillRect(option.rect, option.palette.color(cg, QPalette::Highlight));}
int x = option.rect.x();int y = option.rect.y();
painter->drawPixmap(x+offset, y+offset, QPixmap());
drawFocus(painter, option, option.rect.adjusted(0, 0, -1, -1));
QItemDelegate::paint(painter, opt, index);