【问题标题】:TreeView is not syntax highlightedTreeView 没有突出显示语法
【发布时间】:2016-01-21 02:11:52
【问题描述】:

Qt Creator 5.5 在 Windows 和 MacOS 中都没有语法高亮 TreeView。

import QtQuick 2.5
import QtQuick.Window 2.2
import QtQuick.Controls 1.4

ApplicationWindow {
    visible: true
    width: Screen.width /2
    height: Screen.height/2

    TreeView {
        anchors.fill: parent
    }

}

TreeView 被标记为红色下划线,好像 Qt Creator 无法识别,但它确实可以编译和运行。为什么语法没有正确突出显示?

【问题讨论】:

    标签: qml qt5 qt-creator qtquick2


    【解决方案1】:

    我认为这是一个错误,因为所需的模块已正确导入。

    您可以在 TreeView { 行之前使用 //@disable-check M300 抑制警告

    import QtQuick 2.5
    import QtQuick.Window 2.2
    import QtQuick.Controls 1.4
    
    ApplicationWindow {
        visible: true
        width: Screen.width /2
        height: Screen.height/2
    
        //@disable-check M300
        TreeView {
            anchors.fill: parent
        }
    
    }
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2017-04-02
      • 2012-04-19
      • 1970-01-01
      • 1970-01-01
      • 2016-11-21
      • 1970-01-01
      相关资源
      最近更新 更多