qmake

Qt: passing variables to subprojects

两盒软妹~` 提交于 2019-12-10 03:52:25
问题 The structure of my project is as follow: Proj Proj.pro --subProj --subProj.pro ----subsubProj ----subsubProj.pro Is there a way i can instance a global variable in subProj.pro and call it en e.g. subsubProj.pro like: Proj.pro: GLOBAL_VAR = true subsubProj.pro: message($$GLOBAL_VAR) Update Maybe I should more precise with my problem. The usual behavior in Qt Creator when you right-click on Proj and choose "Build project"Proj"" is that qmake Proj.pro gets invoked then qmake subProj.pro and

QMake moc files confused by namespaces

北城余情 提交于 2019-12-09 22:16:03
问题 I have a file that looks like: #ifndef ENGINE_PLATFORM_AREAEDITOR_H #define ENGINE_PLATFORM_AREAEDITOR_H #include <QWidget> #include "../Widgets/QtSfmlWidget.h" namespace Engine { namespace World { class Area; } } //This tell's Qt's qmake to ignore the code between MOC_SKIP_BEGIN and MOC_SKIP_END // MOC_SKIP_BEGIN #include "Engine/World/Area.h" // MOC_SKIP_END namespace Ui { class AreaEditor; } class AreaEditor : public QWidget { Q_OBJECT public: Engine::World::Area area; public: explicit

How can I pass the output of a command as a compiler flag through a Qt project file?

醉酒当歌 提交于 2019-12-09 20:22:30
问题 I'm trying to add the output of "git describe" to the about window of my application, so it's easier to find out what version of the application people use. I can do it by adding the following compiler flag: -DAPP_VERSION="$(git describe HEAD)" But since the project is based on qmake, I would like to find a way to put this into the Qt project file. Is this possible? And if so, how? edit: I tried adding the following: QMAKE_CXXFLAGS += -DAPP_VERSION="$(git describe HEAD)" But it just gave me "

Is it possible to use Qt Creator without qmake?

房东的猫 提交于 2019-12-09 11:24:57
问题 I've heard that it is possible to build non-Qt applications (like simple C++ HelloWorld) with Qt Creator. I downloaded and installed Qt Creator, and tried to compile simple code with it. But I didn't succeed: Creator needs qmake to create makefile. Although the package I downloaded includes MinGW, there is no qmake inside of it. I still want to use it just like an IDE to create simple C++ sources and compile them with MinGW. Is it possible to use Qt Creator without installing whole platform?

What is Qt Bare Metal?

会有一股神秘感。 提交于 2019-12-09 10:13:58
问题 QtCreator has a plugin named "Bare Metal". Bare Metal means a computer without an operating system. I have not seen much about Qt Bare Metal development. Is it a way to develop Qt for a bare metal system? Does Qt run on a system with no OS? If yes, what are the advantages of this approach for embedded system development? 回答1: Is it a way to develop Qt for a bare metal system? No. Does Qt run on a system with no OS? No. Bare Metal means you usually have a few KB of RAM and ROM. I think you are

How to make use of the INSTALL_ROOT that resides in generated Makefiles?

耗尽温柔 提交于 2019-12-08 18:03:23
问题 qmake generates the following (among the others) rule for installing a target: -$(INSTALL_PROGRAM) "$(TARGET)" "$(INSTALL_ROOT)/$(TARGET)" I cannot set INSTALL_ROOT with something like this in a *.pro file isEmpty(INSTALL_ROOT) { INSTALL_ROOT=/usr } because INSTALL_ROOT is somehow local to generated Makefiles. According to what I've found out so far INSTALL_ROOT is empty by default. It could be used like INSTALL_ROOT=$HOME make install when invoking make, which is fine. However I want to be

Qt version is invalid

☆樱花仙子☆ 提交于 2019-12-08 09:54:35
问题 I am working on Linux and I have installed Qt Creator 2.5.2, Qt libraries 4.7.4 and 4.4.3 all from sources. I cannot install the binaries directly for incompatibility between versions. The installation processes for both Qt 4.7.4 and Qt 4.4.3 were the same. The issue I am facing is that Qt Creator recognizes Qt 4.7.4 but not Qt 4.4.3, with the error The Qt version is invalid : Could not determine the path to the binaries of the Qt installation, maybe the path is wrong. Well each library is

Qt Creator: how to tell win32 from win64

我的未来我决定 提交于 2019-12-08 05:33:29
问题 I have to do something like this in a .pro file: win32 { LIBS += -L../3rdparty/libusb-win32/lib/msvc -llibusb } else win64 { LIBS += -L../3rdparty/libusb-win32/lib/msvc_x64 -llibusb } The problem is it doesn't work, it always links win32 library. Any suggestions? 回答1: You can use QT_ARCH variable to detect whether your configuration is 32 or 64 : contains(QT_ARCH, i386) { message("32-bit") }else { message("64-bit") } When the target is 32-bit, the variable returns i386 and in case of a 64-bit

“no rule to make target…” error with undocumented files(glob) function

丶灬走出姿态 提交于 2019-12-07 21:05:56
问题 I´ve got one project, where all my .h and .cpp files are included. This project builds my application. Another project has all my unit tests in it, which require the same .h and .cpp files as the first project. So everytime I add a new file to my first project I have to add it to the second project too, which is why I tried to automate that step. For this I tried to use the files(glob) function of qmake, which looks basically like this: HEADERS += \ someotherstuff.h \ files(../Core

Qt Creator: how to tell win32 from win64

送分小仙女□ 提交于 2019-12-07 19:33:23
I have to do something like this in a .pro file: win32 { LIBS += -L../3rdparty/libusb-win32/lib/msvc -llibusb } else win64 { LIBS += -L../3rdparty/libusb-win32/lib/msvc_x64 -llibusb } The problem is it doesn't work, it always links win32 library. Any suggestions? You can use QT_ARCH variable to detect whether your configuration is 32 or 64 : contains(QT_ARCH, i386) { message("32-bit") }else { message("64-bit") } When the target is 32-bit, the variable returns i386 and in case of a 64-bit target it has the value of x86_64 . Here's how we do that: win32 { win32-g++:contains(QMAKE_HOST.arch, x86