このページでは

EventFilter QML Type

監視対象項目のEventFilterを定義します。詳細...

Import Statement: import QtOpcUa
Since: QtOpcUa 5.13
Status: Deprecated since 6.9

この型は QtOpcUa 6.9 以降、非推奨となっています。新しいコードでの使用は強くお勧めしません。

プロパティ

  • select : list<SimpleAttributeOperand>
  • where : list<FilterElement>

詳細な説明

サーバー上のイベントを監視するには、イベントフィルタが必要です。これは、select 句とwhere 句で構成されます。

select 句は、イベントが発生した際にユーザーが受信したいデータを指定するために使用されます。これは、イベントタイプの子ノードの属性(例:BaseEventTypeの「Message」プロパティのvalue属性)を選択する、SimpleAttributeOperand の単純属性オペランドで構成されます。

where 句は、特定の条件との一致によって報告されるイベントを制限するために使用されます。いくつかの演算子と4種類のオペランドタイプにより、イベント型の子ノードの属性の値に基づいたフィルタリングが可能になります。

select句は、SimpleAttributeOperand の配列で構成されます。where句は、SimpleAttributeOperand 、LiteralOperand 、ElementOperand 、またはAttributeOperand の配列で構成されます。

以下の EventFilter は、"Severity" フィールドの値が 500 以上のイベントについて、"Message" フィールドの値を報告するようサーバーに指示します。

import QtOpcUa as QtOpcUa
QtOpcUa.Node {
    ...

    eventFilter: QtOpcUa.EventFilter {
        select: [
                  QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Severity"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                  },
                  QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Message"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                  }
        ]

        where: [
            QtOpcUa.FilterElement {
                operator: QtOpcUa.FilterElement.GreaterThanOrEqual
                firstOperand: QtOpcUa.SimpleAttributeOperand {
                    browsePath: [
                                  QtOpcUa.NodeId {
                                      identifier: "Severity"
                                      ns: "http://opcfoundation.org/UA/"
                                  }
                                ]
                }
                secondOperand: QtOpcUa.LiteralOperand {
                                value: 700
                                type: QtOpcUa.Constants.UInt16
                 }
            }
        ]
    }
}

2つの条件を含むより複雑な例については、QOpcUaElementOperand を参照してください。

FilterElementも参照してください 。

プロパティのドキュメント

select : list<SimpleAttributeOperand>

新しいイベントを報告する際に含めるべき、選択されたイベントフィールド。

where : list<FilterElement>

報告されたイベントを特定の条件に合致するものに限定するために使用されるコンテンツフィルター。

© 2026 The Qt Company Ltd. Documentation contributions included herein are the copyrights of their respective owners. The documentation provided herein is licensed under the terms of the GNU Free Documentation License version 1.3 as published by the Free Software Foundation. Qt and respective logos are trademarks of The Qt Company Ltd. in Finland and/or other countries worldwide. All other trademarks are property of their respective owners.