qmake

How to execute shell command after compile finished from .pro in QT?

北城余情 提交于 2019-12-17 09:39:58
问题 What changes must I make to the .pro file if I want to execute chmod command, execute the output binary file, or do some other operations. 回答1: I had a similar problem. I wanted a special tool (versioner) to run over the code every time the Makefile was executed. Here's the solution: (to be read in the Qmake Manual, Configuring qmake's Environment, Section: Customizing Makefile Output) Create you own Makefile target. Specify the command etc. mytarget.target = .buildfile mytarget.commands =

Qt C++ Project with non-inline assembly

吃可爱长大的小学妹 提交于 2019-12-14 03:52:37
问题 I am using Windows XP, and Newest Qt Creator with QtSDK and the built-in gcc compiler. The question is, how to use full assembly in a C++ Qt Project. I know how to use inline assembly, but I don't know how to do non-inline(written in a separate .asm file) full assembly, in a Qt C++ project. Is this possible with a Qt C++ project, and if so, how? EDIT: * pro file TEMPLATE = app CONFIG += console CONFIG -= qt SOURCES += \ calc.S calc.S section .data hello: db 'Hello world!', 10 helloLen: equ $

Qmake: how to check for Qmake version

て烟熏妆下的殇ゞ 提交于 2019-12-14 02:37:06
问题 I want to write some Qmake project files which are both compatible with Qmake 4 and Qmake 5. There are subtle differences where I need to check if I it uses Qmake 4. How can I do such a check? 回答1: You can check Qt version in pro file: equals(QT_MAJOR_VERSION, 4): # do something for Qmake 4 equals(QT_MAJOR_VERSION, 5): # do something for Qmake 5 来源: https://stackoverflow.com/questions/26948091/qmake-how-to-check-for-qmake-version

QMake finds library in designated folder however linker doesn't

瘦欲@ 提交于 2019-12-13 21:32:19
问题 The state of the project I'm trying to integrate the QVTKWidget in a qmake Qt 5.7 project and thus provide my application with some nice support for 3D surface plot charts (the 2D chart feature is currently handled by Qwt but I might switch to VTK's 2D charts module if I find it easy enough to integrate). What has been done so far I have successfully built the VTK toolkit in both debug and release version (available respectively at C:\VTK and C:\VTKDebug\ . In addition to that I have also

How to enable exception handling in mingw

浪尽此生 提交于 2019-12-13 19:45:06
问题 I am new to Mingw and C++ programming. I am trying to build a C++ project but getting following error. error: exception handling disabled, use -fexceptions to enable. Where I need to pass this -fexceptions parameter. When I am trying mingw32-make -fexceptions I am getting follwoing error. mingw32-make: exceptions: No such file or directory 回答1: Since you're using Qt, add "exceptions" to the CONFIG variable in your project file (the *.pro file): CONFIG += exceptions This should take care of

How to disable adding 'd' suffix to debug library name in qmake on windows?

让人想犯罪 __ 提交于 2019-12-13 15:25:35
问题 I created project for QML C++ plugin in QtCreator and debug version have 'd' suffix appended to the name, for example plugind.dll instead of plugin.dll . How can configure project not to add this suffix? Qt version 4.8.1, windows 7. 回答1: You can write this line into the .pro file: TARGET = YourProgramName 来源: https://stackoverflow.com/questions/12295514/how-to-disable-adding-d-suffix-to-debug-library-name-in-qmake-on-windows

How to write the qmake file for a test case? [duplicate]

一个人想着一个人 提交于 2019-12-13 12:49:42
问题 This question already has an answer here : Include a .pro file in Qt? (1 answer) Closed 5 years ago . I just don't understand what is the overall layout of a Qt project with a program and a test... The project of QTest tutorial only have the test program, but my project already have another program. If I add the test case, it claims "multiple definition of main()", as QTEST_MAIN is actually another main() . In addition, I got "undefined reference to vtable" on my test class, and don't know

Does a Qt 5 programmer have to know about DEPENDPATH qmake variable?

偶尔善良 提交于 2019-12-13 11:43:09
问题 With Qt 4 you are bound to get in trouble if you do not setup the variable correctly. 回答1: If you program with Qt 5 you can safely forget that DEPENDPATH variable exists. All included files will generate dependencies for files in which they are included regardless of directories they reside. You don't have to put up with the variable in Qt 4 too. Just add this to your .pro file: CONFIG += depend_includepath If you want to use DEPENDPATH variable for some reasons with Qt 5 you can switch the

How to detect target iOS architecture in qmake?

◇◆丶佛笑我妖孽 提交于 2019-12-13 08:25:47
问题 I have a Qt Version that supports following ABI's (Qt Creator → Preferences → Build & Run / Qt Versions): arm-macos-generic-mach_o-32bit arm-macos-generic-mach_o-64bit x86-macos-generic-mach_o-32bit x86-macos-generic-mach_o-64bit So, combining in a Qt Kit this Qt Version with different compilers I can build libs for all mentioned architectures. At the same time the mkspecs/qconfig.pri contains: host_build { QT_ARCH = x86_64 QT_TARGET_ARCH = arm } else { QT_ARCH = arm } So, in a .pro file I

Why is my MOC_DIR ignored when generating Visual Studio projects with qmake

爱⌒轻易说出口 提交于 2019-12-13 06:46:03
问题 I'm generating Visual Studio 2013 projects with Qt 5.3 qmake . In my .pro file, I've got the following line: MOC_DIR = $$BUILD_DIR/<DEBUG OR RELEASE>/moc If I message($$MOC_DIR) , the path is correctly formed. However, when I build in VS, the moc_<CLASS>.cpp files are not generated in that location, but instead end up in the same directory as the .pro . I get the following warning during compilation: Two or more files with the name of moc_<CLASS>.cpp will produce outputs to the same location