Radagast
28th March 2009, 10:32
Qt 4.4.3, Windows XP
I used 'search', but didn't find an answer...
Well I need to tune drawing of QLineEdit (I'm subclassing it) so it paints only text (possibly selected) and flicking cursor. No background and no frame. I can disable background with
QPalette p = palette();
p.setBrush(backgroundRole(), QBrush(Qt::transparent));
setPalette(p);
but the thin blue line is still painted. In Qt's source there is:
QStyleOptionFrameV2 panel;
initStyleOption(&panel);
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this);
So is it possible not to draw the frame without total reimplementation of paintEvent (it's rather huge :( )?
thanks in advance.
Added: sorry, I didn't notice the setFrame :)
I used 'search', but didn't find an answer...
Well I need to tune drawing of QLineEdit (I'm subclassing it) so it paints only text (possibly selected) and flicking cursor. No background and no frame. I can disable background with
QPalette p = palette();
p.setBrush(backgroundRole(), QBrush(Qt::transparent));
setPalette(p);
but the thin blue line is still painted. In Qt's source there is:
QStyleOptionFrameV2 panel;
initStyleOption(&panel);
style()->drawPrimitive(QStyle::PE_PanelLineEdit, &panel, &p, this);
So is it possible not to draw the frame without total reimplementation of paintEvent (it's rather huge :( )?
thanks in advance.
Added: sorry, I didn't notice the setFrame :)