gpt4 book ai didi

c++ - QQml_colorProvider : no color provider has been set

转载 作者:太空宇宙 更新时间:2023-11-04 14:02:32 24 4
gpt4 key购买 nike

我的项目中出现奇怪的 qml 错误,

Warning: QQml_colorProvider: no color provider has been set! 
"qrc:/gui/FirstPage.qml:5 Type GuiPage unavailable
qrc:/gui/GuiPage.qml:4 Invalid property assignment: color expected

这是我的 GuiPage.qml:

import QtQuick 2.1

Rectangle {
color:"transparent"
implicitWidth: 380
implicitHeight: 350
property string pageName: "sample"
property bool active : false
readonly property int firstPage: 1
readonly property int lastPage: 2
readonly property int normalPage : 3
property int pageType : firstPage
signal pageActivate
signal pageClose

property bool hasBlockers: false

property int pageId: 0
property QtObject fontLoader: FontLoader{
source: "font/Cuprum-Regular.ttf"
}
}

我使用了静态构建的 git 稳定分支中的最后一个 Qt。

最佳答案

为了避免这个问题,需要给Qt5打个小补丁(Qt 5.1.1版本仍然需要)

--- qtdeclarative/src/quick/qtquick2.cpp    2013-06-15 17:41:23.000000000 +0200
+++ qtdeclarative/src/quick/qtquick2.cpp 2013-07-01 15:12:23.414228504 +0200
@@ -39,6 +39,8 @@
**
****************************************************************************/

+#include "util/qquickglobal.cpp"
+
#include "qtquick2_p.h"
#include <private/qqmlengine_p.h>
#include <private/qquickutilmodule_p.h>

此问题在此处有更详细的描述:QTBUG-28357

关于c++ - QQml_colorProvider : no color provider has been set,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18581751/

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