How to convert a c++/Qt visual studio solution with multiple project to QtCreator - c++

I have a visual studio 2015 solution with multiple projects on it and I need to build it under Linux, so I used the QT plugin to create .pro file and export it to QtCreator. This worked fine for a single project but for a solution with multiple interdependent project I just couldn't find any option.
Also I tried creating a .pro file for each project to import each of them to QtCreator then create the inter-dependencies. but I couldn't find an option in QtCreator to add/import a sub-project, only creating a new one.
need your help, is there any one who've done that before?
Thanks

Related

How to use premake with a vs2017 Qt project?

I have a Qt project with Visual Studio 2017. I tried to generate project files with premake and used the premake5.lua file from this page "https://wiki.qt.io/Premake_Project_Manager". this file uses a qt-support.lua module which is available on github. However, when I build my project with premake it shows the following error "qt-support.lua:707: action "qt" needs a description". Next, I download the example repository that is referenced in the official Qt documentation (https://github.com/annulen/qt-examples-premake) and tried to generate the project files for that. Even with their repository, it shows the same error. I haven’t used premake before and so I might probably be missing something obvious.
Try this one:
https://github.com/dcourtois/premake-qt
I've been using it for years and I'm very happy with it.

VS 2019 keeps finding qrc cpp files as modified even when they are not

I work in a project using Qt compiled with Visual Studio C++ compiler.
I noticed after migrating from VS2017 to VS2019 that when building the application, VS always find qrc cpp files as modified and try to rebuild them.
Is not happening for all projects though, only some unit tests.
Does someone notice this behavior?
I've had the same issues when upgrading from vc141 (2017) to vc142 (2019). It's old but the only post I found, so:
The difference in the toolkits is that in vc142 "Custom Build Tools" are now appended to include inherited values. If your project is configured to use a build tool projectwide by default (for example meta objects from QTs signal/slot), the compiler will try to do that as well when trying to rcc the qrc files, and ultimately failing without throwing an error.
Simply removing ;%(Outputs) in Properties->Custom Build Tool->General->Outputs solved it for me.

Visual Studio 2010 Qt Add-in Cmake Project

I'm trying to use Cmake to start a new Qt Project inside Visual Studio 2010. I want to recreate the standard setup, as if you were just creating a new Qt project inside MSVS using the Qt Add-in. Since I only have limited knowledge of Cmake and the internet is running out of ideas I need your help. The reason why I want to do this is because I have an existing Visual Studio project and I need to add a GUI.
So what I did was creating a new Qt project inside Visual Studio with just the default Qt-Window. What do I need to do in the CmakeLists.txt to achieve the same results? Or is it easier not to try to remake the standard project and just use the .ui file from the Designer? Do I need to do the whole qt5_wrap_cpp, qt4_wrap_ui and so on stuff in the Cmake?
I've searched for a solution for about two days now and I'm still there where I started.
Thanks for your help and guidance
I am also doing similar things, so I would like to share some views on it.
I created a project in QtCreator, with a project file .pro, .h, .cpp, .ui files. The qt project file .pro is for qmake. Then I transferred my project to MSVC. All I do is to transfer the .h .cpp .ui files to a new directory, and add a CMakeList.txt there.
If you have a existing Visual Studio project and you need to add a GUI, you can create a .uiin QtDesigner and add the .ui file to CMakeList.txt.
To create CMakeList.txt, you can go to the link in the comment above. Though I found the web quite hard to understand as a newbie. So basically, the CMakeList.txt would contain:
Follow the qt web for details when including the directories.
After that:
SET( PROJECT_SRCS
main.cpp)
SET( PROJECT_UIS //this is where you include your .ui files
Resources/UI/myui.ui)
SET( PROJECT_MOC_HDRS
mainWindow.h)
QT5_WRAP_UI( PROJECT_UIS_H //wrap ui files
${PROJECT_UIS}
)
QT5_WRAP_CPP( PROJECT_MOC_SRCS
${PROJECT_MOC_HDRS}
)
ADD_EXECUTABLE( MRT_1JUL
${PROJECT_SRCS}
${PROJECT_UIS_H}
${PROJECT_MOC_SRCS}

Cannot find the path for used header in new project with Visual Studio 2013

I recently used opencv for my C++ programs. I followed the steps of the tutorial which is about setting the path for opencv.
The header files and functions all worked in my first project.(It's needed to set configurations in an empty project)
However, when I am to create a new project, the compiler cannot find the headers and files of opencv. Should I set all stuff again for a new project?
Or is there any other method to help?
Thank you very much.
Visual studio settings are per project, they do not transfer over to different projects.
Set them again.

How to create empty Qt project in visual studio 2010

Using visual studio C++ 2010 Ult.
I have compiled and instaled Qt libraries and visual studio add-in is installed into VC++ so I'm basicaly able to build Qt applications using Qt templates ofered from VS add-in.
I'm also able to include Qt headers and all works just fine...
installation has been done using VSC++ command promt, full build using
configure and nmake then.
QTDIR and PATH are properly seted up.
Qt libs are installed into:
(QTDIR) C:\Users\Admin\Documents\Libraries\Qt
(PATH) C:\Users\Admin\Documents\Libraries\Qt\bin
BIG BUT:
when crating new empty(or other non Qt template) project I can't include any Qt header so my question is how to enable this.
I want to set this so I can in all my future projects simply write:
#include <Qapplication>
#include <Qlabel> //etc...
thanks alot.
Maybe you can use the user properties for that? Set up the include and library paths there, then you should have Qt available for all projects.
See here: http://blogs.msdn.com/b/vsproject/archive/2009/07/07/vc-directories.aspx
For some reason VS can't find Qt headers. I think the only possibility is that you have not specified Qt include paths in the project (not for VS, just for a project). VS add-in always specifies these paths according to the user settings. The basic ones are ($(QTDIR)\include), $(QTDIR)\include\QtCore and $(QTDIR)\include\QtGui. The last one is necessary only when creating non-console GUI applications.