[SOLVED] display an image in textEdit
-
You can get the path to your executable with "QApplication::applicationDirPath()":http://developer.qt.nokia.com/doc/qt-4.7/qcoreapplication.html#id-69a34508-b7ba-4b8f-9230-69019ffcb976
-
Try something like that:
@QString imagePath = QApplication::applicationDirPath() + "/image.png";
QString html = QString("<img src="%1" />").arg(imagePath);
ui->textEdit->setHtml(html);@
with the image in the same directory as your executable (don't forget the "/" at the beginning of your relative, since applicationDirPath() doesn't have one at its end).Edit: you have to use < and > to display < and > in your post :)