gpt4 book ai didi

qt - 未找到 QML 模块

转载 作者:行者123 更新时间:2023-12-03 17:31:33 28 4
gpt4 key购买 nike

我将一个项目复制到另一个目录( fork ),现在我总是得到 QML module not found (QtQuick.Controls). , 和类似的。

原始项目没有显示任何错误。我清理并重建了所有东西,但这并没有解决它。该项目编译并运行完美,因此 QtCreator 不知何故被愚弄了,认为存在一些问题。

这可能是什么原因?我正在使用 Qt 5.11、QtCreator 4.7.1

见附图

enter image description here

项目文件:

QT += quick network
QT += quickcontrols2
QT += widgets
CONFIG += c++11

# The following define makes your compiler emit warnings if you use
# any feature of Qt which as been marked deprecated (the exact warnings
# depend on your compiler). Please consult the documentation of the
# deprecated API in order to know how to port your code away from it.
DEFINES += QT_DEPRECATED_WARNINGS

# You can also make your code fail to compile if you use deprecated APIs.
# In order to do so, uncomment the following line.
# You can also select to disable deprecated APIs only up to a certain version of Qt.
#DEFINES += QT_DISABLE_DEPRECATED_BEFORE=0x060000 # disables all the APIs deprecated before Qt 6.0.0

SOURCES += \
blockchainaccount.cpp \
blockies.cpp \
error.cpp \
ethkey.cpp \
hqx.cpp \
hqx2.cpp \
hqx3.cpp \
hqx4.cpp \
identicon.cpp \
walletaccount.cpp \
main.cpp \
aewm.cpp \
acctlist.cpp \
block.cpp \
blocklist.cpp \
txlist.cpp \
vtlist.cpp \
transaction.cpp \
valuetransfer.cpp \
acctcatlist.cpp \
ftokens.cpp \
token.cpp \
txparam.cpp \
ftokops.cpp \
nftokens.cpp \
simres.cpp \
ftapprovals.cpp \
ftholders.cpp \
mainstats.cpp \
prefs.cpp \
blockheader.cpp \
addresslist.cpp \
acctcat.cpp \
balance.cpp \
big.cpp \
tokop.cpp \
ftholder.cpp \
ftapproval.cpp \
utils.cpp

RESOURCES += qml.qrc

# Additional import path used to resolve QML modules in Qt Creator's code model
QML_IMPORT_PATH =

# Additional import path used to resolve QML modules just for Qt Quick Designer
QML_DESIGNER_IMPORT_PATH =


# Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin
else: unix:!android: target.path = /opt/$${TARGET}/bin
!isEmpty(target.path): INSTALLS += target

DISTFILES +=

HEADERS += \
blockchainaccount.h \
blockies.h \
error.h \
ethkey.h \
hqx.h \
hqx2.h \
hqx3.h \
hqx4.h \
identicon.h \
walletaccount.h \
aewm.h \
acctlist.h \
block.h \
blocklist.h \
txlist.h \
vtlist.h \
transaction.h \
valuetransfer.h \
acctcatlist.h \
ftokens.h \
token.h \
txparam.h \
ftokops.h \
nftokens.h \
simres.h \
ftapprovals.h \
ftholders.h \
mainstats.h \
prefs.h \
blockheader.h \
addresslist.h \
acctcat.h \
balance.h \
big.h \
tokop.h \
ftholder.h \
ftapproval.h \
utils.h \
config.h

最佳答案

我也遇到了这个问题并且能够解决它,主要是按照警告消息中的说明进行操作。该警告消息的粗略近似表示:“请将 /usr/lib64/qt/qml 添加到您的 QML_IMPORT_PATH 变量中。”

在我的项目中快速搜索发现只有一个 QML_IMPORT_PATH 的实例在项目的 .pro 文件中。我在 .pro 文件中添加了该行的建议路径,问题得到解决。

YMMV

关于qt - 未找到 QML 模块,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/53049853/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com