class NewStyle : public QProxyStyle
{
public:
NewStyle
(QStyle *baseStyle
= 0) : QProxyStyle
(baseStyle
) {
}
void drawPrimitive
(PrimitiveElement element,
const QStyleOption *option,
{
if (element
== QStyle::PE_IndicatorItemViewItemDrop && !option
->rect.
isNull()){ 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);
}
}
};
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);
}
}
};
To copy to clipboard, switch view to plain text mode
Bookmarks