PDA

View Full Version : QTextBrowser does not show hand cursor for links if embedded inside a QGraphicsScene



peers
29th August 2012, 18:11
Hi Folks,

I’ve got a QTextBrowser which I added to a QGraphicsScene via a QGraphicsProxyWidget:


#include <QTextBrowser>
#include <QGraphicsScene>
#include <QGraphicsView>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QTextBrowser tb;
tb.setHtml("Here is a <a >link</a>.");
QGraphicsView gv(new QGraphicsScene);
gv.scene()->addWidget(&tb);
gv.show();

return a.exec();
}
The text is properly displayed and also the link works. What is not working is that the mouse cursor changes to the hand cursor when hovering over the link.

Everything works fine when not embedding the QTextBrowser inside the QGraphicsScene:


#include <QTextBrowser>

int main(int argc, char *argv[])
{
QApplication a(argc, argv);

QTextBrowser tb;
tb.setHtml("Here is a <a >link</a>.");
tb.show();

return a.exec();
}
What I am doing wrong or what I am missing?

Is this maybe a limitation of the Graphics View Framework and especially of the QProxyWidget?

Any help would be appreaciated :)

Thanks a lot!
Peer