-
Bug
-
Resolution: Cannot Reproduce
-
P3: Somewhat important
-
None
-
None
A QLabel which displays rich text doesn't propagate its mouse events properly to its parent. I found this on win32-msvc2005.
-snip---------------------------
class MyWidget : public QWidget
{
public:
MyWidget(QString txt)
void mousePressEvent(QMouseEvent* e)
{ close(); }};
int main(int argc, char* argv[])
{
QApplication app(argc, argv);
MyWidget* lblPlain = new MyWidget("click me to close");
lblPlain->show();
MyWidget* lblRich = new MyWidget("click <b>me</b> to close");
lblRich->show();
return app.exec();
}
-snap---------------------------
This example shows two widgets, each containing a QLabel.
Widget lblPlain holds a plain text string, lblRich a rich text string.
One can click on the text in lblPlain and the widget closes as expected.
If you click on lblRich then nothing happens... you need a double click to get rid of it.
It seems that ensureTextControl is the source of the problem. AFAICS the mouse event is sent to the text control.