Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/qt/7.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何更改qt quick controls2中工具提示的字体?_Qt_Qml_Qtquick2_Qtquickcontrols2 - Fatal编程技术网

如何更改qt quick controls2中工具提示的字体?

如何更改qt quick controls2中工具提示的字体?,qt,qml,qtquick2,qtquickcontrols2,Qt,Qml,Qtquick2,Qtquickcontrols2,我想更改工具提示的字体系列,但出现以下错误 QQmlApplicationEngine未能加载组件 qrc:/main.qml:132类型书页不可用 qrc:/pages/BookPage.qml:41类型BookItem不可用 qrc:/pages/BookItem.qml:102无法分配给不存在的属性字体 QML不支持有多个嵌套级别,因此通常会观察到这种类型的问题,适当减少它,如下所示: ToolButton{ id: tbtnStatistics ToolTip{

我想更改工具提示的字体系列,但出现以下错误

QQmlApplicationEngine未能加载组件

qrc:/main.qml:132类型书页不可用

qrc:/pages/BookPage.qml:41类型BookItem不可用

qrc:/pages/BookItem.qml:102无法分配给不存在的属性字体


QML不支持有多个嵌套级别,因此通常会观察到这种类型的问题,适当减少它,如下所示:

ToolButton{
    id: tbtnStatistics

    ToolTip{
        visible: tbtnStatistics.down
        delay: Qt.styleHints.mousePressAndHoldInterval
        text: "This is Tooltip"
        font.family: "tahoma"
        timeout: 4000
    }

    contentItem: Image {
        fillMode: Image.Pad
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
        source: "../images/statistics.png"
    }
}
ToolButton{
    id: tbtnStatistics

    ToolTip{
        visible: tbtnStatistics.down
        delay: Qt.styleHints.mousePressAndHoldInterval
        text: "This is Tooltip"
        font.family: "tahoma"
        timeout: 4000
    }

    contentItem: Image {
        fillMode: Image.Pad
        anchors.horizontalCenter: parent.horizontalCenter
        anchors.verticalCenter: parent.verticalCenter
        source: "../images/statistics.png"
    }
}