当前位置:网站首页>Xxx.pro learning in QT
Xxx.pro learning in QT
2022-07-24 16:44:00 【Liu-Eleven】
1. Determine whether there is this module , Compile if necessary , If nothing, ignore
qtHaveModule(webengine) {
SUBDIRS += \
webview
}2. Specify dependencies
examples.depends = tools support skins qmlexport3. Use DEFINES Macro defines the project global switch


4. Specify the build path :
DESTDIR = $$PWD/bin/ # Specify where the compiled executable file is generated
RCC_DIR = $$PWD/target/rcc_target
MOC_DIR =$$PWD/target/moc_target
OBJECTS_DIR = $$PWD/target5. Copy files before Compilation
win32 {
src_dir = $$PWD\docs\*.*
CONFIG(debug, debug|release) {
dst_dir = $$PWD\\bin\\
} else {
dst_dir = $$PWD\\bin\\
}
# dst_dir final \\ Is a must , Used to mark xcopy To a folder , If it does not exist , Created by
# Replace slashes in paths with backslashes for Windows
src_dir ~= s,/,\\,g
dst_dir ~= s,/,\\,g
exists($$dst_dir):system(xcopy $$src_dir $$dst_dir /y /e)
}6.windows Run as an administrator :
QMAKE_LFLAGS += /MANIFESTUAC:\"level=\'requireAdministrator\' uiAccess=\'false\'\" # Run as an administrator 7. Pre compile and post compile execution (windows No need make install)
# The guild is in :G:/Qt/5.15.2/mingw81_64/qml/ establish com/org/example/io Catalog
uri = com.org.example.io
#CONFIG += qmltypes
#QML_IMPORT_NAME = com.mycompany.messaging
#QML_IMPORT_MAJOR_VERSION = 1
DISTFILES = qmldir
#QMAKE_POST_LINK Represents what is executed after compilation
#QMAKE_PRE_LINK Represents the execution of content before compilation
# Target directory
installPath = $$[QT_INSTALL_QML]/$$replace(uri, \., /)/
# Set the output directory of executable files or library files
DESTDIR = $$installPath
!equals(_PRO_FILE_PWD_, $$OUT_PWD) {
# Set up the qmldir Copy the file to the file compilation output directory
copy_qmldir.target = $$installPath
copy_qmldir.depends = $$_PRO_FILE_PWD_/qmldir
copy_qmldir.commands = $(COPY_FILE) "$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)" "$$replace(copy_qmldir.target, /, $$QMAKE_DIR_SEP)"
QMAKE_EXTRA_TARGETS += copy_qmldir
PRE_TARGETDEPS += $$copy_qmldir.target
# cop_qmldir_system_commands= $(COPY_FILE) "$$replace(copy_qmldir.depends, /, $$QMAKE_DIR_SEP)" "$$replace(installPath, /, $$QMAKE_DIR_SEP)"
# message($$cop_qmldir_system_commands)
# Determine whether the directory to be installed exists
# !exists($installPath) {
# non-existent , Create the directory
# create_dir_command = $(MKDIR) "$$replace(installPath, /, $$QMAKE_DIR_SEP)"
# Execute before compiling
# QMAKE_PRE_LINK = $$create_dir_command
# message("install path is not exists.....")
# }
# Execute after compilation
# QMAKE_POST_LINK = $$cop_qmldir_system_commands
}
#DISTFILES = qmldirThe execution information of the above example after the project compilation is completed is as follows :
![]()
边栏推荐
猜你喜欢

Meeting OA project progress (II)
[redis] -1. two ways of setting up environment based on docker
![[Nanjing Agricultural University] information sharing of postgraduate entrance examination and re examination](/img/1d/550a991385b842a21e2b301725407e.png)
[Nanjing Agricultural University] information sharing of postgraduate entrance examination and re examination

Sword finger offer 48. the longest substring without repeated characters

How vscode mouse wheel enlarges the interface

Template method mode

IP第十三天笔记

剑指 Offer 22. 链表中倒数第k个节点

Thinkphp3.2.5 cannot jump to external links

Jupyter uses tips
随机推荐
Explain Apache Hudi schema evolution in detail
ZCMU--5083: ly的数对(C语言)
QT keyboard event (I) -- detect key input
ArcGIS create vector
Enter a URL to this page to show it. What happened in this process?
With notes: printing order of synchronous, asynchronous, micro task and macro task
QT keyboard event (II) -- long press the key to trigger the event event repeatedly, and the problem is solved
The third edition of New Horizon College English reading and Writing Tutorial 4 graduation examination site (units 1,2,3,5,6)
[leetcode]38. counting - problem solving (execution time beat 91%, memory consumption beat 97%)
荣耀CEO赵明:单一厂商很难实现全场景产品覆盖
What does Baidu promote "delete and recall" mean?
1309. Decode letter to integer mapping
安全的证券公司有哪些?我想在手机上买股票
Causes and solutions of QT signal and slot connection failure
双亲委派机制
[leetcode]75. color classification - problem solving (execution time beat 90%, memory consumption beat 78%)
1024 happy holidays
Getting started with arcpy
C font usage effect
Qt键盘事件(一)——检测按键输入