I have a problem painting to a QTextEdit.
This works:
tabs
->currentWidget
() = a subclassed
QTextEdit
p.drawLine(0,0,width(), height());
}
QTabWidget *tabs;
tabs->currentWidget() = a subclassed QTextEdit
void EditorWin::paintEvent ( QPaintEvent *e ) {
QPainter p(this);
p.drawLine(0,0,width(), height());
}
To copy to clipboard, switch view to plain text mode
However, as expected, it draws the line from the top-left to the bottom-right, BEHIND the QTabWidget.
So, I tried to paint where I wanted the line to show up:
tabs
->currentWidget
() = a subclassed
QTextEdit
p.drawLine(0,0,width(), height());
}
QTabWidget *tabs;
tabs->currentWidget() = a subclassed QTextEdit
void EditorWin::paintEvent ( QPaintEvent *e ) {
QPainter p(tabs->currentWidget());
p.drawLine(0,0,width(), height());
}
To copy to clipboard, switch view to plain text mode
This will NOT draw, and I have no idea why. Could anybody help?
Win32/Qt4.1
Edit: I also tried to run this through the paintEvent of the subclassed QTextEdit widget, same result: no drawing
Bookmarks