[Qt-interest] Changing focus rectangle area for item view items

Pavel Lebedev cygnus at michiru.ru
Tue Oct 19 10:12:26 CEST 2010


Hi, I'm trying to make QTreeView draw focus rectangle for items around combined
rectangle of decoration + text instead of just text. My QProxyStyle subclass
overrides subElementRect to return union of SE_ItemViewItemText and
SE_ItemViewItemDecoration for SE_ItemViewItemFocusRect, but it never gets
called, because the drawing path goes from QWindowsVistaStyle style down to
QCommonStyle, which just calls subElementRect on itself, without referring
to its proxy(). It does call into proxy() for drawPrimitive, but at that point
another subclass of QStyleOption is used and there's no way to recover the
dimensions I need.
Is it possible to implement this without subclassing platform-specific styles?

Thanks in advance.

Pavel





More information about the Qt-interest-old mailing list