QtDesigner custom widget dll blocked by QtCreator - c++

I have a project, maintained in QtCreator, where one of the elements is a QtDesigner plugin (custom widget). The problem is, QtCreator is blocking this plugin (dll file) and I can't build the whole project - I can't even run it, as qmake knows there was an error (while copying the dll) and doesn't allow to run the final exe.
What can I do about it? Maybe there's a way to force QtCreator to unload the plugin? Or maybe there's a rule to allow the project to run, if the fail was only because of this?
Windows 7, Qt 5.3.2, x64, MSVC2013, QtCreator 3.3.2 built from sources (for x64).

Related

deploy QML-using, QBS-built Qt application to windows

I have made an application in QtCreator
I use QML for the GUI, and I use QBS as the build system
I want to be able to deploy the application to windows (and maybe to Linux and MacOS, but right now, I'm only concerned with Windows)
I tried following the deployment tutorial for Qmake with a minimal example(using QBS to build the binary on windows, and with the MSVC2017 compiler, as of 2018-05-23 3:38 PM GMT-6 I've been trying to install MinGW with the Qt Maintenance tool for the last 6 hours, and it's still only at 5%, so I will try with MinGW once that finishes), but I have the following problem
using the Qt Quick Application - Swipe template, the release version with the MSVC2017 compiler, after using windeployqt.exe --release --qmldir ../src example.exe to get the dlls and other libraries
and trying to execute example.exe, I get a message saying
"Qml debugging is enabled. Only use this in a safe environment!"
in a cmd window, right before the actual application starts
and even if I try to disable that in the build step of the project, it doesn't get disabled
it still shows the cmd with the message, is there a way to completely make sure the build settings will work? am I missing a QtCreator configuration to make sure the settings I set actually do what they're intended? do I need to restart Qtcreator or Windows for them to work?
Update: still happens, even with MinGW
This is a bug that will be fixed in Creator 4.7. See https://bugreports.qt.io/browse/QTCREATORBUG-20377.

How to make a standalone mac app using qtcreator

I have build an app using C++ and Qt on QtCreator. The result is a .app file.
Now, when I am running it from the Qt Creator it is running fine.
But when I am running it on a different machine (with no Qt installed) it is not running.
I have figured out the reason is because my .app file is not deployed properly (as there is no framework folder added in the .app)
But I am now having trouble solving it. I am following this link but not getting anywhere as it for console purely.
Is there a way I can fix it using Qt Creator?
A Qt application relies upon Qt's libraries, which must be shipped with the application, inside the built application bundle. The steps for deploying a Qt application for OS X are detailed in the documentation.
If you're not using any other libraries, besides those of Qt, you just need to run the tool macdeployqt, which is part of the Qt installation, in the bin directory. You can set this up to run as a build step in Qt Creator, but I suggest only doing it before you actually deploy the final bundle to another machine.
Calling macdeployqt will copy the necessary Qt frameworks into the bundle and setup the paths to the frameworks so that the binary in the bundle knows where to find them.
If you use any other frameworks or libraries, you need to copy those yourself and set the references to them using install_name_tool

This application failed to start because it could not find or load the Qt platform plugin "windows"

I tried making an executable file of my program but there are some errors which I did not understand or could not find solutions of. I used my .exe file onto another computer and there was an error. I made my program through QtCreator (v 5.1.1)with my Windows 7, 64-bit laptop. There was an error when I used it in 2 32-bit laptops.
The error message says:
This application failed to start because it could not find or load the Qt platform plugin "windows".
Available platform plugins are: minimal, offscreen, windows.
Reinstalling the application may fix the problem.
I already created a new folder called "platforms" containing "qminimal.dll", "qoffscreen.dll" and "qwindows.dll" in the same level of my .exe file. I also pasted in the same level the other DLLs that my program needs.
In Qt 5.2, there is a tool that can be used for deployment on Windows: windeployqt. It will be in the bin folder of your Qt installation. It greatly simplifies deployment, so if you don't mind downloading a newer Qt version, I'd highly recommend it. It may even work with an older Qt version, but I haven't tested it.
We had exact same problem with Qt5.3.
Problem arised when we've rebuilt the Qt to reduce dependencies (e.g. Qt5Positioning, Qt5Sensors).
Created dlls were copied to different directory (source for installation), but we forgot to copy also newly created platforms plugin dlls.
The problem was fixed by using all dlls from same Qt build (with same configuration).
Your problem is probably the same: mixing dlls from different Qt builds (e.g. different configuration, version,...).

Qt Release build unable to open DLL

While my application runs fine and nice in Debug mode of Qt 4.8.1 using QtCreator 2.4.1, it fails to start up in Release mode. Double clicking the generated .exe returns:
"The application was unable to start correctly (0XC000007B). Click okay to close the application."
Running in QtCreator simply stalls (the application window does not appear) and it will eventually returns with error code: -1073741819
Running Dependency Walker will show that:
I have tried to search the location of msvcr90.dll and it appears in multiple directories under C:/Windows/winsxd/...
What should I do to fix this problem at this point? My machine is 64x Windows 7.
You should deploy the Qt (and some other) libraries in order to run your application by that way.
The dll files are in the bin folder of your library installation path. For example, in my machine it is:
C:\QtSDK\Desktop\Qt\4.8.0\msvc2010\bin
Because I'm using the MSVC2010 version (instead of the MinGW version) of Qt. Dependency Walker will tell you what files do you have to copy.
Qt Creator should run your application fine. What version of Qt are you using? (4.8, MinGW or VC2010)

How do I get the "Application" project template to re-appear in Qt Creator IDE?

I just installed Qt Creator IDE and when I first started the QtCreator.exe file, and clicked New Project, it showed the "Application" template from where I could choose the Qt Gui Application type. But now when I run it again it only shows some templates (the image link is provided)
How do I bring back the "Application" template again?
Go to Tools -> Options -> Build & Run > Qt Versions tab and see if your installed Qt versions are recognized.
Re-installing the Qt library, Qt Creator, or the whole QtSDK if it's your case is always a good idea.
EDIT: So for some reason Qt Creator has stopped detecting your Qt library. You don't need the SDK separately. Press the "Add" button in that dialog and locate your installed qmake.exe file (it should be in the bin directory of where you installed the Qt library).
If still not recognized, do a clean reinstall of the library.