class MyProxyStyle : public QProxyStyle
{
public:
{
if(element
== QStyle::PE_IndicatorItemViewItemDrop) {
painter
->setRenderHint
(QPainter::Antialiasing,
true);
//QColor(90,108,217)
QColor c
(palette.
highlightedText().
color());
pen.setWidth(2);
c.setAlpha(50);
painter->setPen(pen);
painter->setBrush(brush);
if(option->rect.height() == 0)
{
painter->drawEllipse(option->rect.topLeft(), 3, 3);
painter
->drawLine
(QPoint(option
->rect.
topLeft().
x()+3, option
->rect.
topLeft().
y()), option
->rect.
topRight());
} else {
painter->drawRoundedRect(option->rect, 5, 5);
}
} else {
QProxyStyle::drawPrimitive(element, option, painter, widget);
}
}
};
class MyProxyStyle : public QProxyStyle
{
public:
void drawPrimitive(PrimitiveElement element, const QStyleOption *option, QPainter *painter, const QWidget *widget) const
{
if(element == QStyle::PE_IndicatorItemViewItemDrop)
{
painter->setRenderHint(QPainter::Antialiasing, true);
QPalette palette;
//QColor(90,108,217)
QColor c(palette.highlightedText().color());
QPen pen(c);
pen.setWidth(2);
c.setAlpha(50);
QBrush brush(c);
painter->setPen(pen);
painter->setBrush(brush);
if(option->rect.height() == 0)
{
painter->drawEllipse(option->rect.topLeft(), 3, 3);
painter->drawLine(QPoint(option->rect.topLeft().x()+3, option->rect.topLeft().y()), option->rect.topRight());
} else {
painter->drawRoundedRect(option->rect, 5, 5);
}
} else {
QProxyStyle::drawPrimitive(element, option, painter, widget);
}
}
};
To copy to clipboard, switch view to plain text mode
Bookmarks