Uploaded image for project: 'Qt'
  1. Qt
  2. QTBUG-50521

DropIndicator stylesheet missing

    XMLWordPrintable

Details

    • Bug
    • Resolution: Unresolved
    • P3: Somewhat important
    • None
    • 5.5.1
    • Widgets: Style Sheets
    • 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.

      Attachments

        No reviews matched the request. Check your Options in the drop-down menu of this sections header.

        Activity

          People

            Unassigned Unassigned
            alundra Michael Ségura
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

            Dates

              Created:
              Updated:

              Gerrit Reviews

                There are no open Gerrit changes