QGraphicsView gv=new QGraphicsView(); QGraphicsScene gs=new QGraphicsScene(); QGraphicsTextItem textitem=new QGraphicsTextItem(); textitem.setDocument(ui.textEdit.document()); gs.addItem(textitem); gv=new QGraphicsView(gs); gv.show(); ***********************************************code above***************************************
I want use this to view the rich text in the "ui.textEdit", but the QGraphicsView doesn't show the QGraphicsTextItem with the QTextDocument. What's wrong with it? And after that, I tried to change the "textitem.setDocument(ui.textEdit.document());" into "textitem.setHtml(ui.textEdit.toHtml());" and then it really works well without problem. I need the setDocument function to archive my rich text (including images) viewer in my project. Please help me. Thanks a lot in deed.
_______________________________________________ Qt-jambi-interest mailing list [email protected] http://lists.trolltech.com/mailman/listinfo/qt-jambi-interest
