I want to draw a colorful rectangle around the user's
selection for text modifying.
But I fail when try the code snippet[drawing a rectangle or even a line] below.
{
//QTextEdit::paintEvent(e);
pd.drawRect(m_selRc);
pd.drawLine(0,0,20,20);
// QTextEdit::paintEvent(e);
}
void QHexEdn::paintEvent(QPaintEvent *e)
{
//QTextEdit::paintEvent(e);
QPainter pd(this);
pd.setBrush(QBrush(QColor(255,255,255)));
pd.drawRect(m_selRc);
pd.setPen(QPen(QColor(255,0,0)));
pd.drawLine(0,0,20,20);
// QTextEdit::paintEvent(e);
}
To copy to clipboard, switch view to plain text mode
Bookmarks