qt-creator

Build a 3rd party library from source within an existing Qt project

冷暖自知 提交于 2021-02-06 11:04:34
问题 My project requires a version of zlib that isn't present on all target machines, so I want to build zlib from source in my project. Then when I make my project, it should first build zlib so it can be linked to when compiling my project. One complication is that zlib requires configure to be run before make can be run. I'm not even sure where to start here. Is there functionality built in to Qt Creator for importing 3rd party library source code like this, or do I need to code out a custom

Build a 3rd party library from source within an existing Qt project

冷暖自知 提交于 2021-02-06 11:04:15
问题 My project requires a version of zlib that isn't present on all target machines, so I want to build zlib from source in my project. Then when I make my project, it should first build zlib so it can be linked to when compiling my project. One complication is that zlib requires configure to be run before make can be run. I'm not even sure where to start here. Is there functionality built in to Qt Creator for importing 3rd party library source code like this, or do I need to code out a custom

How to add submenu in Qt

空扰寡人 提交于 2021-02-04 14:30:14
问题 How do I add a submenu from the menu below? I need a submenu to open, say, after clicking "A->Setup" I want a submenu to be opened to the side of the main menu. void MyMenu::cppSlot() { QMenu *xmenu = new QMenu; xmenu->addMenu("A -> Setup"); xmenu->addMenu("B -> Setup"); xmenu->addMenu("C -> Setup"); xmenu->addMenu("D -> Setup"); xmenu->addMenu("E -> Setup"); //Change font and width xmenu->setFont(QFont ("Courier", 10)); xmenu->setFixedWidth(250); //Colour setting xmenu->setAutoFillBackground

Can I prevent auto-run of CMake at startup of Qt Creator 4?

点点圈 提交于 2021-01-29 14:17:52
问题 When I start Qt Creator (4.3) and load a session (or a project already configured), CMake is always run at least once. Even if I disabled the autorun of CMake as said in this answer. The cache is already there because I manually run CMake when needed. How can I make Qt Creator to never run CMake automatically ? 回答1: You can't. Qt Creator 4.3 uses cmake server-mode to get information out of cmake. For that it needs to start cmake, which in turn will need to configure and generate to fetch all

Undefined reference to. In cmake: lib to lib [duplicate]

眉间皱痕 提交于 2021-01-29 12:53:45
问题 This question already has answers here : What is an undefined reference/unresolved external symbol error and how do I fix it? (34 answers) Closed 1 year ago . Windows 7 x86, cmake version 3.15.2, 4.10 qtcreator, Qt5.12.4 MinGW. I build a project with two libraries, and in one of them I call a class from the other. As a result, I get an error. ...file2.cpp:-1: ошибка: undefined reference to `MyClass1::MyClass1()' collect2.exe:-1: ошибка: error: ld returned 1 exit status [ 91%] Linking CXX

Undefined reference to. In cmake: lib to lib [duplicate]

删除回忆录丶 提交于 2021-01-29 12:25:17
问题 This question already has answers here : What is an undefined reference/unresolved external symbol error and how do I fix it? (34 answers) Closed 1 year ago . Windows 7 x86, cmake version 3.15.2, 4.10 qtcreator, Qt5.12.4 MinGW. I build a project with two libraries, and in one of them I call a class from the other. As a result, I get an error. ...file2.cpp:-1: ошибка: undefined reference to `MyClass1::MyClass1()' collect2.exe:-1: ошибка: error: ld returned 1 exit status [ 91%] Linking CXX

Qt Creator Error: cannot find -lopencv_imgcodecs

人走茶凉 提交于 2021-01-29 05:03:50
问题 I have installed opencv, qt, qt creator, cmake on ubuntu 15.10 through VMware on windows. The opencv is installed in this directory: /home/majidalaeinia/opencv/ The project repository is cloned in this directory: /home/majidalaeinia/Desktop/imgwarp-opencv/ I want to run the project through its CMakeLists.txt in qt creator and when I press Build now on qt creator, I get the following errors: error: cannot find -lopencv_imgcodecs error: collect2: error: ld returned 1 exit status Where is the

Qt Creator. Change code generating template for slots

亡梦爱人 提交于 2021-01-28 01:48:48
问题 I'm using Qt Creator 3.2.1 based on Qt 5.3.2 When in the designer, you can right click on a pushButton and select "Go to slot ...". A dialogue box opens allowing you to select a slot ... for example Clicked() . Then you will receive autogenerated method void MyClass::on_Button_clicked() {} But I'm using code style in which the method should be named onButtonClicked() . How can I change default code generating template to satisfy me needs? 回答1: Qt Designer generated UIs support a feature

import QtQuick.Controls 2.1 QML MODULE NOT FOUND

倾然丶 夕夏残阳落幕 提交于 2021-01-27 23:45:07
问题 I am using Qt Creator 2.4.1 base on Qt 4.7.4(32 bit) on windows. I have to create a table in QML using Table View. When i try import QtQuick.Controls 2.1 i get the error QML MODULE NOT FOUND. Same error on Qt Creator 2.6.2 based on Qt 5.0.1. Any help appreciated. 回答1: The module QtQuick.Controls has been added on Qt 5.1 and is currently at the 1.0 version. It also requires you having QtQuick version 2.0, introduced with Qt 5 So if you want to use TableView you would have to update your

How to make xcodebuild print compile errors and warnings to stderr?

与世无争的帅哥 提交于 2021-01-27 22:36:18
问题 Seems like xcodebuild prints everything to stdout. $ /Applications/Xcode.app/Contents/Developer/usr/bin/xcodebuild -project test.xcodeproj build -target test -configuration Debug -jobs 3 2>err # xcodebuild stdout with bunch of warnings and errors $ cat err ** BUILD FAILED ** The following build commands failed: CompileC _build/test.build/Objects-normal/x86_64/test.o /Users/me/test/test.cpp normal x86_64 objective-c++ com.apple.compilers.llvm.clang.1_0.compiler (1 failure) That doesn't let my