A qt5 simple app doesn't run in windows 7 - qt

I use Qt 5.0.1 and Qt Creator 2.6.2 in W7. I tried to run a simple app from examples which contains only a window ("Widgets tutorial - creating a window"). When I run it in Qt Creator, it works. But when I run it as a standalone app (Release), it doesn't.
I filled the folder with every dll it had asked (26 MB of dlls, while the app is 10KB!!!). Now it doesn't ask for any files, it just doesn't run at all with no explanations.
I tried to add some files as it is advised in Application deployed with QT5 libraries does not start on Windows 7
but no luck. In
HelloWorld Deployment with QtQuick 2.0 in Windows 7 and XP
there are no problems in w7.

May be this a dependency problem, These links describes it:
Qt 5.0 program runs in QtCreator but not outside
How to build QTcore4.dll without dependency to MSVCx80.dll?

platforms/qwindows.dll is a "non-required" required DLL to run Qt5 apps. Build your app in Release mode and steal the DLL from Qt Creator's folder (or find it into Qt's bin/platforms folder)

Related

An installer for Qt apps

I've created a Qt calculator app using Qt Creator 3.6.0 purely in C++ code (I didn't use Designer)
I would like to know how to use Qt to make it installable for publishing.
I ran the app in both Release and Debug modes and have both folders of the two.
I also downloaded and installed Qt Installer Framework Opensource 2.0.1 for my Qt Creator 3.6.0 (the IDE I use for Qt).
And I also have the .dll files needed to run the .exe file.
I've searched the Web for it. But since I'm a novice in Qt I can't do the works properly, or I don't understand. (They seem complicated)
Now, is there any straight forward method to use an installer for the app to make as platform independent as possible?
If so, what installer? And how to do the process? This is the first time for me.

Can't run Qt application under UWP kit

My app is Qt Quick Controls 2 based app. Qt 5.7.1, Windows 10, Visual Studio 2015.
Desktop 32bit version works fine.
But when I switch to Qt 5.7.1 for Universal Windows Platform 32bit kit, it fails to run with the following error:
winrtrunner --device 0 --start --stop --install --wait 0 --profile appx C:/Work/Source/build-MusicPlayer-Qt_5_7_1_for_Universal_Windows_Platform_32bit-Release/bin/player.exe
qt.winrtrunner: Using the Appx profile.
qt.winrtrunner: Failed to activate application: 0x8027025b "The app didn't start."
Error while executing the WinRT Runner Tool: Process crashed
It states here that some dependency is missing. I've checked it using Dependency Walker and it seems that all the required DLLs are in the application's folder. I've also tried to copy just all the files from Qt kit installation into app's dir.
My application consists of one main executable and three .DLL files. I've launched windeployqt for the each of them. Tried both debug and release versions.
I have the same problem on Windows 10, Qt 5.8 (also 5.7), Windows Runtime 64bit VC2015.
This topic was opened on Qt website here: https://forum.qt.io/topic/73272/qt-5-7-for-winrt-and-dynamic-libraries, but it did not help in my case :(. I opened a new topic here: https://forum.qt.io/topic/75424/cannot-start-qt-quick-winrt-application
I had same issue.
You need to recompile all static / dynamic libraries that your application uses for Windows 10 SDK. The issue is that you need to use WinRT dll's which provide sandbox environment instead of "normal" Windows libraries. Windows Store applications require that.
In my case I was using zip static library (zlibstat.lib) with Quazip static library (quazip.lib), compiled in Windows 7 with Visual Studio 2012.
Instead, I used Qt zip, as Qt provides zip library inside QtCore.dll, (just use #include instead of #include "zlib.h") and recompiled Quazip as a static library for Windows 10 SDK.

How To Deploy Qt MinGW application for windows

I have develop an application by using QT/ MinGW 32 bit.This app work on my pc Windows 8. But ı want to deploy this app to my friends whose computers has windows 7. How to deploy it.Is there a necessary programs,framework to work it like .net framework, C++ runtime etc.. I don't know.I can't find a clear solution
To deploy a Qt app on Windows, you'll need to gather files from a few different locations. Here is an example how to do it.
See http://doc.qt.io/qt-5/windows-deployment.html, section "Creating the Application Package". You just have to copy all the necessary DLLs (and other files in case of Qt Quick) to the same directory as executable file. The best way to test whether you have all the required files is to rename your Qt installation directory (C:\Qt) to something else and try to double-click your executable.
Deployment on Windows 7 is no different from Windows 8.

QT Creator QPrintDialog appears on development machine, but not on other machines

I am having trouble deploying an application on machines other than my development machine.
I have a Print button on several menus which works well on the development machine, when running in a Release build in QT Creator. However when I build the project into a .msi file using WiX and distributing it to other computers the Print dialog will not appear. Is this most likely a problem with my WiX file? The version of the .dll file I am using? The .pro file (which includes printersupport in it)? How is it that QT Creator can find and run the code needed for the dialog but other systems cannot?

Cannot deploy my Quick 2 app to a Windows system without Qt installed

I am using Qt 5 with Visual Studio compiler. I have a Quick 2 application with a c++ backend.
I have bundled together my exe, a bunch of dll files, and all of the plugins from Qt, into a single folder. When I run the exe in this folder on a system with Qt installed but Qt Creator closed, it runs fine. When I run it on a system without Qt installed, it does not crash, but it just opens a small 1-inch square window that is all white, nothing else.
I am using a Qt resource file for the QML, so there are no standalone QML files that could be getting missed by the exe. Again, it runs fine on a system with Qt, so what else could I be missing? Dependency walker does not report any problems.
Here is what is in my app directory:
I've been looking at this for hours and I cannot understand what I must be missing (or why Windows deployment is so challenging with Qt).
The problem was resolved by also adding these directories:

Resources