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[])
{
tb.setHtml("Here is a <a >link</a>.");
gv.scene()->addWidget(&tb);
gv.show();
return a.exec();
}
#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();
}
To copy to clipboard, switch view to plain text mode
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[])
{
tb.setHtml("Here is a <a >link</a>.");
tb.show();
return a.exec();
}
#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();
}
To copy to clipboard, switch view to plain text mode
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
Bookmarks