1
votes

So I've been making a program for my company using Qt 4.8.4 (required). When deploying the project to a different machine, the program runs fine (I included Qtgui4.dll and Qtcore4.dll). However, when trying to view a print preview image using QGraphicsView, no other machine will show it. I even tried installing Qt 4.8.4 on the other machine and building it there to no avail. I use MSVC to compile and have installed Visual Studio on the new machine as well. I also include the imageformats folder when deploying the .exe to other machines.

I am at a loss here. I've researched this for days. I don't understand why it runs perfectly fine on my machine but will not run on others even when I replicate the development environment.

I have attached a picture of it actually workingimage.

On all other machines, the preview image shows blank/white. However, I noticed that the image is built and that it will print. It just will not preview.

I know I haven't included any code but I won't be able to include much as it's for my company. But I have included what I could related to the QGraphicsView.

// Create a handle for the graphics view; fix bug where preview would disappear
// on first view; winId() creates the winId; Needed to initialize first
ui->graphicsView->winId();
/************************************/
if (preview)
    preview(ui->graphicsView->winId(), &err);
1
Have you checked that the dlls in imageformats/ actually get loaded? - Daniel Vérité
I've had a similar problem in the past because the deployment version of Qt had jpg support disabled. You might try using a .png or .bmp as the image format instead of .jpg, or check the 'configure' parameters of your deployment Qt build to make sure jpg support is enabled. - Jeremy Friesner
I guess I should have noted that I'm not actually "deploying" the project. I am only transferring the built project to another machine. Also, jpeg is working. It will load all the images in terms of opening them and creating the graphics using the company SDK. The only issue I am having is with the QGraphicsView. For whatever reason, even with Visual Studio and Qt installed on another computer, the QGraphicsView will not display the image preview. - srprentice
Also, I have run Dependency Walker to see if there were any dlls not included in the .exe directory to cause it to not work. The only ones listed were Qtgui4.dll, Qtcore4.dll, msvcr90.dll, and kernel32.dll. The Qt dlls are in the directory and the other two are already on the machine. - srprentice
I have rebuilt the project using MinGW with the same results. After some more testing, it seems that the preview works on all Windows 7 machines but refuses to work on Windows XP machines. Is there a library dependency with Qt for Windows 7? I don't think that there is, since I can compile the project on an XP machine. But then again, I don't know why the preview refuses to work. The only thing I can think of is winId() returning different IDs. - srprentice

1 Answers

0
votes

No solution was found on my end. I finished the application with the stipulation that the OS could not be XP.