qmake

Qt console application “WARNING: QApplication was not created in the main() thread”

帅比萌擦擦* 提交于 2019-12-02 06:05:08
I'm creating a very simple C++ QT console application from an example given here on stack overflow. How to use QFileSystemWatcher to monitor a folder for change The code is exactly as the code in that application and I'm developing with Qt's UI, Qt Creator with MinGW 32bit. I selected the console application from the projects I could choose as I have no need for a graphical user interface. Once the application has finished loading, the application shows the error message "WARNING: QApplication was not created in the main() thread" then does nothing. I have tried debugging the application but

Why are changes to the QML code sometimes not reflected when hitting 'Run' and how to solve it?

六眼飞鱼酱① 提交于 2019-12-02 05:15:22
In this Qt Quick simple example, I want that when I move a Racked upwards, we have a message on console.log showing that movement and another message when the Racket is moved downwards. I've written this code for that: Racket.qml : import QtQuick 2.8 Rectangle { id: root width: 15; height: 50 x: 400; y: 100 color: "red" property int oldY: 100 property bool yUwards: false property bool yDwards: false onYChanged: { if( y > oldY) { yDwards = true yUwards = false console.log("Racket moved downwards.\n") } else if( y < oldY) { yDwards = false yUwards = true console.log("Racket moved upwards.\n") }

超详细Linux下QT使用appimage打包程序

余生颓废 提交于 2019-12-02 03:43:21
版权声明:本文为博主原创文章,遵循 CC 4.0 BY-SA 版权协议,转载请附上原文出处链接和本声明。 本文链接:https://blog.csdn.net/kuer1379/article/details/82885810 一 打包工具 1.linuxdeployqt 下载地址:https://github.com/probonopd/linuxdeployqt/releases 2.patchelf 下载地址:https://nixos.org/releases/patchelf/patchelf-0.9/patchelf-0.9.tar.gz 二 配置linuxdeployqt 1.点击点击下载linuxdeploy-continuous-x86_64.AppImage 2.然后执行如下代码,将改名字后的linuxdeployqt移动到 /usr/local/bin目录下 sudo mv linuxdeployqt-continuous-x86_64.AppImage linuxdeployqt sudo mv ./linuxdeployqt /usr/local/bin chmod 777 linuxdeployqt sudo linuxdelpoyqt --version linuxdeployqt 4 (commit 988d294), build 481 built

Qmake in release and debug mode

非 Y 不嫁゛ 提交于 2019-12-02 00:04:30
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 \ JECMessageCombo.h \ JECButton.h CONFIG(debug, debug|release) { DLLDESTDIR += $$quote(../../../Jane

How to pass a cmd-command output to a #DEFINE MACRO in QMake

你说的曾经没有我的故事 提交于 2019-12-01 22:35:37
I added a new #DEFINE to my ".pro" file like this: #DEFINE += SVN_V now I would like to pass the output of the command "svnversion -n" to this SVN_V , and here is what I did: #DEFINE += "SVN_V = svnversion -n" but the result is error: no such file or directory error: svnversion: no such file or directory so, what am I missing here exactly? (Be aware I am working with Linux Ubuntu) It could be something like that: DEFINES += "SVN_V=\"\\\"$$system(svnversion -n)\\\"\"" $$system() is a qmake function to execute system command and obtain output from it. external quotes around SVN_V... - is for

QMake: execute script after build

岁酱吖の 提交于 2019-12-01 22:22:03
This is for setting up the application bundle of a MacOSX app. I have a script which copies a few files and does some other things. So I want to execute the script after the build (i.e. after the linking step). I want it to be executed just every time because it is not possible to specify its dependencies. I know there is QMAKE_POST_LINK (e.g. described here or here ) but it runs only when the target does not exists, i.e. when linking needs to be done. However, I want the script to run every time, also when the target already exists. There is also QMAKE_EXTRA_TARGETS and POST_TARGETDEPS (e.g.

Adding object (.o) files to qtcreator project

会有一股神秘感。 提交于 2019-12-01 21:40:37
How does one add third party .o and .h files to a Qt C++ project in QtCreator? I want to add some compiled .o files from John The Ripper to my probject (ignore the non-cross-platformness of that). As a test, a wrote a small C program (outside QtCreator) and linked it against common.o and MD5_std.o and it worked fine; I can just do gcc -o runme common.o MD5_std.o simpleprogram.c , but with QtCreator, nothing seems to work. I keep getting undefined references. I tried adding this to the .pro file: LIBS += "$$_PRO_FILE_PWD_/common.o" "$$_PRO_FILE_PWD_/MD5_std.o" And this: LIBS += /full/path/to

qmake: Test for current spec

佐手、 提交于 2019-12-01 18:02:19
问题 I would like to detect whether qmake is currently building using MingW (win32-gcc) or Visual Studio (win32-msvc200X). At the moment I am using the following construct: windows{ contains(QMAKE_CC, gcc){ # MingW } contains(QMAKE_CC, cl){ # Visual Studio } } This does not seem particularly robust. Is there a better way? 回答1: Probably not anymore robust, but different: windows { *-g++* { # MinGW } *-msvc* { # MSVC } } 来源: https://stackoverflow.com/questions/1741993/qmake-test-for-current-spec

qmake: Test for current spec

£可爱£侵袭症+ 提交于 2019-12-01 17:53:59
I would like to detect whether qmake is currently building using MingW (win32-gcc) or Visual Studio (win32-msvc200X). At the moment I am using the following construct: windows{ contains(QMAKE_CC, gcc){ # MingW } contains(QMAKE_CC, cl){ # Visual Studio } } This does not seem particularly robust. Is there a better way? Tuomas Probably not anymore robust, but different: windows { *-g++* { # MinGW } *-msvc* { # MSVC } } 来源: https://stackoverflow.com/questions/1741993/qmake-test-for-current-spec

How to detect Qt Creator's target (debug/release) (Visual Studio)

落爺英雄遲暮 提交于 2019-12-01 17:36:07
So I use qmake to create my program, but I'm always having a conflict between my debug and release boost libraries with the message: libboost_system-vc120-mt-s-1_58.lib(error_code.obj):-1: error: LNK2038: mismatch detected for '_ITERATOR_DEBUG_LEVEL': value '0' doesn't match value '2' in main.obj I would like to make this automated, in such a way where choosing debug or release from Qt Creator suffices to create the correct version. I saw other solutions like the one here , but that doesn't work. The reason why it doesn't work can be seen when calling the following command for both debug and