QT Webview url loading - qt

Mine is a somple application,I am just loading a url page(loading from server) in the widget window.
Ex:
QWebView->load(QUrl("xxxxx"));
QWebView->show();
this url contains some jpeg image and javascript.
The problem here is my application is able to page correctly in some machines but in some machines jpeg image is not able to load.
Please help me to resolve this issue. I am just surprised what could be the reason.

If you're working with an SDK build of Qt, the ability to view JPEGs in a Qt application is based on the JPEG plugin.
Please see one of the following links:
http://developer.qt.nokia.com/doc/qt-4.8/deployment.html
http://developer.qt.nokia.com/doc/qt-4.8/deployment-plugins.html
Alternatively, if you are building from source, you can compile JPEG support into Qt itself.

Related

Is it possible to set icon for a custom file used by my app

I would like to create and app using Qt which will use custom files. The app will be available on Windows, OS X and Linux.
The idea is to have a custom icon for my file type (e.g. when you install Adobe's Master Collection, .as, .fla, .ps, etc. files have they own icons).
As far as I know Qt only helps you with app icon. I did not find any kind of support for this kind of problem.
This seems to be an OS problem. Do I need to create scripts to run on app install? (I will be using Bitrock's install builder to provide installers)
How can I achive this behaviour on all OSs?

How to link to a PDF file in Qt Assistant?

I use Qt Assistant as a help viewer and I have an internal link to a PDF file that is embedded into the compiled archive format. When I click on that link, nothing happens. How can I link to a PDF file that is embedded, click on the link and have an external application opened? I use Qt Assistant 4.7.3.
Short of bundling a program like Okular into your application release and launching it as an external process there isn't a native way of arriving at your solution. More options are discussed here as well, to sum it up it's either externally or converting the PDF to a QPixmap.
I don't think that this can work. To display a pdf file you need Acrobat or a similar (external) program, and this program needs a file to read. Why don't you store the pdf files outside the help file?

QPixmap image loading problem

Basically I am trying to load the image as a texture using QPixmap:
texture[T_WALL] = bindTexture(QPixmap(":/images/wall.png"), GL_TEXTURE_2D);
The code works on my development machine, but not in the vm / other pcs without QT. Initially I was using jpegs and just assumed that I messed up the plugins, but as I understand, no plugins are needed for png files so I have no idea where the problem is.
Results are the same when loading local files and using Qt resources.
I am deploying libgcc_s_dw2-1.ddl, mingwm10.dll, QtCore4.dll, QtGui4.dll, QtOpenGL4.dll. Do I need anything else?
Try adding an imageformats directory to your application directory and put qmng4.dll there. See my answer to the question Qt dll deployment on windows
If it still does not work, get the Sysinternals suite which contains dgbview.exe that allows you to watch qDebug messages (even for release builds).

QMovie doesn't show GIF file in Mac

In my project, I use QMovie as a loading bar. It works well in Windows. However, I moved my project to Mac and it didn't work anymore.
The GIF image file is in the resource file. I tried using both resource file path and absolute file path. But, it seems not okay.
Thanks
Gif capacity is done with a plugin. Your application needs to be able to load qgif4 plugin at runtime to be able to display gif
=> make sure your gif imageformat plugin is compiled, deployed and in your application library path (note that these paths can be checked at runtime using QCoreApplication::libraryPaths
I used QPaintEvent and QRect to show loading animation. Now, the problem was solved by following MoviePlayer example of Qt using QLabel::setMovie function.

Qt: QWebview not displaying jpg, gif, png images on another machines

Today I came across a very strange error with QWebView which I cannot resolve myself.
I included a QWebView widget in my application. When I set a URL or a piece of HTML code to display (with QWebView::setUrl() or QWebView::setHtml()), it works very well on my machine. It also works on all machines that have Qt installed, but not on those without it. I compiled a release build and included all necessary libraries as shared (QtWebKit4.dll, QtNetwork4.dll etc.), so I guess my error lies in that I forgot to include some libraries.
If anybody has already had such an error, I would be very grateful for help!
You might need to include the relevant Qt image processing plugin libraries, which are located in qt/plugins/imageformats (and maybe also qt/plugins/iconengines ). I haven't deployed any webkit apps, so I'm not certain about this.
See my answer to this question: Qt dll deployment on windows

Resources