qmake

How to build qt out of source

ⅰ亾dé卋堺 提交于 2019-12-03 04:44:01
I was searching a lot through Qt forums and Google for the last few days, but I could not find any obvious answer to this question. I found the -prefix option (not even documented on Windows) that can be supplied to configure to specify different install directory, but this is not clear separation of the sources and binaries at all, since the build is still done in the source directory and then the files needed for installation are copied to the install directoy. I tried this -prefix option, and came to some problems. (i.e It doesn't copy the .pdb files to the install directory.) Then I found

qt cross compilation for raspberry pi: Cannot find GLESv2

馋奶兔 提交于 2019-12-03 04:01:34
I am trying to compile qt 5.9 for my raspberry pi 3 compute module and I have been following mainly the online guide here ( https://wiki.qt.io/RaspberryPi2EGLFS ). So, I have set the pi system roots to the mount point /mnt/pi-rootfs . I have also set the symlinks to be relative using the script sysroot-relativelinks.py . The qtbase configuration was called with the following argument: ./configure -opengl es2 -device linux-rpi3-g++ -device-option CROSS_COMPILE=/home/osboxes/Downloads/gcc-linaro-6.3.1-2017.05-x86_64_arm-linux-gnueabihf/bin/arm-linux-gnueabihf- -sysroot /mnt/pi-rootfs -opensource

Compile a single file under CMake project?

徘徊边缘 提交于 2019-12-03 03:23:10
I'm developing a C++ project which is going to be enclosed on a bigger one. I've seen that on the bigger project (is a Qt application and it's being generated from qmake) I am able to compile a single file from the linux command line, just entering the relative path to the specific file as an argument to make. On the other hand, I'm using CMake for my own project. When I modify some code for a compilation unit and I have to modify its header file, I have to wait a long time to compile its dependencies and then its own source file. But there are some situations in which I would prefer to check

Force QtCreator to run “qmake” when building

我们两清 提交于 2019-12-03 03:16:57
In some of my projects I use some pre-build step(s) configured in the .pro file. So qmake will execute this step whenever it is activated. Now in QtCreator, when I build (also when completely rebuilding the whole project), it doesn't always run qmake , since it tries to be clever and optimize this. It only runs it when the .pro file has been changed, causing several issues. Also a common issue is, when you make a class inheriting from QObject after running qmake on that file, it will not notice it and hence not run moc on it. Such issues are solved by simply manually running qmake via the

How to specify target mac os x version using qmake

孤者浪人 提交于 2019-12-03 03:14:20
I am trying to compile c++11 code on the Mac OS X using Qt Creator/qmake and I am getting the following error: clang: error: invalid deployment target for -stdlib=libc++ (requires OS X 10.7 or later) When I checked the compile command line, I noticed that it contains the -mmacosx-version-min=10.6 flag. I tried to update my .pro file as follows, but it seems that this is not taken into account: QMAKE_CXXFLAGS += -std=c++11 -stdlib=libc++ macx { -mmacosx-version-min=10.7 } Any suggestions would be helpful. Thanks! You can actually add that deployment target line QMAKE_MACOSX_DEPLOYMENT_TARGET =

Installing PyQt

百般思念 提交于 2019-12-03 02:51:50
I'm trying to install PyQt on my mac so that I can install python ghost. I've already installed Qt, and SIP. I've downloaded PyQt, but when I run python configure-ng.py I get the following error: Error: Use the --qmake argument to explicitly specify a working Qt qmake. Any ideas on what I should do? Manuel Riel Since you are on a Mac, I would use Homebrew . This worked for me the other day, but took a long time to finish: brew install pyqt configure-ng.py needs both qmake and sip to configure the build process. The error message means that configure-ng.py could not locate the qmake executable.

How to copy Qt runtime DLLs to project output

那年仲夏 提交于 2019-12-02 20:15:07
I have a simple project created in Qt Creator (installed using Qt SDK 1.1.4). It runs just fine from within Qt Creator, but if I then browse to the output directory in Windows and double-click the EXE, I'll get an error like: The program can't start because QtCored4.dll is missing from your computer. Try reinstalling the program to fix this problem. That's obviously because Qt isn't in my PATH (and I don't want it to be, in case I have multiple versions of Qt on my computer), and Qt Creator / qmake didn't copy the Qt DLLs to the project output. What I would like to do is use qmake to copy the

QT加载muPDF静态库的问题和解决(导入C语言静态库,QT的运行时库设定)

断了今生、忘了曾经 提交于 2019-12-02 18:58:12
首先下载muPDF,找到mupdf-1.2-source.zip下载解压. 进入win32目录,打开mupdf工程(vs2008及以上会提示转换,转换后自动产生.sln工程) 默认情况下没有v8引擎,v8版工程编不过,可以忽略. 确保mupdf.exe生成成功,可以测试一下效果. 制作一个QT动态库dll实现一些功能,包含头文件fitz.h 导入库libmupdf.lib .一切完事后编译发现所有使用到的函数都报LNK2001: unresolved external symbol 链接错误:未解析的外部符号. 原因和解决办法如下: 因为mupdf使用纯C代码,编译产生的lib具有浓厚的C色彩,作为lib导出的函数修饰符仅仅只有前缀_. 如fz_new_context函数的导出为_fz_new_context.而我们用c++代码加载时,修饰后找的函数却是?fz_new_context@@YAPAUfz_context_s@@PAUfz_alloc_context_s@@PAUfz_locks_context_s@ @I @Z自然找不到. 让mupdf库修改他的导出自然是不可能了,只能在导入的时候做特别声明. 找到fitz.h 由于里面的函数太多,我们只找相关的函数(就是报无法解析的外部符号的函数)在前面加extern "C"让他按C方式修饰再找,就能找到了. 为了保持原代码的完整性

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

烈酒焚心 提交于 2019-12-02 09:01:19
问题 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

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

好久不见. 提交于 2019-12-02 08:50:13
问题 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: