When I open a qt gui project in visual studio (through qt-addin and openning .pro file in vs), it does not open console for me while in .pro file I'd added this line :
CONFIG += console
and console comes up in qt creator, but my problem is when I open the pro file in visual studio!.
how can I open console inside my gui in visual studio after opening .pro file in it? (I use qt5 and vs2012)
After adding your new CONFIG line to the .pro file, run the following command line call in the MSVC command line window to regenerate your Visual Studio project to be one for a Qt console application:
qmake -tp vc foo.pro
The Windows environment variables QMAKESPEC and QTDIR need to be properly set, and also set PATH=%QTDIR%\bin;%PATH%
Related
Error when run FBLTool_0224.exe
I guess you double-clicked in exe file that provides after building in release mode :
For Deploy and create Exe output with QT in windows you should follow this way:
put your compiler path in your system path. now you use mingw81_64 you should set it. something like Qt/tools/mingw81_64/bin
copy exe file that provides after building in release mode in one folder and run mingw81_64 cmd (it has separate cmd)
and cd to that folder path
windeployqt app.exe
This command will get all dll needs for your app and your exe will work .
if you use qml
windeployqt --qmldir (the path of its directory ) app.exe
and also see these youtube videos for more info:
https://www.youtube.com/watch?v=LdSTgR0xJco
https://www.youtube.com/watch?v=hCXAgB6y8eA
installing visual C++ 2010 runtime x86 solved problem
I'm new to Qt, learning through a Qt Creator tutorial. I am trying to connect Qt with a MySQL database. To do so, I have to modify a .pro file adding the command QT += core sql
However, once I create a project there is no .pro file in the menu, only the .ccp file.
Program installed: Qt Creator 4.13.0
OS: Windows 10 x64
Steps followed:
Choose New Project
Choose Qt Console Application
Build system: CMake
Kits: I have some available; I am using Qt 5.15.1 MSVC2019 64bit
The menu displayed shows a CMakesList.txt file, and the main.ccp source file. However no .pro file is created.
For new build system you should modify CMakeList.txt file.
Please try to replace
target_link_libraries(myapp Qt5::Gui)
with
target_link_libraries(myapp Qt5::Gui Qt5::Sql)
I'm trying to compile this source with Qt Creator: QPropertyEditor
What I do is just clone the repo, double click the .pro file:
Then I right click in the project, and build:
I'm getting this errors:
I've checked the output directory and I guess it's correct: %{Config:DefaultProjectDirectory}
I don't know what to do now, I only used Visual Studio, it's my first time with Qt and I can't find anywhere the option to build debug files, etc
I am using Qt qbs to generate Visual Studio solution for my new project. I use QtCreator to create a new qbs-based project, then use the command line below to generate the .sln file:
qbs generate -g visualstudio2015 profile:qt595 config:Release
Of cause, I've generated the qt595 profile for qbs.
Then I open the sln file in my Visual Studio 2015, press Ctrl+Shift+B to start building. VS complains:
EXEC : error : Unexpected command line parameter 'Release'.
I opened the property of the project "qbs-generate", and found some thing goes wrong. The NMake command is as below:
$(QbsGenerateCommandLine) Release qbs.profile:qt595
which obviously has an unneeded parameter "Release", that's why VS complained.
So, how can I overcome this problem? I tried remove "Release" manually. VS built successfully that time, however the solution was generated again and after reloading the "Release" came back!
My Qt's version is 5.9.5, qbs is 1.11.0, and my operation system is Windows 10 64bit.
This is fixed in qbs 1.11.1; see https://bugreports.qt.io/browse/QBS-1303. Please upgrade.
I'm trying to get QT to work with Visual Studio Express 2013.
As first I downloaded sources, and was trying to compile it using Developer Command Prompt for VS2013. Gave up, after adding to QT source files new things, to keep compiler move on.
After that I just installed QT binaries. The QT: "qt-windows-opensource-5.1.1-msvc2012-x86_64-offline.exe"
It has it's own editor, but I would like to use QT inside Visual Studio Express 2013. Can I just link libraries, from Visual Studio Express 2013 project?
I linked C:\Qt\2010.05\qt\include to the Include, C:\Qt\2010.05\qt\lib to the libraries and C:\Qt\2010.05\qt\bin.
But there are a lot os subdirectories, that Visual doesn't include.
Should I wait for QT Sources compatible with Visual Studio Express 2013?
Or can I use it now, like that?
Regards
To do this from cmd.exe you have to edit your PATH by adding QtDir/bin there, then cd to your project directory and write the line written before.
Everything should looks like this:
Run cmd.exe
cd your_project_dir/
qmake -spec win23-msvc2010 -tp vc
After this manipulations you will have .vcproject file in your project directory