Add MFC to Qt Creator (QMake) project - qt

I need to add some huge classes (non-GUI) that use CString, CArray etc. to my Qt project on Windows, but I am not sure how to use MFC outside of Visual Studio, via Qt Creator QMake (with VS 2017 compiler).
What libraries do I need to link for that?
I found some examples for CMake that use built-in CMAKE_MFC_FLAG but not much information about QMake.

Related

Is Qt Creator source code not included in Qt Src?

Although I chose to install source code when installing Qt, I could not find the source code for Qt Creator in the Src directory. Isn't the source code for Qt Creator included in Qt source? Isn't Qt Creator part of Qt?
Qt and Qt Creator are both developed inside the Qt Project, but are still two separate projects. Qt Creator depends on Qt, but not the other way around, one can use Qt perfectly fine without Qt Creator. They are released independently and with different versioning.
The "sources” package in the Qt installer refers to the Qt source code only, not to Qt Creator. In the installer you’re offered different versions of Qt, all with their own “sources” packages, but only one Qt Creator (the latest one).
You can find the Qt Creator source code in the Qt Download section (the source code archives end in .tar.xz/.tar.gz/.zip) or in the Git repository.

Qt Designer vs Qt Quick Designer vs Qt Creator?

I have seen references to all three of these applications on various parts of the Qt website but am completely unclear as to the exact differences between them and whether they are actually separate things or just different names for the same thing, or the name changed over time? Or is one no longer supported? What's the deal with these?
Qt Creator is Qt's IDE. You don't have to use it, but it greatly simplifies Qt development.
Qt Designer is a graphical tool that lets you build QWidget GUIs. Qt Quick Designer is similar, but for building QML GUIs. Both are built in to Qt Creator.
This is explained in a little more detail over at Wikipedia.
I will explain to you the difference between these tools by the approach for what they are used:
Qt Designer: Sub tool used to create/edit widget files (.ui). You can use it to create the graphical layouts (.ui files only). The most use is to design the graphical stuff in PyQt apps. It is installed always when you install Qt, for example it is in the path: Qt5.13.1\5.13.1\mingw73_64\bin\designer.exe. It also be used to edit any .ui file of a Qt C++ application, however it is very limited since only allows to edit the graphical stuff (not C++ logic).
Qt Quick Designer (it refers to Qt Creator): It does not exist, it is integrated in Qt Creator (see below). Is normal to say that Qt Quick Designer allows to edit QML files (.qml), however it is integrated in Qt Creator now.
Qt Creator: This is the so defacto and most powerfull IDE to create QT applications natively (C++ with Qt engine). It allows you to create, edit source code, debug applications, etc. In addition to that, yo can open a .ui file or a .qml file in Qt Creator and it will open and allow you to edit. For example if you open an .ui file it will show you the Qt Designer app embedded in the full integrated Qt Creator IDE. In summary, you can use Qt Creator to open/edit any .ui or .qml file and create Qt/C++ applications. Of course, if the file is .ui then Qt Creator will show you the Qt Designer tool, if it is .qml then it will allow you to edit the QML.
Qt Creator is just an IDE used to build QT applications; both Qt Widgets and Qt Quick can be composed. When writing Qt Widgets applications you can edit your GUI in Qt Designer but in case of Qt Quick applications you use Qt Quick Designer, both integrated into Qt Creator.
Also there is this new tool name Qt Design Studio which uses QML too and can integrate with Photoshop.
Easy way : Qt Creator (Editor with intellisence, autocomplete and Manual, etc + Graphical designer + Debug symbols + templates.) all for you...
Medium way : Qt Creator (Editor without designer, handcoding, intellisence, autocomplete, etc).
Medium-hard way : Any plain text editor + Qt Designer (to prototype your interface). This is my favorite way, I like Vim
Hard way : Any plain text editor..... you know.

QWT designer plugin is inaccesable via QtCreator built-in designer

I've installed QWT 6.1.0 over a Qt 5.0.1. It installed correctly, but I have one problem with QWT Designer plugin: when I accessing QtDesigner separatly it works correct. But when I trying to use it inside a Creator it don't works: there is no qwt widgets in a form, althogh it builds correctly and widgets are displaying on a runtime.
Next system variables are set:
QT_PLUGIN_PATH = C:\Qwt-6.1.0\plugins
QMAKEFEATURES = C:\Qwt-6.1.0\features
In "Tools->Form Editor->QtDesigner Plugins" it is written that creator can't find necessary [rocedure
The reason might be on the compatibility of your QTCreator with the the ACTUAL QT framework you built QWT against.
The "Qt 5.1.1 for Windows 64-bit (VS 2012, OpenGL, 522 MB)" package provided in QT-Project.org/Download has the QT libraries built against MSVCR110 (C++ 2012) 64 bits where as the actual QTCreator.exe is built against MSCVR100 (C++ 2010). That's why the QWT plugin load successfully form the stand-alone QT Designer that comes in the QT framework, but not on the QT creator that comes in the Tools/ directory. To check this, load the QTCreator executable in Dependency Walker and you'll see.
My recommendation is that you download the source code of QT, build it with your compiler and then compile the QWT using the same compiler. A bit tedious but at least you'll be sure that your plugins will load.

Is Qt Creator built with Qt Creator?

Questions:
Is Qt Creator built with Qt Creator?
Similarly, is Qt Designer built with Qt Designer?
BTW, why are there two Qt IDEs? Are they competitors? Which one should I use? I am using Creator.
What is Qt SDK? I am asking this because the Qt Designer & Creator 2.2.1 and Qtmake 4.7.4 that I installed thro ubuntu 11.10 s/w centre does not work. The build menu is all greyed out.
When I downloaded the latest QtSDK (2.3.1/4.7.4) into a separate installation into /opt/QtSDK, both the ubuntu sanctioned installation and the /opt/QtSDK would work as expected.
Why did my ubuntu sanctioned installation not work without the SDK? What does the SDK do?
This one is for Ubuntu enthusiasts - Qt IDE requires the SDK to work, and yet ubuntu released both Creator/Designer without checking if they work first? There is no QtSDK installation item in s/w centre. Is that intentional, or a procedural bug?
After I build my desktop app (I am building a tabbed file explorer) on Linux, what steps do I need to make to have it running on Windows 7/Vista? Will I rebuild on a windows version of Qt Creator?
I also notice that Qt Creator code generation is not perfect. It would forget to include some Qt library files in the auto-generated code, and I had to correct that manually.
Is Qt Creator built with Qt Creator?
I believe so.
That doesn't mean that everyone who works on Qt has to use it - just that I believe that lots of people do.
I don't work for any of the companies that have produced Qt, but my reasoning is:
A Google search for "dogfooding qt creator" brings up plenty of hits, including this comment from November 2010:
We’re also “dogfooding” by releasing complex apps like Qt Creator and the Ovi Suite on the desktop ports of Qt
They've put a massive amount of effort into Qt Creator over the last few years. It's hard to imagine that being worthwhile, unless they used it themselves
At recent Qt Developer Days, Qt Developers have spoken really enthusiastically about Qt Creator
Similarly, is Qt Designer built with Qt Designer?
Yes. A look at the Qt Designer source code shows plenty of .ui (Designer) files.
Why are there two Qt IDEs? Are they competitors? Which one should I use? I am using Creator.
When you edit .ui files insiide Qt Creator, you are still running Qt Designer: it's simply showing the Designer window inside Creator, for convenience.
What is Qt SDK? ... What does the SDK do?
Qt SDK is just a convenient way to download all the Qt tools in one go. You don't have to use it.
This one is for Ubuntu enthusiasts ... Is that intentional, or a procedural bug?
Sorry - no idea. It's hard to imagine it being intentional though.
After I build my desktop app (I am building a tabbed file explorer) on Linux, what steps do I need to make to have it running on Windows 7/Vista? Will I rebuild on a windows version of Qt Creator?
You will need to install Qt on a Windows PC, and then build your source code in it.
You can either do that by using Qt Creator and the Windows compiler it includes (mingw) or you can use another compiler, if you have one, e.g. Visual Studio.
I also notice that Qt Creator code generation is not perfect. It would forget to include some Qt library files in the auto-generated code, and I had to correct that manually.
If you've used any non-Qt classes in arguments to signals and slots, then this answer may help you there.

How to force Qt Creator to use MinGW instead of Visual Studio

We're trying to compile a project with MinGW on the machine that has both MinGW (with Qt) and Visual Studio installed. Unfortunately, Qt creator prefers MSVS by default, and doesn't see it's very own MinGW (screenshot). Sadly, this results in a lot of obscure errors, because application was written and debugged with MinGW. Is there way to make Qt Creator to use MinGW without killing MSVS?
While installing, choose custom type of installation. Selected libraries for needed compilers in QtSDK->Development Tools->Desktop Qt->Qt-. Screenshot:
Have you made sure your Qt sdk is installed with its MinGW? You can use the Qt maintainance app to make sure its MinGW engine is installed.
Where are those libraries from? Did you compile the SDK yourself? Or did you downloded the libraries?
Try to see what is in the mkspecs directory. There should be a link named 'default'. That links to the specification which is being used. I suppose it is pointing to win32-msvc2008. You can change that but if it is pointing to that specification it means that the Qt libraries have been compiled with that specification (unless it was changed afterwards), which means you cannot use those with MinGW. You should compile the libraries with the correct specification or download the correct package (MinGW version).

Resources