Details
-
Bug
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
5.5.1
-
None
-
Windows 10
Description
The only way to customize the DropIndicator is to inherit QProxyStyle, it should be allowed to customize in the stylesheet.
Here a code to customize it :
class CCustomProxyStyle : public QProxyStyle { public: virtual void drawPrimitive( PrimitiveElement Element, const QStyleOption* Option, QPainter* Painter, const QWidget* Widget ) const override { if( Element == QStyle::PE_IndicatorItemViewItemDrop ) { // Create the pen. Painter->setPen( QPen( Option->palette.highlight().color().light(), 1 ) ); Painter->setBrush( Qt::transparent ); // Check the rect height. if( Option->rect.height() == 0 ) Painter->drawLine( Option->rect.topLeft(), Option->rect.bottomRight() ); else Painter->drawRect( Option->rect.x(), Option->rect.y(), Option->rect.width() - 1, Option->rect.height() - 1 ); } else { QProxyStyle::drawPrimitive( Element, Option, Painter, Widget ); } } };
The problem is stylesheet + style gives visual issues.