qmake

QT QML resource files do not recompile after changes

我怕爱的太早我们不能终老 提交于 2019-12-30 18:19:09
问题 I'm using QT 5.9.1 working on Mac OS. My project is mobile App with C++ logic and QML UI Layer. All QML files are included into qml.qrc file, so in my .pro file I have RESOURCES += qml.qrc Inside qml.qrc there is a list of all resource files I use in Project, such as pictures, icons and QML files, in QT Creator it's displayed OK: As you can see some QML files are located in ROOT path of qml.qrc when other files are in subfolders , e.g. "qrc:/Elements/". So problem is that whenether I make

Qt pro file call another makefile

坚强是说给别人听的谎言 提交于 2019-12-30 10:30:40
问题 Is there a way to use the .pro file in Qt to call another Makefile? For example, in a makefile, you could use: make -f /other/path/Makefile Is there anything like using the pro file for Qt? 回答1: Something like this should work: QMAKE_EXTRA_TARGETS += other PRE_TARGETDEPS += other other.commands = make -f /other/path/Makefile this will cause make -f /other/path/Makefile to be called as part of the make process, and will also give you the ability to type make other to just run that command. 来源:

Variables that persist across .pro files from a subdirs pro file

早过忘川 提交于 2019-12-30 08:02:13
问题 Greetings, I've got a .pro file that looks like: TEMPLATE = subdirs SUBDIRS = foo bar I want to set a variable, or define, or something in my subdirs .pro file that can be read in both the foo and bar .pro files. I've tried to set an environment variable with: export TEST=something but that does not work, message($$(TEST)) always shows nothing (like TEST is unset). 回答1: Another option is to place the common variables in a file called ".qmake.cache" stored in the root dir of the project. This

Setting RPATH order in QMake

倾然丶 夕夏残阳落幕 提交于 2019-12-30 03:11:15
问题 I have a Linux Qt program. I'd like it to preferentially use the (dynamic) Qt libraries in the executable's directory if they exist, otherwise use the system's Qt libs. RPATH to the rescue. I add this line to the qmake 's .pro file: QMAKE_LFLAGS += '-Wl,-rpath,\'\$$ORIGIN\'' and looking at the resulting executable with readelf I see: 0x000000000000000f (RPATH) Library rpath: [$ORIGIN:/usr/local/Trolltech/Qt-5.2.0/lib] 0x000000000000001d (RUNPATH) Library runpath: [$ORIGIN:/usr/local/Trolltech

Build Qt in “Release with Debug Info” mode?

廉价感情. 提交于 2019-12-30 02:44:05
问题 Is there a way to build Qt in "Release with Debug info" mode ? My application crashes only in "release" mode (works fine in Debug mode) and seems the issue comes from Qt (may be a bug in Qt).So I want to see the debug info of Qt. Qt docs has "debug" , "release" but not "release with debug" mode. [Upate] My application works fine with Mingw 32bit Release/Debug and VSC++ Compiler 64bit Debug. Only crashes on VSC++ 64Bit Release Any tips ? 回答1: Update: See @milanw's answer below. This is now

Using pkg-config with Qt Creator/qmake on Mac OSX

你说的曾经没有我的故事 提交于 2019-12-29 08:32:19
问题 pkg-config doesn't come stantdard with Mac OSX (10.8.4). For my Qt project I wanted to use pkg-config to link in protocol-buffer, so that it would be portable. The very point of choosing Qt was to have a portable app in the first place. However, qmake would not let me use pkg-config. Linking libraries to a QT project using pkg-config output gives a simple recipe that should work. But it doesn't with CONFIG += link_pkgconfig PKGCONFIG += protobuf I'm getting the error Project ERROR: Package

Using pkg-config with Qt Creator/qmake on Mac OSX

馋奶兔 提交于 2019-12-29 08:31:11
问题 pkg-config doesn't come stantdard with Mac OSX (10.8.4). For my Qt project I wanted to use pkg-config to link in protocol-buffer, so that it would be portable. The very point of choosing Qt was to have a portable app in the first place. However, qmake would not let me use pkg-config. Linking libraries to a QT project using pkg-config output gives a simple recipe that should work. But it doesn't with CONFIG += link_pkgconfig PKGCONFIG += protobuf I'm getting the error Project ERROR: Package

qmake: How do I copy .dll/.so's to the output directory?

試著忘記壹切 提交于 2019-12-29 06:45:48
问题 I have a Qt-project that builds a dll/shared-library and another Qt-project that tests the library. Is there any good way to have qmake copy the dll to the output-folder of the test-project? 回答1: Add this to your pro file: target.path = ../testProject/$$TARGET INSTALLS += target 回答2: # Copy the dynamic library. win32 { QMAKE_PRE_LINK=copy /Y lib\qextserialport\src\build\qextserialportd.dll debug\ & copy /Y lib\qextserialport\src\build\qextserialport.dll release\ } else { # TODO: Unices } This

qmake: How do I copy .dll/.so's to the output directory?

烂漫一生 提交于 2019-12-29 06:45:08
问题 I have a Qt-project that builds a dll/shared-library and another Qt-project that tests the library. Is there any good way to have qmake copy the dll to the output-folder of the test-project? 回答1: Add this to your pro file: target.path = ../testProject/$$TARGET INSTALLS += target 回答2: # Copy the dynamic library. win32 { QMAKE_PRE_LINK=copy /Y lib\qextserialport\src\build\qextserialportd.dll debug\ & copy /Y lib\qextserialport\src\build\qextserialport.dll release\ } else { # TODO: Unices } This

INCLUDEPATH in qmake project file doesn't work

南笙酒味 提交于 2019-12-28 16:33:31
问题 I've got a problem with include in a qmake project. In my .pro file I've got: INCLUDEPATH += "C:\OpenCV\build\include" and in my cpp : #include <opencv\cv.h> The compiler indicates an error: Cannot open include file: 'opencv\cv.h': No such file or directory but if I write this in my cpp: #include "C:\OpenCV\build\include\opencv\cv.h" it works! I build the project from within Qt Creator. What am I doing wrong? 回答1: You have to run qmake(build->run qmake) to validate changes in the pro file. Qt