ronnie
2022-10-14 1504bb53e29d3d46222c0b3ea994fc494b48e153
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
<?xml version="1.0"?>
<def>
 
  <markup ext=".qml" reporterrors="false" aftercode="true">
 
    <!-- keywords in QML code to ignore -->
    <keywords>
      <keyword name="if"/>
      <keyword name="while"/>
      <keyword name="typeof"/>
      <keyword name="for"/>
    </keywords>
 
    <!-- code blocks are meta-code/pseudo code placed in the library
         that is used/called by the native c/c++ code -->
    <codeblocks>
      <!-- need to add all the QML function names below -->
      <block name="onClicked"/>
      <block name="onFinished"/>
      <block name="onTriggered"/>
      <block name="onRetrieveTriggered"/>
      <block name="onPressed"/>
      <block name="onTouch"/>
      <block name="onFocusedChanged"/>
      <block name="onSubmittedNewStatusChanged"/>
      <block name="onCreationCompleted"/>
      <block name="onFileSelected"/>
      <!-- code block structure in QML is:
            onClicked: {
              call(var)
            } -->
      <structure offset="3" start="{" end="}"/>
      <!-- the start block is '3' tokens after the
           name token so we skip them -->
    </codeblocks>
 
    <codeblocks>
      <block name="function"/>
      <!-- code block structure in QML is:
            funnction x(args): {
              call(var)
            } -->
      <structure offset="2" start="{" end="}"/>
    </codeblocks>
 
    <!-- Qt Properties have the format :
           Q_PROPERTY(<type> <name> READ <func> WRITE <func> NOTIFY <func>)
           the READ/WRITE/NOTIFY parts are optional -->
    <exported>
      <exporter prefix="Q_PROPERTY">
        <suffix>READ</suffix> <!-- catch the element before READ if present -->
        <prefix>READ</prefix>
        <prefix>WRITE</prefix>
        <prefix>NOTIFY</prefix>
      </exporter>
    </exported>
 
    <!-- qml files can call connect on the c++ code -->
    <imported>
      <importer>connect</importer>
    </imported>
  </markup>
 
  <!-- qt can call methods as strings using invokeMethod -->
  <reflection>
    <call arg="2">invokeMethod</call>
  </reflection>
 
  <!-- the SLOT/SIGNAL methods can be cause false-positives for pure
  virtual functions being called in the constructor because it sees
  the macro as a function. -->
  <function name="SLOT">
    <ignorefunction>true</ignorefunction>
  </function>
  <function name="SIGNAL">
    <ignorefunction>true</ignorefunction>
  </function>
</def>