qmake

How do I stop Qt Creator placing my executable in a “debug” subdirectory?

孤者浪人 提交于 2020-01-03 17:34:05
问题 I'm building a project in Qt Creator, and while I don't care where the intermediate .obj files go it's important that the final executable be put in (and run from) a particular directory where the many dependency DLLs etc. are to be found. So, in Qt Creator, I select the 'Shadow Build' option and specify the path to this directory. What I always find, however, is that instead of being put into this directory, the final executable is always placed into the_Directory_I_Actually_Want/debug ...

QtWebKit dependency missing from qmake generated Makefile

烂漫一生 提交于 2020-01-03 17:17:07
问题 I just started working with Qt (in C++), so I followed a "hello, world" example I found online. I created the program hello.cpp in the directory hello: #include <QtGui> int main(int argc, char *argv[]) { QApplication app (argc, argv); QLabel label ("Hello, world!"); label.show(); return app.exec(); } I ran: qmake -project qmake hello.pro make and everything compiled correctly and I was able to run ./hello. Then, being an adventurous person, I tried modifying the file: #include <QtGui>

Linking to wrong library version in a C++ application

戏子无情 提交于 2020-01-03 06:44:06
问题 I'm troubleshooting a C++ binary on RHEL/CentOS 5, which has problems with the openssl shared libraries. I don't do much C/C++ programming, and I'm having trouble finding the root issue. What seems to be going wrong is that the application is linking to specific versions of libcrypto and libssl (0.9.8), instead of the symlinked paths of /lib/libcrypto.so.6 and /lib/libssl.so.6 . Since the openssl libs have been updated since this was compiled, it's now broken. ldd shows the following 2

Qt Target with special characters

孤者浪人 提交于 2020-01-03 05:10:22
问题 I have a QT application and right know I need to change the app name to something like "A&B". I have tried to change the TARGET in my .pro file, but I am having problems with the " & " character in macOS . I have also tried to use qmake functions like val_escape , system_quote , shell_quote but nothing worked for me. As a last resource, I have tried to change the CFBundleName in my .plist file, which worked for app menus and etc, but not for the app name (still having problems with &, as make

How to automate Qt moc?

爱⌒轻易说出口 提交于 2020-01-02 06:37:24
问题 I have to run the following commands from Qt command prompt: qmake -project then make and this gives me the debug folder with the Moc file. This is strangely the only way my PC will generate the moc_.cpp file. So how can I automate the task of these commands so I don't have to use these commands again? 回答1: You should not run qmake -project multiple times. The -project option is meant to provide you a template project file for you to edit. An equivalent of what you are doing in an IDE would

How to automate Qt moc?

Deadly 提交于 2020-01-02 06:37:13
问题 I have to run the following commands from Qt command prompt: qmake -project then make and this gives me the debug folder with the Moc file. This is strangely the only way my PC will generate the moc_.cpp file. So how can I automate the task of these commands so I don't have to use these commands again? 回答1: You should not run qmake -project multiple times. The -project option is meant to provide you a template project file for you to edit. An equivalent of what you are doing in an IDE would

Compiler scope values in qmake

那年仲夏 提交于 2020-01-01 09:23:14
问题 qmake provides several built-in platform scopes, allowing a project file to perform different operations depending on the current platform: win32 { ... } unix { ... } All platform specifications in the mkspecs directory can also be used to test various platform/compiler combination, e.g. linux-g++ { ... } win32-g++ { ... } win32-msvc2003 { ... } However, I can't seem to find a way to test only the compiler (without the os) #This does not work g++ { ... } msvc { ... } Is there a way to do this

How to set build order in Qt subdir project

南楼画角 提交于 2020-01-01 04:03:09
问题 I have a project with 5-6 libraries and one executable. The executable depends on the libraries, and some libraries depend on other libraries. How can I specify a build order so the dependencies are built before they are needed? 回答1: Although this question has been answered and accepted a long time ago, I feel the need to add another answer; I honestly think that there is a better answer. I consider CONFIG += ordered harmful and a bad habit. It is probably something that was a bit prematurely

Qmake in release and debug mode

本秂侑毒 提交于 2019-12-31 02:58:11
问题 I have a library and I would like it to copy itself to a directory depending upon what configuration i'm in (debug or release). Here is my project file. #------------------------------------------------- # # Project created by QtCreator 2011-08-13T12:48:33 # #------------------------------------------------- TARGET = JECLibrary TEMPLATE = lib DEFINES += JECLIBRARY_LIBRARY SOURCES += \ JECMessageText.cpp \ JECMessageCombo.cpp \ JECButton.cpp HEADERS +=\ JECLibrary_global.h \ JECMessageText.h \

QT QML resource files do not recompile after changes

醉酒当歌 提交于 2019-12-30 18:19:28
问题 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