PDA

View Full Version : QTableWidget drop animation



Imhotep
22nd August 2016, 20:56
Is there a way to change QTableWidget drop animation? Actually the animation is this: http://imgur.com/a/FGvIe

I tried this, but doesn't work:



class NewStyle : public QProxyStyle
{
public:
NewStyle(QStyle *baseStyle = 0) : QProxyStyle(baseStyle)
{
}

void drawPrimitive(PrimitiveElement element, const QStyleOption *option,
QPainter *painter, const QWidget *widget) const
{

if (element == QStyle::PE_IndicatorItemViewItemDrop && !option->rect.isNull()){
QStyleOption opt(*option);
opt.rect.setLeft(0);
if (widget) opt.rect.setRight(widget->width());
QProxyStyle::drawPrimitive(element, &opt, painter, widget);
return;
}
else
{
// the default style is applied
QProxyStyle::drawPrimitive(element, option, painter, widget);
}
}

};