hi friends, i can able to load a text file onto the form's "textEdit" widget but i am not able to load an image since in a Designer there are only few display widget(like QGraphicsView,LCD) so how can i load an image????
hi friends, i can able to load a text file onto the form's "textEdit" widget but i am not able to load an image since in a Designer there are only few display widget(like QGraphicsView,LCD) so how can i load an image????
With QTextEdit you will have to use QTextDocument::addResource():
Just notice that QTextBrowser is capable of loading resources from local files out of the box.Qt Code:
textEdit->document()->addResource(QTextDocument::ImageResource, QUrl("url-used-in-html"), QImage("image.png"));To copy to clipboard, switch view to plain text mode
J-P Nurmi
not only with the QTextEdit, but there are other classes like QImage,QImageReader how can i use these classes to display the image. I have written something like this
"QString filename = QFileDialog::getOpenFileName(this);"
with this file "filename" can i display the image using QImage class (since it has fun'
QImage::QImage ( const QString & fileName, const char * format = 0 ) )
any suggess' plz welcome
sudheer (1st December 2007)
thank q , now i can able to display system image files(.jpg,.png,gif,.bmp format ) using
both classes QLabel(on form's label widget) and QPixmap
Bookmarks