qmake

How to put generated files (e.g. object files) into a separate folder when using Qt/qmake?

一个人想着一个人 提交于 2019-12-18 12:17:20
问题 I have a Qt project that uses qmake. To improve clarity and readability, I'd like to keep the source files build system generated files (such as object files) separate. So my first step was putting the source files into a src/ sub directory: myproject/ myproject.pro src/ main.cpp MainWindow.ui ... That way I separated the source files from the build system (*.pro). However, when I then run qmake followed by make , the generated files (object files, etc) are placed into the main project folder

How to suppress warnings for file included from header

余生颓废 提交于 2019-12-18 06:06:32
问题 I use GCC -Weffc++ option in my Qt project. To suppress warnings from Qt headers i add QMAKE_CXXFLAGS += -isystem $(QTDIR)\include . But this doesn't suppress all warnings, i still get annoying warnings from QUuid class because $(QTDIR)\include\QtCore\quuid.h file includes ..\..\src\corelib\plugin\quuid.h . I tried to add QMAKE_CXXFLAGS += -isystem $(QTDIR)\src and QMAKE_CXXFLAGS += -isystem $(QTDIR)\src\corelib\plugin but it didn't help. Is there a way to fix this? 回答1: You need to suppress

Where are variables such as $(MKDIR) and $(COPY_DIR) defined?

ⅰ亾dé卋堺 提交于 2019-12-18 03:22:21
问题 I am trying to get hold of the values these variables contain but I couldn't find any informations about them on the web and searching for such strings in C:\Qt folder brought up nothing. Where are these variables defined ? 回答1: Before a .pro file is processed and your Makefiles are generated by qmake several other files are pre-processed based on your compiler and platform. These files have the extension .prf and .conf and are loaded from a directory called mkspecs. The values of MKDIR and

How to mix Qt, C++ and Obj-C/Cocoa

﹥>﹥吖頭↗ 提交于 2019-12-18 03:19:12
问题 I have a pure C++/Qt project on a Mac, but I now find that I need to call a few methods only available in the Cocoa API. Following instructions listed here: http://el-tramo.be/blog/mixing-cocoa-and-qt I have a C++ class implementation in a ".m" file. As a test, my "foo.m" file contains the following code (relevant #include methods have been stripped for clarity).: int foo::getMagicNumber() { NSCursor *cursor = [NSCursor new]; } Apparently, I need to add the .m file to a qmake variable called

Change Qt install path after building?

a 夏天 提交于 2019-12-18 01:25:12
问题 how can I change Qt install path after I building it ? Example : qmake.exe search binaries to original install path, how can I change/redefine it ? Thanks. Edit : I finally found this patch to apply to Qt : http://ftp-developpez.com/qt/binaires/win32/patcher/QtPatcher.7z http://ftp-developpez.com/qt/binaires/win32/patcher/QtPatche_src.7z 回答1: I was looking into this and found a way that works (in qt 4.7.2) by customizing qt with a qt.conf file. In my case, I added a qt4-4.7.2/bin/qt.conf (I

Changing OpenSSL include path for qmake

天大地大妈咪最大 提交于 2019-12-17 21:15:20
问题 I want to build Dogecoin with qmake. It doesn't work with Fedora's OpenSSL because its OpenSSL doesn't have elliptic curve cryptography included. So I've got my own OpenSSL but I can't figure out how to change the dogecoin-qt.pro file to include an OpenSSL from a different location. Normally with make I would do this: $ export OPENSSL_INCLUDE_PATH="/usr/local/ssl/include" $ export OPENSSL_LIB_PATH="/usr/local/ssl/lib" qmake seems different, the file I need to change is here: https://github

Identifier for win64 configuration in Qmake

五迷三道 提交于 2019-12-17 15:54:21
问题 Is there a "win64" identifier in Qmake project files? Qt Qmake advanced documentation does not mention other than unix / macx / win32. So far I've tried using: win32:message("using win32") win64:message("using win64") amd64:message("using amd64") The result is always "using win32". Must I use a separate project-file for x32 and x64 projects, so they would compile against correct libraries? Is there any other way to identify between 32-bit and 64-bit environments? 回答1: I do it like this win32

Qt: *.pro vs *.pri

假如想象 提交于 2019-12-17 10:33:26
问题 What is the difference between *.pro and *.pri configuration files for qmake? What should go into a *.pro file and what should go into a *.pri file? 回答1: A .pro file is what you would run QMake on. A .pri file is included by a .pro file. Other than that there is not much of a difference between the two. Example usage could be if you have different builds which need different options. You could put shared information in the .pro, while deferring the options to various .pri files. A bit more

Qt: *.pro vs *.pri

你离开我真会死。 提交于 2019-12-17 10:33:23
问题 What is the difference between *.pro and *.pri configuration files for qmake? What should go into a *.pro file and what should go into a *.pri file? 回答1: A .pro file is what you would run QMake on. A .pri file is included by a .pro file. Other than that there is not much of a difference between the two. Example usage could be if you have different builds which need different options. You could put shared information in the .pro, while deferring the options to various .pri files. A bit more

Qt开发经验小技巧1-10

ε祈祈猫儿з 提交于 2019-12-17 10:07:41
【推荐】2019 Java 开发者跳槽指南.pdf(吐血整理) >>> 当编译发现大量错误的时候,从第一个看起,一个一个的解决,不要急着去看下一个错误,往往后面的错误都是由于前面的错误引起的,第一个解决后很可能都解决了。 定时器是个好东西,学会好使用它,有时候用QTimer::singleShot可以解决意想不到的问题。 打开creator,在构建套件的环境中增加MAKEFLAGS=-j8,可以不用每次设置多线程编译。珍爱时间和生命。新版的QtCreator已经默认就是j8。 如果你想顺利用QtCreator部署安卓程序,首先你要在AndroidStudio 里面配置成功,把坑全部趟平。 很多时候找到Qt对应封装的方法后,记得多看看该函数的重载,多个参数的,你会发现不一样的世界,有时候会恍然大悟,原来Qt已经帮我们封装好了。 可以在pro文件中写上标记版本号+ico图标(Qt5才支持) VERSION = 2018.7.25 RC_ICONS = main0.ico 管理员运行程序,限定在MSVC编译器。 QMAKE_LFLAGS += /MANIFESTUAC:"level='requireAdministrator' uiAccess='false'" #以管理员运行 QMAKE_LFLAGS += /SUBSYSTEM:WINDOWS,"5.01" #VS2013 在XP运行