Compare commits

..

25 Commits

Author SHA1 Message Date
20a8cbaf85 以/utf-8编译选项,导致的编码问题,修正。 2025-04-14 13:49:48 +08:00
ba08530203 add:添加历史可以双击选取。 2025-04-03 14:55:22 +08:00
c2c3f6f2ca add:添加可以不用重启切换配置文件重新加载。 2025-04-03 14:51:18 +08:00
2451ae76be fix:修正配置删除不完全问题。 2025-04-03 13:39:36 +08:00
4db3a6b202 script: add build shell script 2025-02-23 17:33:45 -08:00
0974d492af config:配置修改。 2025-01-17 10:44:17 +08:00
99b558b90d change:windows下主题改为windows。 2024-10-06 22:43:49 +08:00
39d4c8d307 config:最大列宽限制改成2000上限。 2024-09-18 16:15:37 +08:00
0e9b59b4ed add:添加override 2024-09-16 08:32:20 +08:00
1902e9d6ab theme:设置为默认主题。 2024-09-15 15:22:06 +08:00
693a371e0d change:格式化xml单元设定一个窗口,可以选择性格式化哪些具体内容。 2024-09-15 15:08:32 +08:00
0f65ef220a pro:优化按钮是否可用显示,外置重排序为单独的功能,不能自动备份。 2024-09-14 10:13:13 +08:00
c167e01843 fix:修正空白宽度添加参数设置不生效问题。 2024-09-14 09:52:45 +08:00
27993d9cce style:改回windows风格。 2024-09-14 09:38:05 +08:00
e1ef813032 add:添加文件路径支持拖入。 2024-09-14 09:35:13 +08:00
2bfddf1ef7 compile:一些基本编译配置修改。 2024-09-14 09:08:24 +08:00
6896fa5090 new-feature:1.添加带表达式内容的xml格式化。2.支持带特殊字符的读写,如& < > "。 2024-09-14 00:02:48 +08:00
bb511d1bac change:添加导入时根据搜索key刷新,添加同结构xml文件加载时禁用排序。 2024-08-28 10:03:47 +08:00
49c4a40dc9 fix:修正界面更新逻辑问题。 2024-08-28 09:35:45 +08:00
f9796c7090 fix:1.修正同结构导入问题。2.历史界面添加删除。3.导入排序问题。 2024-08-28 08:42:45 +08:00
f2b1525b92 fix:v1.3.1修复BUG。 2024-08-27 20:15:41 +08:00
b05783191f big-change:添加两种类型结构读写支持 2024-08-27 17:30:48 +08:00
ff68e756ff compile:修正编译Qt目录获取位置 2024-08-20 16:57:23 +08:00
87625e8bc4 change:更改以key的前些部分排序而不是全部。 2024-08-20 16:47:09 +08:00
7a1bee6708 theme:默认flatgray主题。 2024-08-08 17:05:57 +08:00
37 changed files with 1904 additions and 2034 deletions

View File

@ -1,38 +1,17 @@
# .clang-format
# 风格格式化
BasedOnStyle: LLVM
# 4 空格缩进
IndentWidth: 4
# 连续对齐变量的声明
AlignConsecutiveDeclarations: true
# 指针左侧对齐
PointerAlignment: Left
# 访问说明符(public、private等)的偏移
BasedOnStyle: Google
IndentWidth: 4
PointerAlignment: Left
AccessModifierOffset: -4
# 大括号
BreakBeforeBraces: Custom
BraceWrapping:
# 函数定义后面大括号在新行
AfterFunction: true
# class定义后面
AfterClass: true
# 去除C++11的列表初始化的大括号{后和}前的空格
Cpp11BracedListStyle: true
# 允许重新排版注释
ReflowComments: true
# 允许排序#include
SortIncludes: false
# 在尾随的评论前添加的空格数(只适用于//)
SpacesBeforeTrailingComments: 3
# tab宽度
TabWidth: 4
# 构造函数的初始化列表要么都在同一行,要么都各自一行
ConstructorInitializerAllOnOneLineOrOnePerLine: true
# 每行字符的限制,0表示没有限制
ColumnLimit: 110
# 允许短的块放在同一行
AllowShortBlocksOnASingleLine: false
# 是否允许短函数在一行
AllowShortFunctionsOnASingleLine: InlineOnly
ColumnLimit: 130
AllowShortBlocksOnASingleLine: Never
AllowShortFunctionsOnASingleLine: None
AllowShortEnumsOnASingleLine: false

814
.vscode/qt5.natvis vendored
View File

@ -1,814 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--************************************************************************************************
Copyright (C) 2023 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
*************************************************************************************************-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="QUuid">
<DisplayString>{{{data1,Xb}-{data2,Xb}-{data3,Xb}-{(data4[0]),nvoXb}{(data4[1]),nvoXb}-{(data4[2]),nvoXb}{(data4[3]),nvoXb}{(data4[4]),nvoXb}{(data4[5]),nvoXb}{(data4[6]),nvoXb}{(data4[7]),nvoXb}}}</DisplayString>
</Type>
<Type Name="QPoint">
<AlternativeType Name="QPointF"/>
<DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
</Expand>
</Type>
<Type Name="QRect">
<DisplayString>{{ x = {x1}, y = {y1}, width = {x2 - x1 + 1}, height = {y2 - y1 + 1} }}</DisplayString>
<Expand>
<Item Name="[x]">x1</Item>
<Item Name="[y]">y1</Item>
<Item Name="[width]">x2 - x1 + 1</Item>
<Item Name="[height]">y2 - y1 + 1</Item>
</Expand>
</Type>
<Type Name="QRectF">
<DisplayString>{{ x = {xp}, y = {yp}, width = {w}, height = {h} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
<Item Name="[width]">w</Item>
<Item Name="[height]">h</Item>
</Expand>
</Type>
<Type Name="QSize">
<AlternativeType Name="QSizeF"/>
<DisplayString>{{ width = {wd}, height = {ht} }}</DisplayString>
<Expand>
<Item Name="[width]">wd</Item>
<Item Name="[height]">ht</Item>
</Expand>
</Type>
<Type Name="QLine">
<AlternativeType Name="QLineF"/>
<DisplayString>{{ start point = {pt1}, end point = {pt2} }}</DisplayString>
<Expand>
<Synthetic Name="[start point]">
<DisplayString>{pt1}</DisplayString>
<Expand>
<ExpandedItem>pt1</ExpandedItem>
</Expand>
</Synthetic>
<Synthetic Name="[end point]">
<DisplayString>{pt2}</DisplayString>
<Expand>
<ExpandedItem>pt2</ExpandedItem>
</Expand>
</Synthetic>
</Expand>
</Type>
<Type Name="QPolygon">
<DisplayString>{{ size = {d-&gt;size} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<ArrayItems>
<Size>d-&gt;size</Size>
<ValuePointer>(QPoint*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QPolygonF">
<DisplayString>{{ size = {d-&gt;size} }}</DisplayString>
<Expand>
<Item Name="[closed]">
d-&gt;size &gt; 0
&amp;&amp; ((((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[0]).xp
== (((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[d-&gt;size - 1]).xp)
&amp;&amp; ((((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[0]).yp
== (((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[d-&gt;size - 1]).yp)
</Item>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<ArrayItems>
<Size>d-&gt;size</Size>
<ValuePointer>(QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name ="QVector2D">
<DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
</Expand>
</Type>
<Type Name ="QVector3D">
<DisplayString>{{ x = {xp}, y = {yp}, z = {zp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
<Item Name="[z]">zp</Item>
</Expand>
</Type>
<Type Name ="QVector4D">
<DisplayString>{{ x = {xp}, y = {yp}, z = {zp}, w = {wp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
<Item Name="[z]">zp</Item>
<Item Name="[w]">wp</Item>
</Expand>
</Type>
<Type Name ="QMatrix">
<DisplayString>
{{ m11 = {_m11}, m12 = {_m12}, m21 = {_m21}, m22 = {_m22}, ... }}
</DisplayString>
<Expand>
<Item Name="[m11]">_m11</Item>
<Item Name="[m12]">_m12</Item>
<Item Name="[m21]">_m21</Item>
<Item Name="[m22]">_m22</Item>
<Item Name="[dx]">_dx</Item>
<Item Name="[dy]">_dy</Item>
</Expand>
</Type>
<Type Name ="QMatrix4x4">
<DisplayString>
{{ m11 = {m[0][0]}, m12 = {m[1][0]}, m13 = {m[2][0]}, m14 = {m[3][0]}, ... }}
</DisplayString>
<Expand>
<Item Name="[m11]">m[0][0]</Item>
<Item Name="[m12]">m[1][0]</Item>
<Item Name="[m13]">m[2][0]</Item>
<Item Name="[m14]">m[3][0]</Item>
<Item Name="[m21]">m[0][1]</Item>
<Item Name="[m22]">m[1][1]</Item>
<Item Name="[m23]">m[2][1]</Item>
<Item Name="[m24]">m[3][1]</Item>
<Item Name="[m31]">m[0][2]</Item>
<Item Name="[m32]">m[1][2]</Item>
<Item Name="[m33]">m[2][2]</Item>
<Item Name="[m34]">m[3][2]</Item>
<Item Name="[m41]">m[0][3]</Item>
<Item Name="[m42]">m[1][3]</Item>
<Item Name="[m43]">m[2][3]</Item>
<Item Name="[m44]">m[3][3]</Item>
</Expand>
</Type>
<Type Name="QSizePolicy">
<DisplayString>
{{ horizontal = {static_cast&lt;Policy&gt;(bits.horPolicy)}, vertical = {static_cast&lt;Policy&gt;(bits.verPolicy)}, type = {ControlType(1 &lt;&lt; bits.ctype)} }}
</DisplayString>
<Expand>
<Synthetic Name="[vertical policy]">
<DisplayString>QSizePolicy::Policy::{static_cast&lt;Policy&gt;(bits.verPolicy)}</DisplayString>
</Synthetic>
<Synthetic Name="[horizontal policy]">
<DisplayString>QSizePolicy::Policy::{static_cast&lt;Policy&gt;(bits.horPolicy)}</DisplayString>
</Synthetic>
<Synthetic Name="[control type]">
<DisplayString>QSizePolicy::ControlType::{ControlType(1 &lt;&lt; bits.ctype)}</DisplayString>
</Synthetic>
<Synthetic Name="[expanding directions]">
<DisplayString
Condition="(static_cast&lt;Policy&gt;(bits.verPolicy) &amp; ExpandFlag)">
Qt::Vertical (2)
</DisplayString>
<DisplayString
Condition="(static_cast&lt;Policy&gt;(bits.horPolicy) &amp; ExpandFlag)">
Qt::Horizontal (1)
</DisplayString>
</Synthetic>
<Item Name="[vertical stretch]">static_cast&lt;int&gt;(bits.verStretch)</Item>
<Item Name="[horizontal stretch]">static_cast&lt;int&gt;(bits.horStretch)</Item>
<Item Name="[has height for width]">bits.hfw == 1</Item>
<Item Name="[has width for height]">bits.wfh == 1</Item>
</Expand>
</Type>
<Type Name="QChar">
<DisplayString>{ucs,c}</DisplayString>
<StringView>ucs,c</StringView>
<Expand>
<Item Name="[latin 1]">ucs > 0xff ? '\0' : char(ucs),c</Item>
<Item Name="[unicode]">ucs,c</Item>
</Expand>
</Type>
<Type Name="QString">
<DisplayString>{((reinterpret_cast&lt;unsigned short*&gt;(d)) + d-&gt;offset / 2),sub}</DisplayString>
<StringView>((reinterpret_cast&lt;unsigned short*&gt;(d)) + d-&gt;offset / 2),sub</StringView>
<Expand>
<Item Name="[size]">d-&gt;size</Item>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<ArrayItems>
<Size>d-&gt;size</Size>
<ValuePointer>((reinterpret_cast&lt;unsigned short*&gt;(d)) + d-&gt;offset / 2),c</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QStringRef">
<Intrinsic Name="offset" Expression="(reinterpret_cast&lt;char16_t*&gt;(m_string-&gt;d))
+ m_string-&gt;d->offset / 2" />
<DisplayString Condition="m_string == nullptr">{m_string,[m_size]} u""</DisplayString>
<DisplayString Condition="m_string != nullptr">{offset() + m_position,[m_size]}</DisplayString>
<Expand>
<Item Name="[position]" ExcludeView="simple">m_position</Item>
<Item Name="[size]" ExcludeView="simple">m_size</Item>
<ArrayItems Condition="m_string != nullptr">
<Size>m_size</Size>
<ValuePointer>offset()+m_position</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QStringView">
<DisplayString>{m_data,[m_size]}</DisplayString>
<StringView>m_data,[m_size]</StringView>
<Expand>
<Item Name="[size]" ExcludeView="simple">m_size</Item>
<ArrayItems>
<Size>m_size</Size>
<ValuePointer>m_data</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QByteArray">
<DisplayString>{((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset),sb}</DisplayString>
<StringView>((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset),sb</StringView>
<Expand>
<Item Name="[size]">d-&gt;size</Item>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<ArrayItems>
<Size>d-&gt;size</Size>
<ValuePointer>((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset),c</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QUrl">
<Intrinsic Name="isEmpty" Expression="size==0">
<Parameter Name="size" Type="int"/>
</Intrinsic>
<Intrinsic Name="memberOffset" Expression="sizeof(QAtomicInt) + sizeof(int) + (sizeof(QString) * count)">
<Parameter Name="count" Type="int"/>
</Intrinsic>
<Intrinsic Name="scheme" Expression="*((QString*)(((char*)(d) + memberOffset(0))))" />
<Intrinsic Name="username" Expression="*((QString*)(((char*)(d) + memberOffset(1))))" />
<Intrinsic Name="password" Expression="*((QString*)(((char*)(d) + memberOffset(2))))" />
<Intrinsic Name="host" Expression="*((QString*)(((char*)(d) + memberOffset(3))))" />
<Intrinsic Name="path" Expression="*((QString*)(((char*)(d) + memberOffset(4))))" />
<Intrinsic Name="query" Expression="*((QString*)(((char*)(d) + memberOffset(5))))" />
<Intrinsic Name="fragment" Expression="*((QString*)(((char*)(d) + memberOffset(6))))" />
<DisplayString Condition="!isEmpty(scheme().d-&gt;size)">{scheme()}://{host()}{path()}</DisplayString>
<DisplayString Condition="isEmpty(scheme().d-&gt;size)">{path()}</DisplayString>
<Expand>
<Item Name="[scheme]">scheme()</Item>
<Item Name="[username]">username()</Item>
<Item Name="[password]">password()</Item>
<Item Name="[host]">host()</Item>
<Item Name="[path]">path()</Item>
<Item Name="[query]">query()</Item>
<Item Name="[fragment]">fragment()</Item>
</Expand>
</Type>
<Type Name="QBitArray">
<DisplayString>{{ size = {(d.d-&gt;size &lt;&lt; 3) - *((reinterpret_cast&lt;char*&gt;(d.d)) + d.d-&gt;offset)} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d.d-&gt;ref.atomic._q_value</Item>
<IndexListItems>
<Size>(d.d-&gt;size &lt;&lt; 3) - *((reinterpret_cast&lt;char*&gt;(d.d)) + d.d-&gt;offset)</Size>
<ValueNode>
(*(reinterpret_cast&lt;const unsigned char*&gt;((reinterpret_cast&lt;char*&gt;(d.d)) + d.d-&gt;offset) + 1
+ ($i &gt;&gt; 3)) &amp; (1 &lt;&lt; ($i &amp; 7))) != 0
</ValueNode>
</IndexListItems>
</Expand>
</Type>
<Type Name="QVarLengthArray&lt;*&gt;">
<AlternativeType Name="QVarLengthArray&lt;*, int&gt;"/>
<DisplayString>{{ size = {s} }}</DisplayString>
<Expand>
<Item Name="[capacity]">a</Item>
<ArrayItems>
<Size>s</Size>
<ValuePointer>ptr</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QDate">
<DisplayString>{{ julian day = {jd} }}</DisplayString>
<Expand></Expand>
</Type>
<Type Name="QTime">
<DisplayString
Condition="mds == 1">{{ millisecond = {mds} }}</DisplayString>
<DisplayString
Condition="mds != 1">{{ milliseconds = {mds} }}</DisplayString>
<Expand>
<Item Name="[hour]"
Condition="(mds / 3600000) == 1">mds / 3600000, d</Item>
<Item Name="[hours]"
Condition="(mds / 3600000) != 1">mds / 3600000, d</Item>
<Item Name="[minute]"
Condition="((mds % 3600000) / 60000) == 1">(mds % 3600000) / 60000, d</Item>
<Item Name="[minutes]"
Condition="((mds % 3600000) / 60000) != 1">(mds % 3600000) / 60000, d</Item>
<Item Name="[second]"
Condition="((mds / 1000) % 60) == 1">(mds / 1000) % 60, d</Item>
<Item Name="[seconds]"
Condition="((mds / 1000) % 60) != 1">(mds / 1000) % 60, d</Item>
<Item Name="[millisecond]"
Condition="(mds % 1000) == 1">mds % 1000, d</Item>
<Item Name="[milliseconds]"
Condition="(mds % 1000) != 1">mds % 1000, d</Item>
</Expand>
</Type>
<Type Name="QRegularExpression">
<DisplayString>{d.pattern}</DisplayString>
</Type>
<Type Name="QSharedData">
<Expand>
<Item Name="[referenced]">ref._q_value</Item>
</Expand>
</Type>
<Type Name="QSharedPointer&lt;*&gt;">
<DisplayString>strong reference to shared pointer of type {"$T1"}</DisplayString>
<Expand>
<Item Name="[is null]">value == 0</Item>
<Item Name="[weak referenced]">d-&gt;weakref._q_value</Item>
<Item Name="[strong referenced]">d-&gt;strongref._q_value</Item>
</Expand>
</Type>
<Type Name="QSharedDataPointer&lt;*&gt;">
<DisplayString>pointer to implicit shared object of type {"$T1"}</DisplayString>
<Expand>
<ExpandedItem>d</ExpandedItem>
</Expand>
</Type>
<Type Name="QExplicitlySharedDataPointer&lt;*&gt;">
<DisplayString>pointer to explicit shared object of type {"$T1"}</DisplayString>
<Expand>
<ExpandedItem>d</ExpandedItem>
</Expand>
</Type>
<Type Name="QPointer&lt;*&gt;">
<DisplayString>guarded pointer to subclass of QObject of type {"$T1"}</DisplayString>
<Expand>
<Item Name="[is null]">wp.d == 0 || wp.d-&gt;strongref._q_value == 0 || wp.value == 0</Item>
</Expand>
</Type>
<Type Name="QWeakPointer&lt;*&gt;">
<DisplayString>weak reference to shared pointer of type {"$T1"}</DisplayString>
<Expand>
<Item Name="[is null]">d == 0 || d-&gt;strongref._q_value == 0 || value == 0</Item>
<Item Name="[weak referenced]">d-&gt;weakref._q_value</Item>
<Item Name="[strong referenced]">d-&gt;strongref._q_value</Item>
</Expand>
</Type>
<Type Name="QScopedPointer&lt;*&gt;">
<DisplayString>scoped pointer to a dynamically allocated object of type {"$T1"}</DisplayString>
<Expand>
<Item Name="[is null]">!d</Item>
</Expand>
</Type>
<Type Name="QScopedArrayPointer&lt;*&gt;">
<DisplayString>scoped pointer to dynamically allocated array of objects of type {"$T1"}</DisplayString>
<Expand>
<Item Name="[is null]">!d</Item>
</Expand>
</Type>
<Type Name="QPair&lt;*,*&gt;">
<DisplayString>({first}, {second})</DisplayString>
<Expand>
<Item Name="[first]">first</Item>
<Item Name="[second]">second</Item>
</Expand>
</Type>
<Type Name="QVector&lt;*&gt;">
<AlternativeType Name="QStack&lt;*&gt;"></AlternativeType>
<DisplayString>{{ size = {d-&gt;size} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<ArrayItems>
<Size>d-&gt;size</Size>
<ValuePointer>($T1*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QList&lt;*&gt;">
<AlternativeType Name="QQueue&lt;*&gt;"></AlternativeType>
<DisplayString>{{ size = {d-&gt;end - d-&gt;begin} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<IndexListItems>
<Size>d-&gt;end - d-&gt;begin</Size>
<ValueNode>*reinterpret_cast&lt;$T1*&gt;((sizeof($T1) &gt; sizeof(void*))
? reinterpret_cast&lt;Node*&gt;(d-&gt;array + d-&gt;begin + $i)-&gt;v
: reinterpret_cast&lt;$T1*&gt;(d-&gt;array + d-&gt;begin + $i))
</ValueNode>
</IndexListItems>
</Expand>
</Type>
<Type Name="QStringList">
<DisplayString>{{ size = {d-&gt;end - d-&gt;begin} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<IndexListItems>
<Size>d-&gt;end - d-&gt;begin</Size>
<ValueNode>
*reinterpret_cast&lt;QString*&gt;((sizeof(QString) &gt; sizeof(void*))
? reinterpret_cast&lt;Node*&gt;(d-&gt;array + d-&gt;begin + $i)-&gt;v
: reinterpret_cast&lt;QString*&gt;(d-&gt;array + d-&gt;begin + $i))
</ValueNode>
</IndexListItems>
</Expand>
</Type>
<Type Name="QList&lt;QVariant&gt;">
<DisplayString>{{ size = {d-&gt;end - d-&gt;begin} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<IndexListItems>
<Size>d-&gt;end - d-&gt;begin</Size>
<ValueNode>
*reinterpret_cast&lt;QVariant*&gt;((sizeof(QVariant) &gt; sizeof(void*))
? reinterpret_cast&lt;Node*&gt;(d-&gt;array + d-&gt;begin + $i)-&gt;v
: reinterpret_cast&lt;QVariant*&gt;(d-&gt;array + d-&gt;begin + $i))
</ValueNode>
</IndexListItems>
</Expand>
</Type>
<Type Name="QLinkedList&lt;*&gt;">
<DisplayString>{{ size = {d-&gt;size} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<LinkedListItems>
<Size>d-&gt;size</Size>
<HeadPointer>d-&gt;n</HeadPointer>
<NextPointer>n</NextPointer>
<ValueNode>(*(QLinkedListNode&lt;$T1&gt;*)this).t</ValueNode>
</LinkedListItems>
</Expand>
</Type>
<Type Name="QMapNode&lt;*,*&gt;">
<DisplayString>({key}, {value})</DisplayString>
<Expand>
<Item Name="[key]">key</Item>
<Item Name="[value]">value</Item>
</Expand>
</Type>
<Type Name="QMap&lt;*,*&gt;">
<AlternativeType Name="QMultiMap&lt;*,*&gt;"/>
<DisplayString>{{ size = {d-&gt;size} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<TreeItems>
<Size>d-&gt;size</Size>
<HeadPointer>d-&gt;header.left</HeadPointer>
<LeftPointer>left</LeftPointer>
<RightPointer>right</RightPointer>
<ValueNode>*((QMapNode&lt;$T1,$T2&gt;*)this)</ValueNode>
</TreeItems>
</Expand>
</Type>
<Type Name="QHashNode&lt;*,*&gt;">
<DisplayString Condition="next == 0">(empty)</DisplayString>
<DisplayString Condition="next != 0">({key}, {value})</DisplayString>
<Expand>
<Item Name="[key]" Condition="next != 0">key</Item>
<Item Name="[value]" Condition="next != 0">value</Item>
<Item Name="[next]" Condition="next != 0">next</Item>
</Expand>
</Type>
<Type Name="QHash&lt;*,*&gt;">
<AlternativeType Name="QMultiHash&lt;*,*&gt;"/>
<DisplayString>{{ size = {d-&gt;size} }}</DisplayString>
<Expand>
<ArrayItems IncludeView="buckets">
<Size>d-&gt;numBuckets</Size>
<ValuePointer>reinterpret_cast&lt;Node **&gt;(d-&gt;buckets)</ValuePointer>
</ArrayItems>
<CustomListItems ExcludeView="buckets">
<Variable Name="n" InitialValue="d-&gt;numBuckets"/>
<Variable Name="bucket" InitialValue="d-&gt;buckets"/>
<Variable Name="node" InitialValue="d-&gt;buckets[0]"/>
<Variable Name="keyValuePair" InitialValue="reinterpret_cast&lt;Node *&gt;(0)"/>
<Size>d-&gt;size</Size>
<Loop>
<Break Condition="n == 0"/>
<Exec>node = *(bucket++)</Exec>
<Exec>--n</Exec>
<Loop>
<Break Condition="!node || !node-&gt;next"/>
<Exec>keyValuePair = reinterpret_cast&lt;Node *&gt;(node)</Exec>
<Item Name="[{keyValuePair-&gt;key}]">keyValuePair-&gt;value</Item>
<Exec>node = node-&gt;next</Exec>
</Loop>
</Loop>
</CustomListItems>
</Expand>
</Type>
<Type Name="QHashNode&lt;*,QHashDummyValue&gt;">
<DisplayString Condition="next == 0">(empty)</DisplayString>
<DisplayString Condition="next != 0">({key})</DisplayString>
<Expand>
<Item Name="[key]" Condition="next != 0">key</Item>
</Expand>
</Type>
<Type Name="QSet&lt;*&gt;">
<DisplayString>{{ size = {q_hash.d-&gt;size} }}</DisplayString>
<Expand>
<ExpandedItem>q_hash</ExpandedItem>
</Expand>
</Type>
<Type Name="QCache&lt;*,*&gt;::Node">
<DisplayString>({*keyPtr}, {*t})</DisplayString>
<Expand>
<Item Name="[key]">*keyPtr</Item>
<Item Name="[value]">*t</Item>
</Expand>
</Type>
<Type Name="QCache&lt;*,*&gt;">
<DisplayString>{{ size = {hash.d-&gt;size} }}</DisplayString>
<Expand>
<Item Name="[max coast]">mx</Item>
<Item Name="[total coast]">total</Item>
<Item Name="[referenced]">hash.d-&gt;ref.atomic._q_value</Item>
<LinkedListItems>
<Size>hash.d-&gt;size</Size>
<HeadPointer>f</HeadPointer>
<NextPointer>n</NextPointer>
<ValueNode>*((Node*)this)</ValueNode>
</LinkedListItems>
</Expand>
</Type>
<Type Name="QStandardItemPrivate">
<Intrinsic Name="memberOffset" Expression="sizeof(QStandardItemModel *)
+ sizeof(QStandardItem *)
+ sizeof(int *)
+ sizeof(int *)
+ (sizeof(int) * count)">
<Parameter Name="count" Type="int"/>
</Intrinsic>
<Intrinsic Name="rows" Expression="*((int*)(((char*)(this)) + memberOffset(0)))" />
<Intrinsic Name="columns" Expression="*((int*)(((char*)(this)) + memberOffset(1)))" />
</Type>
<Type Name="QStandardItem">
<DisplayString>{{ row count = {(*d_ptr.d).rows()}, column count = {(*d_ptr.d).columns()} }}</DisplayString>
<Expand>
<Item Name="[d]">d_ptr.d,!</Item>
<Item Name="[row count]">(*d_ptr.d).rows()</Item>
<Item Name="[column count]">(*d_ptr.d).columns()</Item>
</Expand>
</Type>
<Type Name="QVariant">
<!--Region DisplayString QVariant-->
<DisplayString Condition="d.type == QMetaType::UnknownType">Invalid</DisplayString>
<DisplayString Condition="d.type == QMetaType::Bool">{d.data.b}</DisplayString>
<DisplayString Condition="d.type == QMetaType::Int">{d.data.i}</DisplayString>
<DisplayString Condition="d.type == QMetaType::UInt">{d.data.u}</DisplayString>
<DisplayString Condition="d.type == QMetaType::LongLong">{d.data.ll}</DisplayString>
<DisplayString Condition="d.type == QMetaType::ULongLong">{d.data.ull}</DisplayString>
<DisplayString Condition="d.type == QMetaType::Double">{d.data.d}</DisplayString>
<DisplayString Condition="d.type == QMetaType::QChar">{d.data.c}</DisplayString>
<DisplayString Condition="d.type == QMetaType::QVariantMap">
{*((QMap&lt;QString,QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QVariantList">
{*((QList&lt;QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QString">
{*((QString*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QStringList">
{*((QStringList*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QByteArray">
{*((QByteArray*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QBitArray">
{*((QBitArray*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QDate">
{*((QDate*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QTime">
{*((QTime*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QDateTime">DateTime</DisplayString>
<DisplayString Condition="d.type == QMetaType::QUrl">Url</DisplayString>
<DisplayString Condition="d.type == QMetaType::QLocale">Locale</DisplayString>
<DisplayString Condition="d.type == QMetaType::QRect">
{*((QRect*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QRectF">
{*((QRectF*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QSize">
{*((QSize*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QSizeF">
{*((QSizeF*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QLine">
{*((QLine*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QLineF">
{*((QLineF*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QPoint">
{*((QPoint*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QPointF">
{*((QPointF*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QRegExp">RegExp</DisplayString>
<DisplayString Condition="d.type == QMetaType::QRegularExpression">RegularExpression</DisplayString>
<DisplayString Condition="d.type == QMetaType::QVariantHash">
{*((QHash&lt;QString,QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))}
</DisplayString>
<DisplayString Condition="d.type == QMetaType::QEasingCurve">EasingCurve</DisplayString>
<DisplayString Condition="d.type == QMetaType::QUuid">Uuid</DisplayString>
<DisplayString Condition="d.type == QMetaType::QModelIndex">ModelIndex</DisplayString>
<DisplayString Condition="d.type == QMetaType::LastCoreType">LastCoreType</DisplayString>
<DisplayString Condition="d.type == QMetaType::QFont">Font</DisplayString>
<DisplayString Condition="d.type == QMetaType::QPixmap">Pixmap</DisplayString>
<DisplayString Condition="d.type == QMetaType::QBrush">Brush</DisplayString>
<DisplayString Condition="d.type == QMetaType::QColor">Color</DisplayString>
<DisplayString Condition="d.type == QMetaType::QPalette">Palette</DisplayString>
<DisplayString Condition="d.type == QMetaType::QImage">Image</DisplayString>
<DisplayString Condition="d.type == QMetaType::QPolygon">Polygon</DisplayString>
<DisplayString Condition="d.type == QMetaType::QRegion">Region</DisplayString>
<DisplayString Condition="d.type == QMetaType::QBitmap">Bitmap</DisplayString>
<DisplayString Condition="d.type == QMetaType::QCursor">Cursor</DisplayString>
<DisplayString Condition="d.type == QMetaType::QKeySequence">KeySequence</DisplayString>
<DisplayString Condition="d.type == QMetaType::QPen">Pen</DisplayString>
<DisplayString Condition="d.type == QMetaType::QTextLength">TextLength</DisplayString>
<DisplayString Condition="d.type == QMetaType::QTextFormat">TextFormat</DisplayString>
<DisplayString Condition="d.type == QMetaType::QMatrix">Matrix</DisplayString>
<DisplayString Condition="d.type == QMetaType::QTransform">Transform</DisplayString>
<DisplayString Condition="d.type == QMetaType::QMatrix4x4">Matrix4x4</DisplayString>
<DisplayString Condition="d.type == QMetaType::QVector2D">Vector2D</DisplayString>
<DisplayString Condition="d.type == QMetaType::QVector3D">Vector3D</DisplayString>
<DisplayString Condition="d.type == QMetaType::QVector4D">Vector4D</DisplayString>
<DisplayString Condition="d.type == QMetaType::QQuaternion">Quaternion</DisplayString>
<DisplayString Condition="d.type == QMetaType::QPolygonF">PolygonF</DisplayString>
<DisplayString Condition="d.type == QMetaType::QIcon">Icon</DisplayString>
<DisplayString Condition="d.type == QMetaType::LastGuiType">LastGuiType</DisplayString>
<DisplayString Condition="d.type == QMetaType::QSizePolicy">SizePolicy</DisplayString>
<DisplayString Condition="d.type == QMetaType::User">UserType</DisplayString>
<DisplayString Condition="d.type == 0xffffffff">LastType</DisplayString>
<!--End region DisplayString QVariant-->
<!--Region DisplayView QVariant-->
<StringView Condition="d.type == QMetaType::QChar">d.data.c</StringView>
<StringView Condition="d.type == QMetaType::QString">
*((QString*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</StringView>
<StringView Condition="d.type == QMetaType::QByteArray">
*((QByteArray*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</StringView>
<!--End region DisplayView QVariant-->
<!--Region Expand QVariant-->
<Expand>
<ExpandedItem Condition="d.type == QMetaType::QVariantMap">
*((QMap&lt;QString,QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QVariantList">
*((QList&lt;QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QString">
*((QString*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QStringList">
*((QStringList*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QByteArray">
*((QByteArray*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QBitArray">
*((QBitArray*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QDate">
*((QDate*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QTime">
*((QTime*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QRect">
*((QRect*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QRectF">
*((QRectF*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QSize">
*((QSize*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QSizeF">
*((QSizeF*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QLine">
*((QLine*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QLineF">
*((QLineF*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QPoint">
*((QPoint*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QPointF">
*((QPointF*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
<ExpandedItem Condition="d.type == QMetaType::QVariantHash">
*((QHash&lt;QString,QVariant&gt;*)(d.is_shared ? d.data.shared-&gt;ptr
: reinterpret_cast&lt;const void *&gt;(&amp;d.data.ptr)))
</ExpandedItem>
</Expand>
<!--End region Expand QVariant-->
</Type>
</AutoVisualizer>

735
.vscode/qt6.natvis vendored
View File

@ -1,735 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<!--************************************************************************************************
Copyright (C) 2023 The Qt Company Ltd.
SPDX-License-Identifier: LicenseRef-Qt-Commercial OR LGPL-3.0-only OR GPL-2.0-only OR GPL-3.0-only
*************************************************************************************************-->
<AutoVisualizer xmlns="http://schemas.microsoft.com/vstudio/debugger/natvis/2010">
<Type Name="QPropertyData&lt;*&gt;">
<DisplayString>{val}</DisplayString>
<Expand>
<Item Name="[value]">val</Item>
</Expand>
</Type>
<Type Name="QQuickItemPrivate">
<Intrinsic Name="_hasExtraData" Expression="extra.d.d != 0" />
<Intrinsic Name="_extraData" Expression="(*(ExtraData*)extra.d.d)" />
<Intrinsic Name="_objectName" Expression="(extraData-&gt;objectName).val.d.ptr" />
<DisplayString Condition="_hasExtraData()">{{ x = {x,g}, y = {y,g}, z = {_extraData().z,g}, width = {width,g}, height = {height,g} }}</DisplayString>
<DisplayString>{{ x = {x,g}, y = {y,g}, width = {width,g}, height = {height,g} }}</DisplayString>
<Expand>
<Item Name="x">x</Item>
<Item Name="y">y</Item>
<Item Name="z" Condition="_hasExtraData()">_extraData().z</Item>
<Item Name="scale" Condition="_hasExtraData()">_extraData().scale</Item>
<Item Name="rotation" Condition="_hasExtraData()">_extraData().rotation</Item>
<Item Name="opacity" Condition="_hasExtraData()">_extraData().opacity</Item>
<Item Name="width">width</Item>
<Item Name="height">height</Item>
<Item Name="implicitWidth">implicitWidth</Item>
<Item Name="implicitHeight">implicitHeight</Item>
<Item Name="visible">effectiveVisible</Item>
<Item Name="enabled">explicitEnable</Item>
<Item Name="objectName" Condition="_objectName() != 0">_objectName(),na</Item>
<Item Name="parentItem">parentItem</Item>
<Item Name="childItems">childItems, nr</Item>
</Expand>
</Type>
<Type Name="QQuickItem">
<DisplayString>{d_ptr.d,na}</DisplayString>
<Expand>
<ExpandedItem>d_ptr.d</ExpandedItem>
</Expand>
</Type>
<Type Name="QUuid">
<DisplayString>{{{data1,Xb}-{data2,Xb}-{data3,Xb}-{(data4[0]),nvoXb}{(data4[1]),nvoXb}-{(data4[2]),nvoXb}{(data4[3]),nvoXb}{(data4[4]),nvoXb}{(data4[5]),nvoXb}{(data4[6]),nvoXb}{(data4[7]),nvoXb}}}</DisplayString>
</Type>
<Type Name="QSpecialInteger&lt;*&gt;">
<DisplayString>{val}</DisplayString>
<Expand>
<Item Name="[value]">val</Item>
</Expand>
</Type>
<Type Name="QBasicAtomicInteger&lt;*&gt;">
<DisplayString>{_q_value}</DisplayString>
<Expand>
<Item Name="[value]">_q_value</Item>
</Expand>
</Type>
<Type Name="QBasicAtomicPointer&lt;*&gt;">
<Intrinsic Name="isNull" Expression="value()==0" />
<Intrinsic Name="value" Expression="_q_value.value()" />
<DisplayString Condition="isNull()">empty</DisplayString>
<DisplayString Condition="!isNull()">{_q_value}</DisplayString>
<Expand>
<Item Name=" " Condition="!isNull()">*value()</Item>
</Expand>
</Type>
<Type Name="QPoint">
<AlternativeType Name="QPointF"/>
<DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
</Expand>
</Type>
<Type Name="QRect">
<DisplayString>{{ x = {x1}, y = {y1}, width = {x2 - x1 + 1}, height = {y2 - y1 + 1} }}</DisplayString>
<Expand>
<Item Name="[x]">x1</Item>
<Item Name="[y]">y1</Item>
<Item Name="[width]">x2 - x1 + 1</Item>
<Item Name="[height]">y2 - y1 + 1</Item>
</Expand>
</Type>
<Type Name="QRectF">
<DisplayString>{{ x = {xp}, y = {yp}, width = {w}, height = {h} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
<Item Name="[width]">w</Item>
<Item Name="[height]">h</Item>
</Expand>
</Type>
<Type Name="QSize">
<AlternativeType Name="QSizeF"/>
<DisplayString>{{ width = {wd}, height = {ht} }}</DisplayString>
<Expand>
<Item Name="[width]">wd</Item>
<Item Name="[height]">ht</Item>
</Expand>
</Type>
<Type Name="QLine">
<AlternativeType Name="QLineF"/>
<DisplayString>{{ start point = {pt1}, end point = {pt2} }}</DisplayString>
<Expand>
<Synthetic Name="[start point]">
<DisplayString>{pt1}</DisplayString>
<Expand>
<ExpandedItem>pt1</ExpandedItem>
</Expand>
</Synthetic>
<Synthetic Name="[end point]">
<DisplayString>{pt2}</DisplayString>
<Expand>
<ExpandedItem>pt2</ExpandedItem>
</Expand>
</Synthetic>
</Expand>
</Type>
<Type Name="QPolygon">
<DisplayString>{{ size={d-&gt;size} }}</DisplayString>
<Expand>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<ArrayItems>
<Size>d-&gt;size</Size>
<ValuePointer>(QPoint*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QPolygonF">
<DisplayString>{{ size={d-&gt;size} }}</DisplayString>
<Expand>
<Item Name="[closed]">
d-&gt;size &gt; 0
&amp;&amp; ((((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[0]).xp
== (((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[d-&gt;size - 1]).xp)
&amp;&amp; ((((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[0]).yp
== (((QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)[d-&gt;size - 1]).yp)
</Item>
<Item Name="[referenced]">d-&gt;ref.atomic._q_value</Item>
<ArrayItems>
<Size>d-&gt;size</Size>
<ValuePointer>(QPointF*)((reinterpret_cast&lt;char*&gt;(d)) + d-&gt;offset)</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QVector2D">
<DisplayString>{{ x = {xp}, y = {yp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
</Expand>
</Type>
<Type Name="QVector3D">
<DisplayString>{{ x = {xp}, y = {yp}, z = {zp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
<Item Name="[z]">zp</Item>
</Expand>
</Type>
<Type Name="QVector4D">
<DisplayString>{{ x = {xp}, y = {yp}, z = {zp}, w = {wp} }}</DisplayString>
<Expand>
<Item Name="[x]">xp</Item>
<Item Name="[y]">yp</Item>
<Item Name="[z]">zp</Item>
<Item Name="[w]">wp</Item>
</Expand>
</Type>
<Type Name="QMatrix">
<DisplayString>
{{ m11 = {_m11}, m12 = {_m12}, m21 = {_m21}, m22 = {_m22}, ... }}
</DisplayString>
<Expand>
<Item Name="[m11]">_m11</Item>
<Item Name="[m12]">_m12</Item>
<Item Name="[m21]">_m21</Item>
<Item Name="[m22]">_m22</Item>
<Item Name="[dx]">_dx</Item>
<Item Name="[dy]">_dy</Item>
</Expand>
</Type>
<Type Name="QMatrix4x4">
<DisplayString>
{{ m11 = {m[0][0]}, m12 = {m[1][0]}, m13 = {m[2][0]}, m14 = {m[3][0]}, ... }}
</DisplayString>
<Expand>
<Item Name="[m11]">m[0][0]</Item>
<Item Name="[m12]">m[1][0]</Item>
<Item Name="[m13]">m[2][0]</Item>
<Item Name="[m14]">m[3][0]</Item>
<Item Name="[m21]">m[0][1]</Item>
<Item Name="[m22]">m[1][1]</Item>
<Item Name="[m23]">m[2][1]</Item>
<Item Name="[m24]">m[3][1]</Item>
<Item Name="[m31]">m[0][2]</Item>
<Item Name="[m32]">m[1][2]</Item>
<Item Name="[m33]">m[2][2]</Item>
<Item Name="[m34]">m[3][2]</Item>
<Item Name="[m41]">m[0][3]</Item>
<Item Name="[m42]">m[1][3]</Item>
<Item Name="[m43]">m[2][3]</Item>
<Item Name="[m44]">m[3][3]</Item>
</Expand>
</Type>
<Type Name="QSizePolicy">
<DisplayString>
{{ horizontal = {static_cast&lt;Policy&gt;(bits.horPolicy)}, vertical = {static_cast&lt;Policy&gt;(bits.verPolicy)}, type = {ControlType(1 &lt;&lt; bits.ctype)} }}
</DisplayString>
<Expand>
<Synthetic Name="[vertical policy]">
<DisplayString>QSizePolicy::Policy::{static_cast&lt;Policy&gt;(bits.verPolicy)}</DisplayString>
</Synthetic>
<Synthetic Name="[horizontal policy]">
<DisplayString>QSizePolicy::Policy::{static_cast&lt;Policy&gt;(bits.horPolicy)}</DisplayString>
</Synthetic>
<Synthetic Name="[control type]">
<DisplayString>QSizePolicy::ControlType::{ControlType(1 &lt;&lt; bits.ctype)}</DisplayString>
</Synthetic>
<Synthetic Name="[expanding directions]">
<DisplayString
Condition="(static_cast&lt;Policy&gt;(bits.verPolicy) &amp; ExpandFlag)">
Qt::Vertical (2)
</DisplayString>
<DisplayString
Condition="(static_cast&lt;Policy&gt;(bits.horPolicy) &amp; ExpandFlag)">
Qt::Horizontal (1)
</DisplayString>
</Synthetic>
<Item Name="[vertical stretch]">static_cast&lt;int&gt;(bits.verStretch)</Item>
<Item Name="[horizontal stretch]">static_cast&lt;int&gt;(bits.horStretch)</Item>
<Item Name="[has height for width]">bits.hfw == 1</Item>
<Item Name="[has width for height]">bits.wfh == 1</Item>
</Expand>
</Type>
<Type Name="QChar">
<DisplayString>{ucs,c}</DisplayString>
<StringView>ucs,c</StringView>
<Expand>
<Item Name="[latin 1]">ucs > 0xff ? '\0' : char(ucs),c</Item>
<Item Name="[unicode]">ucs,c</Item>
</Expand>
</Type>
<Type Name="QString">
<DisplayString>&quot;{(reinterpret_cast&lt;unsigned short*&gt;(d.ptr)),sub}&quot;</DisplayString>
<StringView>(reinterpret_cast&lt;unsigned short*&gt;(d.ptr)),sub</StringView>
<Expand>
<Item Name="[size]">d.size</Item>
<ArrayItems>
<Size>d.size</Size>
<ValuePointer>d.ptr</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QStringRef">
<DisplayString Condition="m_string == nullptr">{m_string,[m_size]} u""</DisplayString>
<DisplayString Condition="m_string != nullptr">{m_string-&gt;d.ptr+m_position,[m_size]}</DisplayString>
<StringView Condition="m_string == nullptr">""</StringView>
<StringView Condition="m_string != nullptr">m_string,[m_position+m_size]</StringView>
<Expand>
<Item Name="[position]" ExcludeView="simple">m_position</Item>
<Item Name="[size]" ExcludeView="simple">m_size</Item>
<ArrayItems Condition="m_string != nullptr">
<Size>m_size</Size>
<ValuePointer>m_string-&gt;d.ptr+m_position</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QStringView">
<DisplayString>{m_data,[m_size]}</DisplayString>
<StringView>m_data,[m_size]</StringView>
<Expand>
<Item Name="[size]" ExcludeView="simple">m_size</Item>
<ArrayItems>
<Size>m_size</Size>
<ValuePointer>m_data</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QByteArray">
<DisplayString>&quot;{((reinterpret_cast&lt;char*&gt;(d.ptr))),sb}&quot;</DisplayString>
<StringView>((reinterpret_cast&lt;char*&gt;(d.ptr))),sb</StringView>
<Expand>
<Item Name="[size]">d.size</Item>
<ArrayItems>
<Size>d.size</Size>
<ValuePointer>d.ptr</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QUrl">
<Intrinsic Name="isEmpty" Expression="size==0">
<Parameter Name="size" Type="int"/>
</Intrinsic>
<Intrinsic Name="memberOffset" Expression="sizeof(QAtomicInt) + sizeof(int) + (sizeof(QString) * count)">
<Parameter Name="count" Type="int"/>
</Intrinsic>
<Intrinsic Name="scheme" Expression="*((QString*)(((char*)(d) + memberOffset(0))))" />
<Intrinsic Name="username" Expression="*((QString*)(((char*)(d) + memberOffset(1))))" />
<Intrinsic Name="password" Expression="*((QString*)(((char*)(d) + memberOffset(2))))" />
<Intrinsic Name="host" Expression="*((QString*)(((char*)(d) + memberOffset(3))))" />
<Intrinsic Name="path" Expression="*((QString*)(((char*)(d) + memberOffset(4))))" />
<Intrinsic Name="query" Expression="*((QString*)(((char*)(d) + memberOffset(5))))" />
<Intrinsic Name="fragment" Expression="*((QString*)(((char*)(d) + memberOffset(6))))" />
<DisplayString Condition="!isEmpty(scheme().d-&gt;size)">{scheme()}://{host()}{path()}</DisplayString>
<DisplayString Condition="isEmpty(scheme().d-&gt;size)">{path()}</DisplayString>
<Expand>
<Item Name="[scheme]">scheme()</Item>
<Item Name="[username]">username()</Item>
<Item Name="[password]">password()</Item>
<Item Name="[host]">host()</Item>
<Item Name="[path]">path()</Item>
<Item Name="[query]">query()</Item>
<Item Name="[fragment]">fragment()</Item>
</Expand>
</Type>
<Type Name="QDate">
<DisplayString>{{ julian day = {jd} }}</DisplayString>
</Type>
<Type Name="QTime">
<Intrinsic Name="hour" Expression="mds / 3600000" />
<Intrinsic Name="minute" Expression="(mds % 3600000) / 60000" />
<Intrinsic Name="second" Expression="(mds / 1000) % 60" />
<Intrinsic Name="millisecond" Expression="mds % 1000" />
<DisplayString Condition="mds == 1">{{ millisecond = {mds} }}</DisplayString>
<DisplayString Condition="mds != 1">{{ milliseconds = {mds} }}</DisplayString>
<Expand>
<Item Name="[hour]"
Condition="(mds / 3600000) == 1">hour(), d</Item>
<Item Name="[hours]"
Condition="(mds / 3600000) != 1">hour(), d</Item>
<Item Name="[minute]"
Condition="((mds % 3600000) / 60000) == 1">minute(), d</Item>
<Item Name="[minutes]"
Condition="((mds % 3600000) / 60000) != 1">minute(), d</Item>
<Item Name="[second]"
Condition="((mds / 1000) % 60) == 1">second(), d</Item>
<Item Name="[seconds]"
Condition="((mds / 1000) % 60) != 1">second(), d</Item>
<Item Name="[millisecond]"
Condition="(mds % 1000) == 1">millisecond(), d</Item>
<Item Name="[milliseconds]"
Condition="(mds % 1000) != 1">millisecond(), d</Item>
</Expand>
</Type>
<Type Name="QPair&lt;*,*&gt;">
<DisplayString>({first}, {second})</DisplayString>
<Expand>
<Item Name="[first]">first</Item>
<Item Name="[second]">second</Item>
</Expand>
</Type>
<Type Name="QList&lt;*&gt;">
<AlternativeType Name="QVector&lt;*&gt;"/>
<DisplayString>{{ size={d.size} }}</DisplayString>
<Expand>
<ArrayItems>
<Size>d.size</Size>
<ValuePointer>reinterpret_cast&lt;$T1*&gt;(d.ptr)</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QVarLengthArray&lt;*&gt;">
<DisplayString>{{ size={s} }}</DisplayString>
<Expand>
<Item Name="[capacity]">a</Item>
<ArrayItems>
<Size>s</Size>
<ValuePointer>ptr</ValuePointer>
</ArrayItems>
</Expand>
</Type>
<Type Name="QMap&lt;*,*&gt;">
<AlternativeType Name="QMultiMap&lt;*,*&gt;"/>
<DisplayString>{{ size={d.d-&gt;m._Mypair._Myval2._Myval2._Mysize} }}</DisplayString>
<Expand>
<TreeItems>
<Size>d.d-&gt;m._Mypair._Myval2._Myval2._Mysize</Size>
<HeadPointer>d.d-&gt;m._Mypair._Myval2._Myval2._Myhead-&gt;_Parent</HeadPointer>
<LeftPointer>_Left</LeftPointer>
<RightPointer>_Right</RightPointer>
<ValueNode Condition="_Isnil == 0" Name="[{_Myval.first}]">_Myval,view(MapHelper)</ValueNode>
</TreeItems>
</Expand>
</Type>
<Type Name="std::pair&lt;*, *&gt;" IncludeView="MapHelper">
<DisplayString>{second}</DisplayString>
</Type>
<Type Name="QHashPrivate::Node&lt;*,*&gt;">
<DisplayString>{value}</DisplayString>
<Expand>
<Item Name="key">key</Item>
<Item Name="value">value</Item>
</Expand>
</Type>
<Type Name="QHashPrivate::MultiNode&lt;*,*&gt;">
<DisplayString Condition="value-&gt;next == 0">{value-&gt;value}</DisplayString>
<DisplayString Condition="value-&gt;next != 0 &amp;&amp; value-&gt;next-&gt;next == 0">({value-&gt;value}, {value-&gt;next-&gt;value})</DisplayString>
<DisplayString Condition="value-&gt;next != 0 &amp;&amp; value-&gt;next-&gt;next != 0">({value-&gt;value}, {value-&gt;next-&gt;value}, ...)</DisplayString>
<Expand>
<LinkedListItems>
<HeadPointer>value</HeadPointer>
<NextPointer>next</NextPointer>
<ValueNode>value</ValueNode>
</LinkedListItems>
</Expand>
</Type>
<Type Name="QHash&lt;*,*&gt;">
<AlternativeType Name="QMultiHash&lt;*,*&gt;"/>
<Intrinsic Name="getOffset" Category="Method" Expression="d-&gt;spans[span].offsets[offset]">
<Parameter Name="span" Type="int" />
<Parameter Name="offset" Type="int" />
</Intrinsic>
<Intrinsic Name="getKey" Category="Method" Expression="((Node*)(char *)&amp;(d-&gt;spans[span].entries[d-&gt;spans[span].offsets[offset]].storage))->key">
<Parameter Name="span" Type="int" />
<Parameter Name="offset" Type="int" />
</Intrinsic>
<Intrinsic Name="getNode" Category="Method" Expression="*((Node*)(char *)&amp;(d-&gt;spans[span].entries[d-&gt;spans[span].offsets[offset]].storage))">
<Parameter Name="span" Type="int" />
<Parameter Name="offset" Type="int" />
</Intrinsic>
<DisplayString>{{ size={d-&gt;size} }}</DisplayString>
<Expand>
<CustomListItems MaxItemsPerView="5000">
<Variable Name="iSpan" InitialValue="0" />
<Variable Name="spanCount" InitialValue="d-&gt;numBuckets" />
<Size>d-&gt;size</Size>
<Loop>
<If Condition="iSpan != spanCount">
<Item Name="[{getKey(iSpan, 0)}]" Condition="getOffset(iSpan, 0) != 255">getNode(iSpan, 0)</Item>
<Item Name="[{getKey(iSpan, 1)}]" Condition="getOffset(iSpan, 1) != 255">getNode(iSpan, 1)</Item>
<Item Name="[{getKey(iSpan, 2)}]" Condition="getOffset(iSpan, 2) != 255">getNode(iSpan, 2)</Item>
<Item Name="[{getKey(iSpan, 3)}]" Condition="getOffset(iSpan, 3) != 255">getNode(iSpan, 3)</Item>
<Item Name="[{getKey(iSpan, 4)}]" Condition="getOffset(iSpan, 4) != 255">getNode(iSpan, 4)</Item>
<Item Name="[{getKey(iSpan, 5)}]" Condition="getOffset(iSpan, 5) != 255">getNode(iSpan, 5)</Item>
<Item Name="[{getKey(iSpan, 6)}]" Condition="getOffset(iSpan, 6) != 255">getNode(iSpan, 6)</Item>
<Item Name="[{getKey(iSpan, 7)}]" Condition="getOffset(iSpan, 7) != 255">getNode(iSpan, 7)</Item>
<Item Name="[{getKey(iSpan, 8)}]" Condition="getOffset(iSpan, 8) != 255">getNode(iSpan, 8)</Item>
<Item Name="[{getKey(iSpan, 9)}]" Condition="getOffset(iSpan, 9) != 255">getNode(iSpan, 9)</Item>
<Item Name="[{getKey(iSpan, 10)}]" Condition="getOffset(iSpan, 10) != 255">getNode(iSpan, 10)</Item>
<Item Name="[{getKey(iSpan, 11)}]" Condition="getOffset(iSpan, 11) != 255">getNode(iSpan, 11)</Item>
<Item Name="[{getKey(iSpan, 12)}]" Condition="getOffset(iSpan, 12) != 255">getNode(iSpan, 12)</Item>
<Item Name="[{getKey(iSpan, 13)}]" Condition="getOffset(iSpan, 13) != 255">getNode(iSpan, 13)</Item>
<Item Name="[{getKey(iSpan, 14)}]" Condition="getOffset(iSpan, 14) != 255">getNode(iSpan, 14)</Item>
<Item Name="[{getKey(iSpan, 15)}]" Condition="getOffset(iSpan, 15) != 255">getNode(iSpan, 15)</Item>
<Item Name="[{getKey(iSpan, 16)}]" Condition="getOffset(iSpan, 16) != 255">getNode(iSpan, 16)</Item>
<Item Name="[{getKey(iSpan, 17)}]" Condition="getOffset(iSpan, 17) != 255">getNode(iSpan, 17)</Item>
<Item Name="[{getKey(iSpan, 18)}]" Condition="getOffset(iSpan, 18) != 255">getNode(iSpan, 18)</Item>
<Item Name="[{getKey(iSpan, 19)}]" Condition="getOffset(iSpan, 19) != 255">getNode(iSpan, 19)</Item>
<Item Name="[{getKey(iSpan, 20)}]" Condition="getOffset(iSpan, 20) != 255">getNode(iSpan, 20)</Item>
<Item Name="[{getKey(iSpan, 21)}]" Condition="getOffset(iSpan, 21) != 255">getNode(iSpan, 21)</Item>
<Item Name="[{getKey(iSpan, 22)}]" Condition="getOffset(iSpan, 22) != 255">getNode(iSpan, 22)</Item>
<Item Name="[{getKey(iSpan, 23)}]" Condition="getOffset(iSpan, 23) != 255">getNode(iSpan, 23)</Item>
<Item Name="[{getKey(iSpan, 24)}]" Condition="getOffset(iSpan, 24) != 255">getNode(iSpan, 24)</Item>
<Item Name="[{getKey(iSpan, 25)}]" Condition="getOffset(iSpan, 25) != 255">getNode(iSpan, 25)</Item>
<Item Name="[{getKey(iSpan, 26)}]" Condition="getOffset(iSpan, 26) != 255">getNode(iSpan, 26)</Item>
<Item Name="[{getKey(iSpan, 27)}]" Condition="getOffset(iSpan, 27) != 255">getNode(iSpan, 27)</Item>
<Item Name="[{getKey(iSpan, 28)}]" Condition="getOffset(iSpan, 28) != 255">getNode(iSpan, 28)</Item>
<Item Name="[{getKey(iSpan, 29)}]" Condition="getOffset(iSpan, 29) != 255">getNode(iSpan, 29)</Item>
<Item Name="[{getKey(iSpan, 30)}]" Condition="getOffset(iSpan, 30) != 255">getNode(iSpan, 30)</Item>
<Item Name="[{getKey(iSpan, 31)}]" Condition="getOffset(iSpan, 31) != 255">getNode(iSpan, 31)</Item>
<Item Name="[{getKey(iSpan, 32)}]" Condition="getOffset(iSpan, 32) != 255">getNode(iSpan, 32)</Item>
<Item Name="[{getKey(iSpan, 33)}]" Condition="getOffset(iSpan, 33) != 255">getNode(iSpan, 33)</Item>
<Item Name="[{getKey(iSpan, 34)}]" Condition="getOffset(iSpan, 34) != 255">getNode(iSpan, 34)</Item>
<Item Name="[{getKey(iSpan, 35)}]" Condition="getOffset(iSpan, 35) != 255">getNode(iSpan, 35)</Item>
<Item Name="[{getKey(iSpan, 36)}]" Condition="getOffset(iSpan, 36) != 255">getNode(iSpan, 36)</Item>
<Item Name="[{getKey(iSpan, 37)}]" Condition="getOffset(iSpan, 37) != 255">getNode(iSpan, 37)</Item>
<Item Name="[{getKey(iSpan, 38)}]" Condition="getOffset(iSpan, 38) != 255">getNode(iSpan, 38)</Item>
<Item Name="[{getKey(iSpan, 39)}]" Condition="getOffset(iSpan, 39) != 255">getNode(iSpan, 39)</Item>
<Item Name="[{getKey(iSpan, 40)}]" Condition="getOffset(iSpan, 40) != 255">getNode(iSpan, 40)</Item>
<Item Name="[{getKey(iSpan, 41)}]" Condition="getOffset(iSpan, 41) != 255">getNode(iSpan, 41)</Item>
<Item Name="[{getKey(iSpan, 42)}]" Condition="getOffset(iSpan, 42) != 255">getNode(iSpan, 42)</Item>
<Item Name="[{getKey(iSpan, 43)}]" Condition="getOffset(iSpan, 43) != 255">getNode(iSpan, 43)</Item>
<Item Name="[{getKey(iSpan, 44)}]" Condition="getOffset(iSpan, 44) != 255">getNode(iSpan, 44)</Item>
<Item Name="[{getKey(iSpan, 45)}]" Condition="getOffset(iSpan, 45) != 255">getNode(iSpan, 45)</Item>
<Item Name="[{getKey(iSpan, 46)}]" Condition="getOffset(iSpan, 46) != 255">getNode(iSpan, 46)</Item>
<Item Name="[{getKey(iSpan, 47)}]" Condition="getOffset(iSpan, 47) != 255">getNode(iSpan, 47)</Item>
<Item Name="[{getKey(iSpan, 48)}]" Condition="getOffset(iSpan, 48) != 255">getNode(iSpan, 48)</Item>
<Item Name="[{getKey(iSpan, 49)}]" Condition="getOffset(iSpan, 49) != 255">getNode(iSpan, 49)</Item>
<Item Name="[{getKey(iSpan, 50)}]" Condition="getOffset(iSpan, 50) != 255">getNode(iSpan, 50)</Item>
<Item Name="[{getKey(iSpan, 51)}]" Condition="getOffset(iSpan, 51) != 255">getNode(iSpan, 51)</Item>
<Item Name="[{getKey(iSpan, 52)}]" Condition="getOffset(iSpan, 52) != 255">getNode(iSpan, 52)</Item>
<Item Name="[{getKey(iSpan, 53)}]" Condition="getOffset(iSpan, 53) != 255">getNode(iSpan, 53)</Item>
<Item Name="[{getKey(iSpan, 54)}]" Condition="getOffset(iSpan, 54) != 255">getNode(iSpan, 54)</Item>
<Item Name="[{getKey(iSpan, 55)}]" Condition="getOffset(iSpan, 55) != 255">getNode(iSpan, 55)</Item>
<Item Name="[{getKey(iSpan, 56)}]" Condition="getOffset(iSpan, 56) != 255">getNode(iSpan, 56)</Item>
<Item Name="[{getKey(iSpan, 57)}]" Condition="getOffset(iSpan, 57) != 255">getNode(iSpan, 57)</Item>
<Item Name="[{getKey(iSpan, 58)}]" Condition="getOffset(iSpan, 58) != 255">getNode(iSpan, 58)</Item>
<Item Name="[{getKey(iSpan, 59)}]" Condition="getOffset(iSpan, 59) != 255">getNode(iSpan, 59)</Item>
<Item Name="[{getKey(iSpan, 60)}]" Condition="getOffset(iSpan, 60) != 255">getNode(iSpan, 60)</Item>
<Item Name="[{getKey(iSpan, 61)}]" Condition="getOffset(iSpan, 61) != 255">getNode(iSpan, 61)</Item>
<Item Name="[{getKey(iSpan, 62)}]" Condition="getOffset(iSpan, 62) != 255">getNode(iSpan, 62)</Item>
<Item Name="[{getKey(iSpan, 63)}]" Condition="getOffset(iSpan, 63) != 255">getNode(iSpan, 63)</Item>
<Item Name="[{getKey(iSpan, 64)}]" Condition="getOffset(iSpan, 64) != 255">getNode(iSpan, 64)</Item>
<Item Name="[{getKey(iSpan, 65)}]" Condition="getOffset(iSpan, 65) != 255">getNode(iSpan, 65)</Item>
<Item Name="[{getKey(iSpan, 66)}]" Condition="getOffset(iSpan, 66) != 255">getNode(iSpan, 66)</Item>
<Item Name="[{getKey(iSpan, 67)}]" Condition="getOffset(iSpan, 67) != 255">getNode(iSpan, 67)</Item>
<Item Name="[{getKey(iSpan, 68)}]" Condition="getOffset(iSpan, 68) != 255">getNode(iSpan, 68)</Item>
<Item Name="[{getKey(iSpan, 69)}]" Condition="getOffset(iSpan, 69) != 255">getNode(iSpan, 69)</Item>
<Item Name="[{getKey(iSpan, 70)}]" Condition="getOffset(iSpan, 70) != 255">getNode(iSpan, 70)</Item>
<Item Name="[{getKey(iSpan, 71)}]" Condition="getOffset(iSpan, 71) != 255">getNode(iSpan, 71)</Item>
<Item Name="[{getKey(iSpan, 72)}]" Condition="getOffset(iSpan, 72) != 255">getNode(iSpan, 72)</Item>
<Item Name="[{getKey(iSpan, 73)}]" Condition="getOffset(iSpan, 73) != 255">getNode(iSpan, 73)</Item>
<Item Name="[{getKey(iSpan, 74)}]" Condition="getOffset(iSpan, 74) != 255">getNode(iSpan, 74)</Item>
<Item Name="[{getKey(iSpan, 75)}]" Condition="getOffset(iSpan, 75) != 255">getNode(iSpan, 75)</Item>
<Item Name="[{getKey(iSpan, 76)}]" Condition="getOffset(iSpan, 76) != 255">getNode(iSpan, 76)</Item>
<Item Name="[{getKey(iSpan, 77)}]" Condition="getOffset(iSpan, 77) != 255">getNode(iSpan, 77)</Item>
<Item Name="[{getKey(iSpan, 78)}]" Condition="getOffset(iSpan, 78) != 255">getNode(iSpan, 78)</Item>
<Item Name="[{getKey(iSpan, 79)}]" Condition="getOffset(iSpan, 79) != 255">getNode(iSpan, 79)</Item>
<Item Name="[{getKey(iSpan, 80)}]" Condition="getOffset(iSpan, 80) != 255">getNode(iSpan, 80)</Item>
<Item Name="[{getKey(iSpan, 81)}]" Condition="getOffset(iSpan, 81) != 255">getNode(iSpan, 81)</Item>
<Item Name="[{getKey(iSpan, 82)}]" Condition="getOffset(iSpan, 82) != 255">getNode(iSpan, 82)</Item>
<Item Name="[{getKey(iSpan, 83)}]" Condition="getOffset(iSpan, 83) != 255">getNode(iSpan, 83)</Item>
<Item Name="[{getKey(iSpan, 84)}]" Condition="getOffset(iSpan, 84) != 255">getNode(iSpan, 84)</Item>
<Item Name="[{getKey(iSpan, 85)}]" Condition="getOffset(iSpan, 85) != 255">getNode(iSpan, 85)</Item>
<Item Name="[{getKey(iSpan, 86)}]" Condition="getOffset(iSpan, 86) != 255">getNode(iSpan, 86)</Item>
<Item Name="[{getKey(iSpan, 87)}]" Condition="getOffset(iSpan, 87) != 255">getNode(iSpan, 87)</Item>
<Item Name="[{getKey(iSpan, 88)}]" Condition="getOffset(iSpan, 88) != 255">getNode(iSpan, 88)</Item>
<Item Name="[{getKey(iSpan, 89)}]" Condition="getOffset(iSpan, 89) != 255">getNode(iSpan, 89)</Item>
<Item Name="[{getKey(iSpan, 90)}]" Condition="getOffset(iSpan, 90) != 255">getNode(iSpan, 90)</Item>
<Item Name="[{getKey(iSpan, 91)}]" Condition="getOffset(iSpan, 91) != 255">getNode(iSpan, 91)</Item>
<Item Name="[{getKey(iSpan, 92)}]" Condition="getOffset(iSpan, 92) != 255">getNode(iSpan, 92)</Item>
<Item Name="[{getKey(iSpan, 93)}]" Condition="getOffset(iSpan, 93) != 255">getNode(iSpan, 93)</Item>
<Item Name="[{getKey(iSpan, 94)}]" Condition="getOffset(iSpan, 94) != 255">getNode(iSpan, 94)</Item>
<Item Name="[{getKey(iSpan, 95)}]" Condition="getOffset(iSpan, 95) != 255">getNode(iSpan, 95)</Item>
<Item Name="[{getKey(iSpan, 96)}]" Condition="getOffset(iSpan, 96) != 255">getNode(iSpan, 96)</Item>
<Item Name="[{getKey(iSpan, 97)}]" Condition="getOffset(iSpan, 97) != 255">getNode(iSpan, 97)</Item>
<Item Name="[{getKey(iSpan, 98)}]" Condition="getOffset(iSpan, 98) != 255">getNode(iSpan, 98)</Item>
<Item Name="[{getKey(iSpan, 99)}]" Condition="getOffset(iSpan, 99) != 255">getNode(iSpan, 99)</Item>
<Item Name="[{getKey(iSpan, 100)}]" Condition="getOffset(iSpan, 100) != 255">getNode(iSpan, 100)</Item>
<Item Name="[{getKey(iSpan, 101)}]" Condition="getOffset(iSpan, 101) != 255">getNode(iSpan, 101)</Item>
<Item Name="[{getKey(iSpan, 102)}]" Condition="getOffset(iSpan, 102) != 255">getNode(iSpan, 102)</Item>
<Item Name="[{getKey(iSpan, 103)}]" Condition="getOffset(iSpan, 103) != 255">getNode(iSpan, 103)</Item>
<Item Name="[{getKey(iSpan, 104)}]" Condition="getOffset(iSpan, 104) != 255">getNode(iSpan, 104)</Item>
<Item Name="[{getKey(iSpan, 105)}]" Condition="getOffset(iSpan, 105) != 255">getNode(iSpan, 105)</Item>
<Item Name="[{getKey(iSpan, 106)}]" Condition="getOffset(iSpan, 106) != 255">getNode(iSpan, 106)</Item>
<Item Name="[{getKey(iSpan, 107)}]" Condition="getOffset(iSpan, 107) != 255">getNode(iSpan, 107)</Item>
<Item Name="[{getKey(iSpan, 108)}]" Condition="getOffset(iSpan, 108) != 255">getNode(iSpan, 108)</Item>
<Item Name="[{getKey(iSpan, 109)}]" Condition="getOffset(iSpan, 109) != 255">getNode(iSpan, 109)</Item>
<Item Name="[{getKey(iSpan, 110)}]" Condition="getOffset(iSpan, 110) != 255">getNode(iSpan, 110)</Item>
<Item Name="[{getKey(iSpan, 111)}]" Condition="getOffset(iSpan, 111) != 255">getNode(iSpan, 111)</Item>
<Item Name="[{getKey(iSpan, 112)}]" Condition="getOffset(iSpan, 112) != 255">getNode(iSpan, 112)</Item>
<Item Name="[{getKey(iSpan, 113)}]" Condition="getOffset(iSpan, 113) != 255">getNode(iSpan, 113)</Item>
<Item Name="[{getKey(iSpan, 114)}]" Condition="getOffset(iSpan, 114) != 255">getNode(iSpan, 114)</Item>
<Item Name="[{getKey(iSpan, 115)}]" Condition="getOffset(iSpan, 115) != 255">getNode(iSpan, 115)</Item>
<Item Name="[{getKey(iSpan, 116)}]" Condition="getOffset(iSpan, 116) != 255">getNode(iSpan, 116)</Item>
<Item Name="[{getKey(iSpan, 117)}]" Condition="getOffset(iSpan, 117) != 255">getNode(iSpan, 117)</Item>
<Item Name="[{getKey(iSpan, 118)}]" Condition="getOffset(iSpan, 118) != 255">getNode(iSpan, 118)</Item>
<Item Name="[{getKey(iSpan, 119)}]" Condition="getOffset(iSpan, 119) != 255">getNode(iSpan, 119)</Item>
<Item Name="[{getKey(iSpan, 120)}]" Condition="getOffset(iSpan, 120) != 255">getNode(iSpan, 120)</Item>
<Item Name="[{getKey(iSpan, 121)}]" Condition="getOffset(iSpan, 121) != 255">getNode(iSpan, 121)</Item>
<Item Name="[{getKey(iSpan, 122)}]" Condition="getOffset(iSpan, 122) != 255">getNode(iSpan, 122)</Item>
<Item Name="[{getKey(iSpan, 123)}]" Condition="getOffset(iSpan, 123) != 255">getNode(iSpan, 123)</Item>
<Item Name="[{getKey(iSpan, 124)}]" Condition="getOffset(iSpan, 124) != 255">getNode(iSpan, 124)</Item>
<Item Name="[{getKey(iSpan, 125)}]" Condition="getOffset(iSpan, 125) != 255">getNode(iSpan, 125)</Item>
<Item Name="[{getKey(iSpan, 126)}]" Condition="getOffset(iSpan, 126) != 255">getNode(iSpan, 126)</Item>
<Item Name="[{getKey(iSpan, 127)}]" Condition="getOffset(iSpan, 127) != 255">getNode(iSpan, 127)</Item>
<Exec>iSpan++</Exec>
</If>
</Loop>
</CustomListItems>
</Expand>
</Type>
<Type Name="QSet&lt;*&gt;">
<DisplayString>{{ size={q_hash.d-&gt;size} }}</DisplayString>
<Expand>
<ExpandedItem>q_hash</ExpandedItem>
</Expand>
</Type>
<Type Name="QVariant">
<Intrinsic Name="typeId" Expression="*(int*)(&amp;((const QtPrivate::QMetaTypeInterface *)(d.packedType &lt;&lt; 2))->typeId)">
</Intrinsic>
<Intrinsic Name="dataStar" Expression="(&amp;(d.data.data))">
</Intrinsic>
<Intrinsic Name="sharedDataStar" Expression="(d.is_shared ? reinterpret_cast&lt;const void *&gt;((size_t)(d.data.shared) + d.data.shared-&gt;offset) : (&amp;(d.data.data)))">
</Intrinsic>
<DisplayString Condition="d.is_null">(null)</DisplayString>
<!-- Static core pointers -->
<DisplayString Condition="typeId() == QMetaType::QObjectStar">QObject*</DisplayString>
<!-- Static core template classes -->
<DisplayString Condition="typeId() == QMetaType::QVariantMap">{*(QMap&lt;QString,QVariant&gt;*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QVariantList">{*(QList&lt;QVariant&gt;*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QVariantHash">{*(QHash&lt;QString,QVariant&gt;*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QVariantPair">QVariantPair</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QByteArrayList">{*(QList&lt;QByteArray&gt;*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QStringList">{*(QList&lt;QString&gt;*) sharedDataStar()}</DisplayString>
<!-- Static primitives-->
<DisplayString Condition="typeId() == QMetaType::Bool">{*(bool*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::Int">{*(int*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::UInt">{*(unsigned int*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::LongLong">{*(long long*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::ULongLong">{*(unsigned long long*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::Double">{*(double*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::VoidStar">{*(void**) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::Long">{*(long*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::Short">{*(short*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::Char">{*(char*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::Char16">{*(char16_t*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::Char32">{*(char32_t*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::ULong">{*(unsigned long*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::UShort">{*(unsigned short*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::UChar">{*(unsigned char*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::Float">{*(float*) dataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::SChar">{*(signed char*) dataStar()}</DisplayString>
<!-- Static core classes -->
<DisplayString Condition="typeId() == QMetaType::QChar">{*(QChar*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QString">{*(QString*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QByteArray">{*(QByteArray*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QDate">{*(QDate*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QTime">{*(QTime*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QDateTime">QDateTime</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QUrl">QUrl</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QLocale">QLocale</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QRect">{*(QRect*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QRectF">{*(QRectF*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QSize">{*(QSize*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QSizeF">{*(QSizeF*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QLine">{*(QLine*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QLineF">{*(QLineF*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QPoint">{*(QPoint*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QPointF">{*(QPointF*) sharedDataStar()}</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QEasingCurve">EasingCurve</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QUuid">Uuid</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QRegularExpression">RegularExpression</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QJsonValue">QJsonValue</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QJsonObject">QJsonObject</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QJsonArray">QJsonArray</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QJsonDocument">QJsonDocument</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QCborValue">QCborValue</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QCborArray">QCborArray</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QCborMap">QCborMap</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QModelIndex">ModelIndex</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QPersistentModelIndex">QPersistentModelIndex</DisplayString>
<!-- Static gui classes -->
<DisplayString Condition="typeId() == QMetaType::QFont">QFont</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QPixmap">QPixmap</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QBrush">QBrush</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QColor">QColor</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QPalette">QPalette</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QIcon">QIcon</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QImage">QImage</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QPolygon">QPolygon</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QRegion">QRegion</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QBitmap">QBitmap</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QCursor">QCursor</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QKeySequence">QKeySequence</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QPen">QPen</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QTextLength">QTextLength</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QTextFormat">QTextFormat</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QTransform">QTransform</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QMatrix4x4">QMatrix4x4</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QVector2D">QVector2D</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QVector3D">QVector3D</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QVector4D">QVector4D</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QQuaternion">QQuaternion</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QPolygonF">QPolygonF</DisplayString>
<DisplayString Condition="typeId() == QMetaType::QColorSpace">QColorSpace</DisplayString>
<!-- Static widget classes -->
<DisplayString Condition="typeId() == QMetaType::QSizePolicy">QSizePolicy</DisplayString>
<!-- Unhandled : display the typeId-->
<DisplayString>QMetaType::Type ({typeId()})</DisplayString>
<Expand>
<ExpandedItem Condition="typeId() == QMetaType::QString">*(QString*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QByteArray">*(QByteArray*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QDate">*(QDate*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QTime">*(QTime*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QRect">*(QRect*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QRectF">*(QRectF*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QSize">*(QSize*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QSizeF">*(QSizeF*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QLine">*(QLine*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QLineF">*(QLineF*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QPoint">*(QPoint*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QPointF">*(QPointF*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QVariantMap">*(QMap&lt;QString,QVariant&gt;*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QVariantList">*(QList&lt;QVariant&gt;*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QVariantHash">*(QHash&lt;QString,QVariant&gt;*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QByteArrayList">*(QList&lt;QByteArray&gt;*) sharedDataStar()</ExpandedItem>
<ExpandedItem Condition="typeId() == QMetaType::QStringList">*(QList&lt;QString&gt;*) sharedDataStar()</ExpandedItem>
</Expand>
</Type>
</AutoVisualizer>

106
.vscode/settings.json vendored
View File

@ -1,106 +0,0 @@
{
"files.autoSave": "onFocusChange",
"editor.fontSize": 14,
"editor.fontFamily": "'Cousine Nerd Font Mono', 'IBM Plex Mono', 'MIBM Plex Mono'",
"cmake.configureOnOpen": true,
"cmake.debugConfig": {
"console": "integratedTerminal",
"setupCommands": [
{
"description": "-gdb-set charset utf-8",
"text": "-gdb-set charset UTF-8"
},
{
"description": "Enable gdb pretty-printing",
"text": "-enable-pretty-printing",
"ignoreFailures": true
}
],
"visualizerFile": "${workspaceRoot}/.vscode/qt6.natvis"
},
"cmake.environment": {
"PATH": "${env:PATH};C:/Qt/6.6.3/msvc2019_64/bin"
},
"cmake.options.statusBarVisibility": "visible",
"cmake.generator": "Ninja",
"C_Cpp.default.compileCommands": "${workspaceRoot}/build/compile_commands.json",
"C_Cpp.default.cppStandard": "c++14",
"editor.inlayHints.enabled": "off",
"editor.unicodeHighlight.allowedLocales": {
"ja": true,
"zh-hant": true,
"zh-hans": true
},
"files.associations": {
"algorithm": "cpp",
"atomic": "cpp",
"cctype": "cpp",
"chrono": "cpp",
"cmath": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdint": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"exception": "cpp",
"filesystem": "cpp",
"functional": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"ios": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"iterator": "cpp",
"limits": "cpp",
"list": "cpp",
"locale": "cpp",
"map": "cpp",
"memory": "cpp",
"mutex": "cpp",
"new": "cpp",
"numeric": "cpp",
"ostream": "cpp",
"ratio": "cpp",
"stdexcept": "cpp",
"streambuf": "cpp",
"string": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"thread": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"typeinfo": "cpp",
"unordered_map": "cpp",
"utility": "cpp",
"variant": "cpp",
"vector": "cpp",
"xfacet": "cpp",
"xhash": "cpp",
"xiosbase": "cpp",
"xlocale": "cpp",
"xlocbuf": "cpp",
"xlocinfo": "cpp",
"xlocmes": "cpp",
"xlocmon": "cpp",
"xlocnum": "cpp",
"xloctime": "cpp",
"xmemory": "cpp",
"xmemory0": "cpp",
"xstddef": "cpp",
"xstring": "cpp",
"xtr1common": "cpp",
"xtree": "cpp",
"xutility": "cpp",
"qtablewidget": "cpp",
"qmenu": "cpp",
"qmessagebox": "cpp",
"qaction": "cpp",
"codecvt": "cpp",
"qregexp": "cpp",
"qregularexpression": "cpp"
}
}

View File

@ -1,9 +1,24 @@
cmake_minimum_required(VERSION 3.5)
cmake_minimum_required(VERSION 3.16)
project(OneLevelXmlOpr VERSION 0.1 LANGUAGES CXX)
# HOME
if (UNIX)
set(USER_HOME $ENV{HOME})
else()
set(USER_HOME "C:/Qt")
endif()
#
message(STATUS "User home directory: ${USER_HOME}")
set(CMAKE_PREFIX_PATH
"C:/Qt/6.6.3/msvc2019_64"
${CMAKE_PREFIX_PATH}
"${USER_HOME}/Qt5.14.2/5.14.2/gcc_64/"
"${USER_HOME}/Qt5.14.2/5.14.2/msvc2017_64/"
"D:/Qt/Qt5.14.2/5.14.2/msvc2017_64/"
"C:/Qt/6.7.2"
"/opt/homebrew/Cellar/qt/6.7.0_2/"
)
set(CMAKE_AUTOUIC ON)
@ -17,6 +32,8 @@ find_package(QT NAMES Qt6 Qt5 REQUIRED COMPONENTS Widgets)
find_package(Qt${QT_VERSION_MAJOR} REQUIRED COMPONENTS Widgets)
include_directories(3rd)
include_directories(src)
include_directories(form)
set(PROJECT_SOURCES
main.cpp
MainWidget.cpp
@ -27,49 +44,25 @@ set(PROJECT_SOURCES
resource/ico.rc src/attribute_edit.ui src/attribute_edit.h
src/attribute_edit.cpp flatgray.qrc
src/data_edit.h src/data_edit.cpp src/data_edit.ui
src/QCustomQLineEdit.h src/QCustomQLineEdit.cpp
form/qformatset.h form/qformatset.cpp form/qformatset.ui
)
if (MSVC)
# if(${QT_VERSION_MAJOR} LESS 6)
# add_compile_options(/source-charset:utf-8)
# endif()
add_compile_options(/source-charset:utf-8)
add_compile_options(/utf-8)
add_compile_options(/EHsc)
add_compile_options(/wd4267)
add_compile_options(-D_CRT_SECURE_NO_WARNINGS)
endif()
if(${QT_VERSION_MAJOR} GREATER_EQUAL 6)
qt_add_executable(OneLevelXmlOpr
MANUAL_FINALIZATION
${PROJECT_SOURCES}
)
# Define target properties for Android with Qt 6 as:
# set_property(TARGET OneLevelXmlOpr APPEND PROPERTY QT_ANDROID_PACKAGE_SOURCE_DIR
# ${CMAKE_CURRENT_SOURCE_DIR}/android)
# For more information, see https://doc.qt.io/qt-6/qt-add-executable.html#target-creation
else()
if(ANDROID)
add_library(OneLevelXmlOpr SHARED
${PROJECT_SOURCES}
)
# Define properties for Android with Qt 5 after find_package() calls as:
# set(ANDROID_PACKAGE_SOURCE_DIR "${CMAKE_CURRENT_SOURCE_DIR}/android")
else()
add_executable(OneLevelXmlOpr
${PROJECT_SOURCES}
)
endif()
endif()
add_executable(OneLevelXmlOpr ${PROJECT_SOURCES}
conf_setting.h conf_setting.cpp conf_setting.ui
src/history.h src/history.cpp
src/uhistory.h src/uhistory.cpp src/uhistory.ui)
target_link_libraries(OneLevelXmlOpr PRIVATE Qt${QT_VERSION_MAJOR}::Widgets)
# Qt for iOS sets MACOSX_BUNDLE_GUI_IDENTIFIER automatically since Qt 6.1.
# If you are developing for iOS or macOS you should consider setting an
# explicit, fixed bundle identifier manually though.
if(${QT_VERSION} VERSION_LESS 6.1.0)
set(BUNDLE_ID_OPTION MACOSX_BUNDLE_GUI_IDENTIFIER com.example.OneLevelXmlOpr)
endif()
set_target_properties(OneLevelXmlOpr PROPERTIES
${BUNDLE_ID_OPTION}
MACOSX_BUNDLE_BUNDLE_VERSION ${PROJECT_VERSION}
@ -78,13 +71,3 @@ set_target_properties(OneLevelXmlOpr PROPERTIES
WIN32_EXECUTABLE TRUE
)
include(GNUInstallDirs)
install(TARGETS OneLevelXmlOpr
BUNDLE DESTINATION .
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
RUNTIME DESTINATION ${CMAKE_INSTALL_BINDIR}
)
if(QT_VERSION_MAJOR EQUAL 6)
qt_finalize_executable(OneLevelXmlOpr)
endif()

View File

@ -1,14 +1,18 @@
#include "MainWidget.h"
#include <QClipboard>
#include <QSettings>
#include <QDateTime>
#include <QFile>
#include <QKeyEvent>
#include <QDateTime>
#include <QScreen>
#include <QRegularExpression>
#include <QScreen>
#include <QSettings>
#include <filesystem>
#include "src/data_edit.h"
#include "./ui_MainWidget.h"
#include "public_def.h"
#include "qformatset.h"
#include "src/data_edit.h"
constexpr std::size_t g_OnePage = 100;
namespace fs = std::filesystem;
@ -16,18 +20,22 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
{
ui->setupUi(this);
setWindowTitle(u8"OneLevelXmlOpr v1.2.17");
setWindowTitle(u8"OneLevelXmlOpr v1.3.10");
setWindowIcon(QIcon("://resource/xml.ico"));
QScreen* primaryScreen = QGuiApplication::primaryScreen();
QRect screenGeometry = primaryScreen->geometry();
QRect screenGeometry = primaryScreen->geometry();
setBaseSize(screenGeometry.width() * 0.6, screenGeometry.height() * 0.9);
// setMinimumWidth(900);
// setMinimumHeight(800);
his_ = new CHistory();
attri_edit_ = new CAttributeEdit();
ini_oper_ = new CGroupIni();
ini_oper_->load_ini();
group_set_ = new CGroupSetting(this, ini_oper_);
ui->edStatus->setReadOnly(true);
ui->btnSave->setEnabled(false);
@ -41,23 +49,26 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
ui->btnSave->setFixedWidth(100);
ui->btnExit->setFixedWidth(100);
ui->btnSearch->setFixedWidth(120);
ui->btnBackup->setEnabled(false);
ui->btnResort->setEnabled(false);
connect(ui->btnSelectFile, &QPushButton::clicked, this, [&]() {
QString file = CUtil::select_file(this, u8"请选择xml文件", u8"XML(*.xml);;所有文件 (*)");
if (file.isEmpty()) {
return;
}
read(file);
// ui->edStatus->setText(file);
ui->edStatus->setText(file);
});
connect(ui->btnSearch, &QPushButton::clicked, this, [&]() { search(ui->edSearchKey->text()); });
connect(ui->btnBackup, &QPushButton::clicked, this, [&]() { backup_file(); });
connect(ui->btnFormat, &QPushButton::clicked, this, [&]() { format_xml(); });
connect(ui->btnRead, &QPushButton::clicked, this, [&]() { read(ui->edStatus->text().trimmed()); });
connect(ui->btnSave, &QPushButton::clicked, this, [&]() { save(); });
connect(ui->btnExit, &QPushButton::clicked, this, [&]() { QApplication::exit(0); });
connect(ui->btnReset, &QPushButton::clicked, this, &MainWidget::reset);
connect(ui->btnReplace, &QPushButton::clicked, this, [&]() { replace_content(true); });
connect(ui->btnRxReplace, &QPushButton::clicked, this, [&]() { replace_content(false); });
connect(ui->cbUnit, &QComboBox::currentTextChanged, this, [&](const QString& content) { unit_change(); });
connect(ui->btnExport, &QPushButton::clicked, this, &MainWidget::copy_multi_data);
connect(ui->btnPagePre, &QPushButton::clicked, this, [&]() {
unsigned int cur = ui->edCurPage->text().toUInt();
@ -72,11 +83,32 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
if (!edit.is_import_sucess_) {
return;
}
xml_.get_all_elements(vec_);
if (cur_config_.is_same) {
xml_.get_all_elements(vec_, ui->cbUnit->currentText().toStdString());
} else {
xml_.get_all_elements(vec_);
}
current_.clear();
current_ = vec_;
push_content(current_);
search(ui->edSearchKey->text());
});
connect(ui->btnSet, &QPushButton::clicked, this, [&]() {
QString cur = ui->cbConfig->currentText();
group_set_->exec();
base_init(cur);
});
connect(ui->btnHis, &QPushButton::clicked, this, [&]() {
CUIHistory his(this, his_);
his.exec();
if (his.cur_ != "") {
ui->edStatus->setText(his.cur_);
}
});
connect(ui->btnPageNext, &QPushButton::clicked, this, [&]() {
unsigned int cur = ui->edCurPage->text().toUInt();
push_content(current_, cur + 1);
@ -89,6 +121,11 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
if (tab_widget_ == nullptr) {
return;
}
if (!CUtil::affirm(this, u8"提示", u8"确认重新排序吗?")) {
return;
}
sort_by_repeat(vec_);
std::vector<Element_t*> nvec{};
xml_.copy_and_del(vec_, nvec);
@ -110,15 +147,8 @@ MainWidget::MainWidget(QWidget* parent) : QWidget(parent), ui(new Ui::MainWidget
// }
init_menu();
ini_.set_work_exe(exe_path_);
base_ = ini_.get_config();
if (base_.blank_width > 20) {
blank_with_ = base_.blank_width;
}
ui->edStatus->setText(QString::fromStdString(base_.xml_path));
// 基本处理
base_init("");
}
void MainWidget::copy_key()
@ -144,19 +174,21 @@ void MainWidget::closeEvent(QCloseEvent* event)
void MainWidget::keyPressEvent(QKeyEvent* event)
{
switch (event->key()) {
case Qt::Key_Return:
search(ui->edSearchKey->text());
break;
default:
break;
case Qt::Key_Return:
search(ui->edSearchKey->text());
break;
default:
break;
}
QWidget::keyPressEvent(event);
}
MainWidget::~MainWidget()
{
delete attri_edit_;
delete ui;
delete attri_edit_;
delete ini_oper_;
delete his_;
}
void MainWidget::set_work_exe(char* path)
@ -181,15 +213,16 @@ void MainWidget::show_custom_menu()
void MainWidget::generate_table_widget()
{
tab_widget_ = new QTableWidget();
clear_tab_widget();
if (tab_widget_ == nullptr) {
tab_widget_ = new QTableWidget();
}
metrics_ = std::make_shared<QFontMetrics>(tab_widget_->font());
tab_widget_->setContextMenuPolicy(Qt::CustomContextMenu);
connect(tab_widget_, &QTableWidget::itemChanged, this,
[&](QTableWidgetItem* item) { item_changed_handle(item); });
connect(tab_widget_, &QTableWidget::itemChanged, this, [&](QTableWidgetItem* item) { item_changed_handle(item); });
connect(tab_widget_, &QTableWidget::customContextMenuRequested, this, &MainWidget::show_custom_menu);
auto config = ini_.get_config();
auto keys = CUtil::splitString(config.purpose, ",");
auto keys = CUtil::splitString(cur_config_.propertis, ",");
keys_.clear();
QStringList list;
@ -215,12 +248,14 @@ void MainWidget::generate_table_widget()
tab_widget_->setColumnWidth(i, col_with_[i]);
}
QHBoxLayout* lay = new QHBoxLayout();
lay->addWidget(tab_widget_);
ui->widget->setLayout(lay);
if (lay_ == nullptr) {
lay_ = new QHBoxLayout();
}
lay_->addWidget(tab_widget_);
ui->widget->setLayout(lay_);
}
void MainWidget::push_content(const std::vector<tinyxml2::XMLElement*>& eles, std::size_t page)
void MainWidget::push_content(const std::vector<tinyxml2::XMLElement*>& eles, std::size_t page, bool auto_jump_pre)
{
if (tab_widget_ == nullptr || page == 0) {
return;
@ -234,6 +269,10 @@ void MainWidget::push_content(const std::vector<tinyxml2::XMLElement*>& eles, st
++all_page_;
}
if (auto_jump_pre && page > all_page_ && page > 1) {
page -= 1;
}
if (page < 1 || page > all_page_) {
if (eles.size() > 0) {
CUtil::msg(this, u8"页码不在范围内");
@ -283,29 +322,75 @@ void MainWidget::judge_btn_page()
}
}
void MainWidget::read(const QString& file_path)
void MainWidget::clear_data()
{
base_.xml_path = file_path.toStdString();
if (!ini_.set_xml_path(base_.xml_path)) {
CUtil::msg(this, u8"没有ini配置文件或者保存ini失败。");
return;
}
ui->edStatus->setText(file_path);
}
if (!xml_.open(base_.xml_path)) {
CUtil::msg(this, u8"打开xml失败。");
return;
bool MainWidget::read(const QString& file_path)
{
unit_change_auto_ = true;
ui->cbUnit->clear();
unit_change_auto_ = false;
if (alreay_open_) {
if (!CUtil::affirm(this, u8"确认", u8"当前已有打开文件在使用,请确认已保存相关内容再继续。")) {
return false;
} else {
xml_.clear_data();
current_.clear();
vec_.clear();
}
}
xml_.set_baseinfo(base_);
// 获取配置
cur_config_.name = ui->cbConfig->currentText().toStdString();
if (!ini_oper_->get_item(cur_config_)) {
CUtil::msg(this, u8"获取配置失败。");
clear_tab_widget();
alreay_open_ = false;
return false;
}
if (!xml_.open(file_path.toStdString())) {
CUtil::msg(this, u8"打开xml失败。");
clear_tab_widget();
alreay_open_ = false;
return false;
}
xml_.set_baseinfo(cur_config_);
if (!xml_.parse_xml(vec_)) {
CUtil::msg(this, u8"解析xml失败。");
return;
clear_tab_widget();
alreay_open_ = false;
return false;
}
if (base_.allow_max_width < 0 || base_.allow_max_width > 1000) {
if (cur_config_.max_blank_add >= 0) {
blank_with_ = cur_config_.max_blank_add;
}
if (cur_config_.is_same) {
std::vector<std::string> units;
xml_.get_all_unit(units);
QStringList list;
for (const auto& unit : units) {
list.append(QString::fromStdString(unit));
}
u_ = true;
ui->cbUnit->clear();
if (!list.isEmpty()) {
ui->cbUnit->addItems(list);
ui->cbUnit->setCurrentIndex(0);
}
u_ = false;
ui->btnResort->setEnabled(false);
ui->cbUnit->setEnabled(true);
} else {
ui->cbUnit->setEnabled(false);
}
if (cur_config_.max_col_len < 0 || cur_config_.max_col_len > 2000) {
allow_max_with_ = 100;
} else {
allow_max_with_ = base_.allow_max_width;
allow_max_with_ = cur_config_.max_col_len;
}
generate_table_widget();
@ -313,12 +398,21 @@ void MainWidget::read(const QString& file_path)
current_ = vec_;
ui->edStatus->setText(file_path);
ui->btnRead->setEnabled(false);
// ui->btnRead->setEnabled(false);
ui->btnSave->setEnabled(true);
ui->btnSelectFile->setEnabled(false);
// ui->btnSelectFile->setEnabled(false);
ui->btnImport->setEnabled(true);
ui->btnExport->setEnabled(true);
ui->btnBackup->setEnabled(true);
ui->btnResort->setEnabled(true);
// ui->cbConfig->setEnabled(false);
// ui->btnSet->setEnabled(false);
// ui->btnHis->setEnabled(false);
his_->push(ui->edStatus->text().toStdString());
alreay_open_ = true;
return true;
}
void MainWidget::search(const QString& key)
@ -326,7 +420,7 @@ void MainWidget::search(const QString& key)
QString bkey = key;
if (bkey.isEmpty()) {
current_ = vec_;
push_content(current_);
push_content(current_, ui->edCurPage->text().toUInt(), true);
return;
}
if (tab_widget_ == nullptr) {
@ -341,7 +435,7 @@ void MainWidget::search(const QString& key)
for (const auto& item : vec_) {
for (auto i = 0; i < keys_.size(); ++i) {
const char* data = item->Attribute(keys_[i].c_str());
QString qdata(data);
QString qdata(data);
if (!ui->cbCaseSensitive->isChecked()) {
qdata = qdata.toUpper();
}
@ -352,7 +446,7 @@ void MainWidget::search(const QString& key)
break;
}
}
push_content(current_);
push_content(current_, ui->edCurPage->text().toUInt(), true);
}
void MainWidget::item_changed_handle(QTableWidgetItem* item)
@ -366,7 +460,7 @@ void MainWidget::item_changed_handle(QTableWidgetItem* item)
int row = item->row();
int col = item->column();
QString xml_key = tab_widget_->item(row, 0)->text();
QString xml_key = tab_widget_->item(row, 0)->text();
Element_t* result = get_element_by_key(xml_key);
if (result == nullptr) {
return;
@ -400,7 +494,7 @@ void MainWidget::copy_select_line()
}
Element_t* newer = xml_.copy_element(target);
if (!edit_property(newer, cur_item->row())) {
if (!edit_property(newer, cur_item->row(), true)) {
return;
}
@ -421,7 +515,7 @@ void MainWidget::copy_select_line()
}
// 返回 true 表示确认编辑了, false 表示取消编辑了。
bool MainWidget::edit_property(Element_t* target, int row)
bool MainWidget::edit_property(Element_t* target, int row, bool is_copy)
{
if (target == nullptr) {
return false;
@ -440,7 +534,8 @@ bool MainWidget::edit_property(Element_t* target, int row)
}
attri_edit_->get_attribute(property);
if (property[0].value != value_pre) {
// 如果是复制,或者编辑时更改了key值,检查重复性。
if (property[0].value != value_pre || is_copy) {
while (xml_.check_key_exists(property)) {
CUtil::msg(attri_edit_, u8"不能有相同的key,请检查。");
attri_edit_->exec();
@ -453,24 +548,30 @@ bool MainWidget::edit_property(Element_t* target, int row)
xml_.attributes_to_element(target, property);
// 这里要同步到界面
ele_update_gui(target, row);
ele_update_gui(target, QString::fromStdString(value_pre));
return true;
}
// ele_update_gui 的 row 参数暂时废弃,无意义。
void MainWidget::ele_update_gui(Element_t* target, int row)
void MainWidget::ele_update_gui(Element_t* target, const QString& pre_value)
{
if (tab_widget_ == nullptr) {
return;
}
QString tkey = QString::fromLocal8Bit(target->Attribute(keys_[0].c_str()));
QString search_key;
if (pre_value.isEmpty()) {
search_key = QString::fromLocal8Bit(target->Attribute(keys_[0].c_str()));
} else {
search_key = pre_value;
}
int target_row = -1;
// 获取当前显示的内容,查找更改。
int cur_show_cnt = tab_widget_->rowCount();
for (int i = 0; i < cur_show_cnt; ++i) {
if (tab_widget_->item(i, 0)->text() == tkey) {
if (tab_widget_->item(i, 0)->text() == search_key) {
target_row = i;
break;
}
@ -482,7 +583,7 @@ void MainWidget::ele_update_gui(Element_t* target, int row)
for (auto i = 0; i < keys_.size(); ++i) {
const char* v = target->Attribute(keys_[i].c_str());
auto* qitem = tab_widget_->item(target_row, i);
auto* qitem = tab_widget_->item(target_row, i);
qitem->setText(QString(v));
}
}
@ -513,7 +614,7 @@ void MainWidget::init_menu()
if (target == nullptr) {
return;
}
edit_property(target, cur_item->row());
edit_property(target, cur_item->row(), false);
});
connect(ac_copy_curline_, &QAction::triggered, this, [&]() { copy_select_line(); });
connect(ac_del_curline_, &QAction::triggered, this, [&]() { del_select_line(); });
@ -526,7 +627,7 @@ void MainWidget::insert_one_line(Element_t* ele, int row)
return;
}
for (auto i = 0; i < keys_.size(); ++i) {
const char* data = ele->Attribute(keys_[i].c_str());
const char* data = ele->Attribute(keys_[i].c_str());
QTableWidgetItem* wgItem = new QTableWidgetItem();
if (i == 0) {
@ -535,8 +636,8 @@ void MainWidget::insert_one_line(Element_t* ele, int row)
// wgItem->setCheckState(Qt::Checked);
}
QString sda(data);
int dwidth = metrics_->horizontalAdvance(sda) + blank_with_;
int need_set_width = dwidth > allow_max_with_ ? allow_max_with_ : dwidth;
int dwidth = metrics_->horizontalAdvance(sda) + blank_with_;
int need_set_width = dwidth > allow_max_with_ ? allow_max_with_ : dwidth;
col_with_[i] = col_with_[i] < need_set_width ? need_set_width : col_with_[i];
wgItem->setText(sda);
tab_widget_->setItem(row, i, wgItem);
@ -549,8 +650,8 @@ void MainWidget::del_select_line()
return;
}
QModelIndexList indexList = tab_widget_->selectionModel()->selectedRows();
int size = indexList.size();
QModelIndexList indexList = tab_widget_->selectionModel()->selectedRows();
int size = indexList.size();
std::vector<int> erase_row;
for (auto i = size - 1; i > -1; --i) {
Element_t* target = get_element_by_row(indexList[i].row());
@ -577,7 +678,7 @@ void MainWidget::del_select_line()
Element_t* MainWidget::get_current_select_key()
{
Element_t* ret = nullptr;
Element_t* ret = nullptr;
QTableWidgetItem* item = get_current_select_item();
if (item == nullptr) {
return ret;
@ -613,7 +714,7 @@ tinyxml2::XMLElement* MainWidget::get_element_by_key(const QString& key)
Element_t* ret = nullptr;
for (const auto& ele : current_) {
const char* data = ele->Attribute(keys_[0].c_str());
QString qdata(data);
QString qdata(data);
if (qdata != key) {
continue;
}
@ -636,27 +737,14 @@ Element_t* MainWidget::get_element_by_row(int row)
void MainWidget::sort_by_repeat(std::vector<Element_t*>& vec)
{
std::vector<SElement_t> turn_vec{};
for (const auto& item : vec) {
const char* str = item->Attribute(keys_[0].c_str());
std::string d(str);
turn_vec.emplace_back(item, d);
}
auto compare = [&](const SElement_t& se1, const SElement_t& se2) {
std::size_t i = 0;
// 逐个字符比较,直到找到不同的字符或者某个字符串到达结尾
while (i < se1.str.length() && i < se2.str.length()) {
if (se1.str[i] != se2.str[i]) {
return se1.str[i] < se2.str[i];
}
++i;
}
// 如果有一个字符串到达结尾,而另一个还没有,则较短的字符串排在前面
return se1.str.length() < se2.str.length();
};
std::sort(turn_vec.begin(), turn_vec.end(), compare);
std::sort(turn_vec.begin(), turn_vec.end(),
[&](const SElement_t& se1, const SElement_t& se2) { return compare_by_prefix(se1, se2); });
vec.clear();
for (const auto& item : turn_vec) {
vec.push_back(item.ele);
@ -712,7 +800,7 @@ void MainWidget::replace_content(bool is_common)
return;
}
auto handle = [&](const std::vector<OperElement*>& vec, bool is_search) {
//qDebug() << "要处理的数量为:" << vec.size();
// qDebug() << "要处理的数量为:" << vec.size();
for (auto& item : vec) {
if (is_common) {
replace_str(key, after, item->element_);
@ -720,7 +808,7 @@ void MainWidget::replace_content(bool is_common)
replace_str(item->element_, key, after);
}
if (!is_search) {
ele_update_gui(item->element_, item->row_);
ele_update_gui(item->element_);
}
delete item;
}
@ -763,8 +851,8 @@ void MainWidget::replace_str(const QString& pre, const QString& after, Element_t
if (ele == nullptr) {
return;
}
for (auto i = 0; i < keys_.size(); ++i) {
auto* value = ele->Attribute(keys_[i].c_str());
for (auto i = 1; i < keys_.size(); ++i) {
auto* value = ele->Attribute(keys_[i].c_str());
QString content(value);
if (content.contains(pre)) {
content.replace(pre, after);
@ -780,12 +868,12 @@ void MainWidget::replace_str(Element_t* ele, const QString& rg, const QString& a
return;
}
for (auto i = 0; i < keys_.size(); ++i) {
auto* value = ele->Attribute(keys_[i].c_str());
auto* value = ele->Attribute(keys_[i].c_str());
QString content(value);
// qDebug() << content;
content.replace(rx, after);
//qDebug() << content;
//qDebug() << "\n";
// qDebug() << content;
// qDebug() << "\n";
ele->SetAttribute(keys_[i].c_str(), content.toStdString().c_str());
}
}
@ -795,32 +883,30 @@ void MainWidget::get_related_elements(std::vector<OperElement*>& out, ReplaceAre
assert(tab_widget_);
out.clear();
switch (area) {
case AREA_ALL_PAGE: {
out.resize(current_.size());
std::transform(current_.begin(), current_.end(), out.begin(),
[](Element_t* ele) { return new OperElement(ele, 0); });
break;
}
case AREA_CUR_PAGE: {
int rows = tab_widget_->rowCount();
for (int i = 0; i < rows; ++i) {
out.emplace_back(new OperElement(get_element_by_row(i), i));
case AREA_ALL_PAGE: {
out.resize(current_.size());
std::transform(current_.begin(), current_.end(), out.begin(), [](Element_t* ele) { return new OperElement(ele, 0); });
break;
}
break;
}
case AREA_ALL: {
out.resize(vec_.size());
std::transform(vec_.begin(), vec_.end(), out.begin(),
[](Element_t* ele) { return new OperElement(ele, 0); });
break;
}
default: {
QModelIndexList indexList = tab_widget_->selectionModel()->selectedRows();
for (int i = 0; i < indexList.size(); ++i) {
out.emplace_back(new OperElement(get_element_by_row(indexList[i].row()), indexList[i].row()));
case AREA_CUR_PAGE: {
int rows = tab_widget_->rowCount();
for (int i = 0; i < rows; ++i) {
out.emplace_back(new OperElement(get_element_by_row(i), i));
}
break;
}
case AREA_ALL: {
out.resize(vec_.size());
std::transform(vec_.begin(), vec_.end(), out.begin(), [](Element_t* ele) { return new OperElement(ele, 0); });
break;
}
default: {
QModelIndexList indexList = tab_widget_->selectionModel()->selectedRows();
for (int i = 0; i < indexList.size(); ++i) {
out.emplace_back(new OperElement(get_element_by_row(indexList[i].row()), indexList[i].row()));
}
break;
}
break;
}
}
}
@ -838,6 +924,104 @@ void MainWidget::backup_file()
}
}
void MainWidget::base_init(const QString& cur_config)
{
StrVec_t vec;
ini_oper_->get_all_node(vec);
QStringList list;
bool have = false;
for (const auto& data : vec) {
list.append(QString::fromStdString(data));
if (QString::fromStdString(data) == cur_config) {
have = true;
}
}
ui->cbConfig->clear();
if (list.empty()) {
return;
}
ui->cbConfig->addItems(list);
if (have) {
ui->cbConfig->setCurrentIndex(list.indexOf(cur_config));
} else {
ui->cbConfig->setCurrentIndex(0);
}
}
void MainWidget::unit_change()
{
if (u_) {
return;
}
if (unit_change_auto_) {
return;
}
std::string unit = ui->cbUnit->currentText().toStdString();
if (!xml_.get_all_elements(vec_, unit)) {
CUtil::msg(this, u8"获取单元信息失败:" + QString::fromStdString(unit));
return;
}
push_content(vec_);
current_ = vec_;
}
bool MainWidget::format_xml()
{
QFormatSet set;
set.exec();
if (!set.isok_) {
return false;
}
std::string xml_path = set.xml_path_;
if (xml_path.empty()) {
return false;
}
if (!CUtil::affirm(this, u8"确认", u8"重排版内容将会覆盖源文件,请确认是否需要备份,继续?")) {
return false;
}
if (!xml_.handle_save(xml_path, set.values_)) {
CUtil::msg(this, u8"重排版内容失败");
return false;
}
CUtil::msg(this, u8"重排版内容结束");
return true;
}
void MainWidget::clear_tab_widget()
{
if (tab_widget_) {
tab_widget_->setRowCount(0);
if (lay_) {
lay_->removeWidget(tab_widget_);
}
delete tab_widget_;
tab_widget_ = new QTableWidget();
}
}
std::string MainWidget::extract_prefix(const std::string& name)
{
auto pos = name.find('.');
return (pos == std::string::npos) ? name : name.substr(0, pos);
}
bool MainWidget::compare_by_prefix(const SElement_t& se1, const SElement_t& se2)
{
std::string a = extract_prefix(se1.str);
std::string b = extract_prefix(se2.str);
if (a != b) {
return a < b;
}
return se1.str < se2.str; // 按照原始顺序排序
}
OperElement::OperElement(Element_t* ele, int row)
{
element_ = ele;

View File

@ -1,28 +1,38 @@
#ifndef MAINWIDGET_H
#define MAINWIDGET_H
#include <QWidget>
#include <QTableWidget>
#include <QMenu>
#include <QAction>
#include <QMenu>
#include <QMessageBox>
#include <QTableWidget>
#include <QWidget>
#include <unordered_map>
#include "src/xml_opr.h"
#include "src/config.h"
#include <QHBoxLayout>
#include "conf_setting.h"
#include "src/attribute_edit.h"
#include "src/config.h"
#include "src/history.h"
#include "src/uhistory.h"
#include "src/xml_opr.h"
struct SElement_t {
SElement_t(Element_t* e, std::string& s);
Element_t* ele;
Element_t* ele;
std::string str;
};
enum ReplaceArea { AREA_SELECT, AREA_ALL_PAGE, AREA_CUR_PAGE, AREA_ALL };
enum ReplaceArea {
AREA_SELECT,
AREA_ALL_PAGE,
AREA_CUR_PAGE,
AREA_ALL
};
struct OperElement {
OperElement(Element_t* ele, int row);
Element_t* element_{};
int row_{0};
int row_{0};
};
QT_BEGIN_NAMESPACE
@ -43,10 +53,12 @@ public:
public:
void set_work_exe(char* path);
void generate_table_widget();
void push_content(const std::vector<Element_t*>& eles, std::size_t page = 1);
void push_content(const std::vector<Element_t*>& eles, std::size_t page = 1,
bool auto_jump_pre = false);
private:
void read(const QString& file_path);
bool read(const QString& file_path);
void clear_data();
void search(const QString& key);
void item_changed_handle(QTableWidgetItem* item);
void save();
@ -56,14 +68,22 @@ private:
void reset();
void judge_btn_page();
void copy_key();
bool edit_property(Element_t* target, int row);
bool edit_property(Element_t* target, int row, bool is_copy);
void init_menu();
void ele_update_gui(Element_t* target, int row);
void ele_update_gui(Element_t* target, const QString& pre_value = "");
void show_custom_menu();
void sort_by_repeat(std::vector<Element_t*>& vec);
void copy_multi_data();
void replace_content(bool is_common = true);
void backup_file();
void base_init(const QString& cur_config);
void unit_change();
bool format_xml();
void clear_tab_widget();
private:
std::string extract_prefix(const std::string& name);
bool compare_by_prefix(const SElement_t& se1, const SElement_t& se2);
protected:
void closeEvent(QCloseEvent* event);
@ -75,36 +95,42 @@ private:
void get_related_elements(std::vector<OperElement*>& out, ReplaceArea area);
private:
Element_t* get_element_by_key(const QString& key);
Element_t* get_element_by_row(int row);
Element_t* get_current_select_key();
Element_t* get_element_by_key(const QString& key);
Element_t* get_element_by_row(int row);
Element_t* get_current_select_key();
QTableWidgetItem* get_current_select_item();
private:
std::shared_ptr<QFontMetrics> metrics_;
std::shared_ptr<QFontMetrics> metrics_;
private:
QMenu* menu_simple_{};
QMenu* menu_multi_{};
QAction* ac_edit_property_{};
QAction* ac_copy_curline_{};
QAction* ac_del_curline_{};
QAction* ac_copy_key_{};
Ui::MainWidget* ui;
ConfigIni ini_{};
CXmlOpr xml_{};
std::string exe_path_{};
QTableWidget* tab_widget_{};
std::vector<Element_t*> vec_{};
std::vector<Element_t*> current_{};
QMenu* menu_simple_{};
QMenu* menu_multi_{};
QAction* ac_edit_property_{};
QAction* ac_copy_curline_{};
QAction* ac_del_curline_{};
QAction* ac_copy_key_{};
Ui::MainWidget* ui;
CXmlOpr xml_{};
std::string exe_path_{};
QTableWidget* tab_widget_{};
std::vector<Element_t*> vec_{};
std::vector<Element_t*> current_{};
std::vector<std::string> keys_{};
bool auto_add_{false};
std::size_t cur_page_{1};
std::size_t all_page_{1};
CAttributeEdit* attri_edit_{};
OprBase base_{};
long allow_max_with_{500};
long blank_with_{50};
ump_t col_with_{};
bool auto_add_{false};
std::size_t cur_page_{1};
std::size_t all_page_{1};
CAttributeEdit* attri_edit_{};
long allow_max_with_{500};
long blank_with_{50};
ump_t col_with_{};
CGroupSetting* group_set_{};
CGroupIni* ini_oper_{};
CHistory* his_{};
OneGroupIni cur_config_{};
bool u_{false};
bool alreay_open_{false};
QHBoxLayout* lay_{};
bool unit_change_auto_{true};
};
#endif // MAINWIDGET_H

View File

@ -6,8 +6,8 @@
<rect>
<x>0</x>
<y>0</y>
<width>1048</width>
<height>682</height>
<width>1139</width>
<height>591</height>
</rect>
</property>
<property name="windowTitle">
@ -20,6 +20,13 @@
<string>1基本信息</string>
</property>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QPushButton" name="btnHis">
<property name="text">
<string>历史</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnSelectFile">
<property name="text">
@ -28,7 +35,17 @@
</widget>
</item>
<item>
<widget class="QLineEdit" name="edStatus"/>
<widget class="QPushButton" name="btnFormat">
<property name="text">
<string>重排版(单独)</string>
</property>
</widget>
</item>
<item>
<widget class="QCustomQLineEdit" name="edStatus"/>
</item>
<item>
<widget class="QComboBox" name="cbConfig"/>
</item>
<item>
<widget class="QPushButton" name="btnRead">
@ -70,7 +87,7 @@
<item>
<widget class="Line" name="line">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
</widget>
</item>
@ -108,14 +125,14 @@
<item>
<widget class="QPushButton" name="btnReplace">
<property name="text">
<string>一般替</string>
<string>一般替</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnRxReplace">
<property name="text">
<string>正则替</string>
<string>正则替</string>
</property>
</widget>
</item>
@ -125,14 +142,14 @@
<item>
<widget class="Line" name="line_2">
<property name="orientation">
<enum>Qt::Vertical</enum>
<enum>Qt::Orientation::Vertical</enum>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbCaseSensitive">
<property name="text">
<string>区分大小</string>
<string>区分大小</string>
</property>
</widget>
</item>
@ -206,9 +223,32 @@
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<widget class="QComboBox" name="cbUnit"/>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnSet">
<property name="text">
<string>配置设置</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@ -289,6 +329,13 @@
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QCustomQLineEdit</class>
<extends>QLineEdit</extends>
<header>QCustomQLineEdit.h</header>
</customwidget>
</customwidgets>
<tabstops>
<tabstop>btnSelectFile</tabstop>
<tabstop>edStatus</tabstop>

View File

@ -4,4 +4,4 @@
# 编译环境
`msvc Qt5.14.2``vs2017` 环境下通过
`windows`下,`Qt6`可正常使用无乱码

2
build.sh Executable file
View File

@ -0,0 +1,2 @@
cmake -Bbuild -DCMAKE_BUILD_TYPE=Release
cmake --build build --config Release

143
conf_setting.cpp Normal file
View File

@ -0,0 +1,143 @@
#include "conf_setting.h"
#include "public_def.h"
#include "ui_conf_setting.h"
CGroupSetting::CGroupSetting(QWidget* parent, CGroupIni* oper) : QDialog(parent), ui(new Ui::CGroupSetting)
{
ini_opr_ = oper;
ui->setupUi(this);
setWindowTitle(u8"配置编辑");
connect(ui->btnAddConfig, &QPushButton::clicked, this, [&]() { add_item(); });
connect(ui->btnDelConfig, &QPushButton::clicked, this, [&]() { del_item(); });
connect(ui->btnExit, &QPushButton::clicked, this, [&]() { close(); });
connect(ui->cbConfig, &QComboBox::currentTextChanged, this, [&](const QString& content) { change_ini(); });
}
CGroupSetting::~CGroupSetting()
{
delete ui;
}
void CGroupSetting::showEvent(QShowEvent* event)
{
update_ini("");
QDialog::showEvent(event);
}
void CGroupSetting::add_item()
{
if (!CUtil::affirm(this, u8"确认", u8"确认添加/更新吗?")) {
return;
}
QString config_name = ui->edConfigName->text();
config_name = config_name.trimmed();
if (config_name.isEmpty()) {
CUtil::msg(this, u8"配置名为空");
return;
}
// 验证重名
// 添加
OneGroupIni gp;
gp.name = config_name.toStdString();
gp.item_key = ui->edItemKey->text().toStdString();
gp.main_nodes = ui->edMainPath->text().toStdString();
gp.relative_nodes = ui->edRelativePath->text().toStdString();
gp.max_col_len = ui->edMaxColLen->text().toLong();
gp.max_blank_add = ui->edMaxFillLen->text().toLong();
gp.propertis = ui->edProperties->text().toStdString();
gp.is_same = ui->chbIsSame->isChecked();
if (!ini_opr_->add_item(gp)) {
CUtil::msg(this, u8"失败");
return;
}
update_ini(QString::fromStdString(gp.name));
CUtil::msg(this, u8"成功");
}
void CGroupSetting::del_item()
{
if (!CUtil::affirm(this, u8"确认", u8"确认删除吗?")) {
return;
}
std::string key = ui->cbConfig->currentText().toStdString();
if (!ini_opr_->del_item(key)) {
CUtil::msg(this, u8"失败");
return;
}
// 删除成功之后要更新 cb
update_ini("");
CUtil::msg(this, u8"成功");
}
void CGroupSetting::set_ui(const OneGroupIni& gp)
{
ui->edConfigName->setText(QString::fromStdString(gp.name));
ui->edItemKey->setText(QString::fromStdString(gp.item_key));
ui->edMainPath->setText(QString::fromStdString(gp.main_nodes));
ui->edRelativePath->setText(QString::fromStdString(gp.relative_nodes));
ui->edMaxColLen->setText(QString::number(gp.max_col_len));
ui->edMaxFillLen->setText(QString::number(gp.max_blank_add));
ui->edProperties->setText(QString::fromStdString(gp.propertis));
if (gp.is_same) {
ui->chbIsSame->setChecked(true);
} else {
ui->chbIsSame->setChecked(false);
}
}
void CGroupSetting::change_ini()
{
if (auto_add_) {
return;
}
QString name_key = ui->cbConfig->currentText();
OneGroupIni gp;
gp.name = name_key.toStdString();
if (!ini_opr_->get_item(gp)) {
CUtil::msg(this, u8"加载" + ui->cbConfig->currentText() + "失败");
} else {
set_ui(gp);
}
}
void CGroupSetting::update_ini(const QString& cur_key)
{
StrVec_t vec;
ini_opr_->get_all_node(vec);
QStringList list;
bool has_cur = false;
for (const auto& data : vec) {
list.append(QString::fromStdString(data));
if (data == cur_key.toStdString()) {
has_cur = true;
}
}
auto_add_ = true;
ui->cbConfig->clear();
if (!list.empty()) {
ui->cbConfig->addItems(list);
if (has_cur) {
ui->cbConfig->setCurrentIndex(list.indexOf(cur_key));
} else {
ui->cbConfig->setCurrentIndex(0);
}
OneGroupIni gp;
gp.name = ui->cbConfig->currentText().toStdString();
if (!ini_opr_->get_item(gp)) {
CUtil::msg(this, u8"加载" + ui->cbConfig->currentText() + "失败");
} else {
set_ui(gp);
}
}
auto_add_ = false;
}

36
conf_setting.h Normal file
View File

@ -0,0 +1,36 @@
#ifndef CONF_SETTING_H
#define CONF_SETTING_H
#include <QDialog>
#include "src/config.h"
namespace Ui {
class CGroupSetting;
}
class CGroupSetting : public QDialog
{
Q_OBJECT
public:
explicit CGroupSetting(QWidget* parent, CGroupIni* oper);
~CGroupSetting();
protected:
void showEvent(QShowEvent* event) override;
private:
void add_item();
void del_item();
void set_ui(const OneGroupIni& gp);
void change_ini();
void update_ini(const QString& cur_key);
private:
bool auto_add_{false};
Ui::CGroupSetting* ui;
CGroupIni* ini_opr_{};
};
#endif // CONF_SETTING_H

147
conf_setting.ui Normal file
View File

@ -0,0 +1,147 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CGroupSetting</class>
<widget class="QWidget" name="CGroupSetting">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>799</width>
<height>530</height>
</rect>
</property>
<property name="windowTitle">
<string>Form</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QLabel" name="label">
<property name="text">
<string>配置选择:</string>
</property>
</widget>
</item>
<item>
<widget class="QComboBox" name="cbConfig"/>
</item>
<item>
<widget class="QLabel" name="label_2">
<property name="text">
<string>名称:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="edConfigName"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_2">
<item>
<widget class="QLabel" name="label_3">
<property name="text">
<string>主节点路径:</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="chbIsSame">
<property name="text">
<string>是否是相同结构</string>
</property>
</widget>
</item>
</layout>
</item>
<item>
<widget class="QLineEdit" name="edMainPath"/>
</item>
<item>
<widget class="QLabel" name="label_4">
<property name="text">
<string>操作节点路径(相对主节点,没有不填写):</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="edRelativePath"/>
</item>
<item>
<widget class="QLabel" name="label_5">
<property name="text">
<string>子项头名称:</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="edItemKey"/>
</item>
<item>
<widget class="QLabel" name="label_6">
<property name="text">
<string>操作属性列表(半角逗号分隔)::</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="edProperties"/>
</item>
<item>
<widget class="QLabel" name="label_7">
<property name="text">
<string>列最大宽度(默认1000):</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="edMaxColLen"/>
</item>
<item>
<widget class="QLabel" name="label_8">
<property name="text">
<string>单元右侧空白填充宽度(默认60):</string>
</property>
</widget>
</item>
<item>
<widget class="QLineEdit" name="edMaxFillLen"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<spacer name="horizontalSpacer">
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnAddConfig">
<property name="text">
<string>新增/更新</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnDelConfig">
<property name="text">
<string>删除</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnExit">
<property name="text">
<string>退出</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

87
form/qformatset.cpp Normal file
View File

@ -0,0 +1,87 @@
#include "qformatset.h"
#include "../public_def.h"
#include "ui_qformatset.h"
QFormatSet::QFormatSet(QWidget* parent)
: QDialog(parent), ui(new Ui::QFormatSet)
{
ui->setupUi(this);
connect(ui->btnOk, &QPushButton::clicked, this, [&]() { handle(); });
connect(ui->btnCancel, &QPushButton::clicked, this, [&]() {
isok_ = false;
close();
});
connect(ui->cbAll, &QCheckBox::toggled, this, [&]() { check_select(); });
connect(ui->btnSelect, &QPushButton::clicked, this, [&]() {
QString file = CUtil::select_file(this, u8"请选择xml文件",
u8"XML(*.xml);;所有文件 (*)");
if (file.isEmpty()) {
return;
}
ui->edXmlPath->setText(file);
});
}
QFormatSet::~QFormatSet()
{
delete ui;
}
void QFormatSet::handle()
{
values_.clear();
if (ui->cbAdd->isChecked()) {
values_.push_back("+");
}
if (ui->cbAnd->isChecked()) {
values_.push_back("&&");
}
if (ui->cbOr->isChecked()) {
values_.push_back("||");
}
if (ui->cbMul->isChecked()) {
values_.push_back("*");
}
if (ui->cbSub->isChecked()) {
values_.push_back("-");
}
if (ui->cbDiv->isChecked()) {
values_.push_back("/");
}
if (ui->cbLess->isChecked()) {
values_.push_back("<");
}
if (ui->cbMore->isChecked()) {
values_.push_back(">");
}
if (ui->cbEq->isChecked()) {
values_.push_back("==");
}
if (ui->cbNotEq->isChecked()) {
values_.push_back("!=");
}
xml_path_ = ui->edXmlPath->text().toStdString();
isok_ = true;
close();
}
void QFormatSet::check_select()
{
auto set_check = [&](QCheckBox* ed, bool check) {
if (ed) {
ed->setChecked(check);
}
};
bool check = ui->cbAll->isChecked();
set_check(ui->cbAdd, check);
set_check(ui->cbSub, check);
set_check(ui->cbMul, check);
set_check(ui->cbDiv, check);
set_check(ui->cbLess, check);
set_check(ui->cbMore, check);
set_check(ui->cbOr, check);
set_check(ui->cbAnd, check);
set_check(ui->cbEq, check);
set_check(ui->cbNotEq, check);
}

32
form/qformatset.h Normal file
View File

@ -0,0 +1,32 @@
#ifndef QFORMATSET_H
#define QFORMATSET_H
#include <QDialog>
#include <string>
namespace Ui {
class QFormatSet;
}
class QFormatSet : public QDialog
{
Q_OBJECT
public:
explicit QFormatSet(QWidget *parent = nullptr);
~QFormatSet();
private:
void handle();
void check_select();
private:
Ui::QFormatSet *ui;
public:
std::vector<std::string> values_{};
std::string xml_path_{};
bool isok_{false};
};
#endif // QFORMATSET_H

202
form/qformatset.ui Normal file
View File

@ -0,0 +1,202 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>QFormatSet</class>
<widget class="QDialog" name="QFormatSet">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>529</width>
<height>200</height>
</rect>
</property>
<property name="windowTitle">
<string>重排版</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_3">
<item>
<widget class="QGroupBox" name="groupBox">
<property name="title">
<string>操作</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QCustomQLineEdit" name="edXmlPath"/>
</item>
<item>
<widget class="QPushButton" name="btnSelect">
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<widget class="QGroupBox" name="groupBox_2">
<property name="title">
<string>设置值内容指定字符前后空格</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout_2">
<item>
<layout class="QHBoxLayout" name="horizontalLayout_4">
<item>
<widget class="QCheckBox" name="cbAnd">
<property name="text">
<string>与(双&amp;&amp;)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbOr">
<property name="text">
<string>或(||)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbLess">
<property name="text">
<string>小于(&lt;)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbMore">
<property name="text">
<string>大于(&gt;)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_5">
<item>
<widget class="QCheckBox" name="cbAdd">
<property name="text">
<string>加(+)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbSub">
<property name="text">
<string>减(-)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbMul">
<property name="text">
<string>乘(*)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbDiv">
<property name="text">
<string>除(/)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbEq">
<property name="text">
<string>等(==)</string>
</property>
</widget>
</item>
<item>
<widget class="QCheckBox" name="cbNotEq">
<property name="text">
<string>不等(!=)</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_3">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
</layout>
</item>
</layout>
</widget>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout_3">
<item>
<widget class="QCheckBox" name="cbAll">
<property name="text">
<string>全选</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnOk">
<property name="text">
<string>确认</string>
</property>
</widget>
</item>
<item>
<widget class="QPushButton" name="btnCancel">
<property name="text">
<string>取消</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<customwidgets>
<customwidget>
<class>QCustomQLineEdit</class>
<extends>QLineEdit</extends>
<header>QCustomQLineEdit.h</header>
</customwidget>
</customwidgets>
<resources/>
<connections/>
</ui>

View File

@ -1,19 +1,25 @@
#include "MainWidget.h"
#include <QApplication>
#include <clocale>
#include "MainWidget.h"
int main(int argc, char *argv[])
{
setlocale(LC_ALL, ".utf-8");
QApplication a(argc, argv);
#ifdef _WIN32
QFont font("Microsoft YaHei", 9);
a.setFont(font);
a.setStyle("fusion");
#else
//a.setStyle("fusion");
a.setStyle("windows");
#endif
#if (QT_VERSION < QT_VERSION_CHECK(6, 0, 0))
QCoreApplication::setAttribute(Qt::AA_EnableHighDpiScaling);
#endif
MainWidget w;
w.set_work_exe(argv[0]);
w.show();

View File

@ -1,6 +1,7 @@
#include "public_def.h"
#include <QMessageBox>
#include <QFileDialog>
#include <QMessageBox>
#ifdef _WIN32
#include <windows.h>
@ -11,7 +12,8 @@ void CUtil::msg(QWidget* parent, const QString& content)
QMessageBox::information(parent, u8"提示", content);
}
bool CUtil::affirm(QWidget* parent, const QString& titile, const QString& content)
bool CUtil::affirm(QWidget* parent, const QString& titile,
const QString& content)
{
QMessageBox questionBox(parent);
questionBox.setText(content);
@ -26,9 +28,11 @@ bool CUtil::affirm(QWidget* parent, const QString& titile, const QString& conten
}
}
QString CUtil::select_file(QWidget* parent, const QString& info, const QString& filter)
QString CUtil::select_file(QWidget* parent, const QString& info,
const QString& filter)
{
QString filePath = QFileDialog::getOpenFileName(parent, info, QDir::homePath(), filter);
QString filePath =
QFileDialog::getOpenFileName(parent, info, QDir::homePath(), filter);
return filePath;
}
@ -37,7 +41,7 @@ void CUtil::sort_by_repeat(std::vector<std::string>& vec)
std::size_t len1 = 0;
std::size_t len2 = 0;
std::size_t cur = 0;
auto compare = [&](const std::string& str1, const std::string& str2) {
auto compare = [&](const std::string& str1, const std::string& str2) {
len1 = str1.size();
len2 = str2.size();
if (cur >= len1 || cur >= len2) {
@ -58,22 +62,26 @@ void CUtil::sort_by_repeat(std::vector<std::string>& vec)
std::string CUtil::utf8_to_gbk(const std::string& utf8_str)
{
// UTF-8 to Wide Char (UTF-16)
int wide_char_len = MultiByteToWideChar(CP_UTF8, 0, utf8_str.c_str(), -1, nullptr, 0);
int wide_char_len =
MultiByteToWideChar(CP_UTF8, 0, utf8_str.c_str(), -1, nullptr, 0);
if (wide_char_len == 0) {
return "";
}
std::wstring wide_str(wide_char_len, 0);
MultiByteToWideChar(CP_UTF8, 0, utf8_str.c_str(), -1, &wide_str[0], wide_char_len);
MultiByteToWideChar(CP_UTF8, 0, utf8_str.c_str(), -1, &wide_str[0],
wide_char_len);
// Wide Char (UTF-16) to GBK
int gbk_len = WideCharToMultiByte(CP_ACP, 0, wide_str.c_str(), -1, nullptr, 0, nullptr, nullptr);
int gbk_len = WideCharToMultiByte(CP_ACP, 0, wide_str.c_str(), -1, nullptr,
0, nullptr, nullptr);
if (gbk_len == 0) {
return "";
}
std::string gbk_str(gbk_len, 0);
WideCharToMultiByte(CP_ACP, 0, wide_str.c_str(), -1, &gbk_str[0], gbk_len, nullptr, nullptr);
WideCharToMultiByte(CP_ACP, 0, wide_str.c_str(), -1, &gbk_str[0], gbk_len,
nullptr, nullptr);
return gbk_str;
}
@ -84,13 +92,13 @@ std::string CUtil::utf8_to_gbk(const std::string& utf8_str)
}
#endif
std::vector<std::string> CUtil::splitString(const std::string& input, const std::string& delimiter)
std::vector<std::string> CUtil::splitString(const std::string& input,
const std::string& delimiter)
{
std::vector<std::string> tokens;
size_t pos = 0;
std::string backup = input;
std::string token;
size_t pos = 0;
std::string backup = input;
std::string token;
while ((pos = backup.find(delimiter)) != std::string::npos) {
token = backup.substr(0, pos);
@ -102,4 +110,3 @@ std::vector<std::string> CUtil::splitString(const std::string& input, const std:
return tokens;
}

View File

@ -1,18 +1,9 @@
#ifndef PUBLIC_DEF_HEADER
#define PUBLIC_DEF_HEADER
#include <QWidget>
#include <string>
#include <vector>
#include <QWidget>
struct OprBase {
std::string node_path{};
std::string the_node{};
std::string purpose{};
std::string xml_path{};
long allow_max_width{500};
long blank_width{50};
};
class CUtil
{
@ -21,14 +12,17 @@ public:
~CUtil() = default;
public:
static void msg(QWidget* parent, const QString& content);
static bool affirm(QWidget* parent, const QString& titile, const QString& content);
static QString select_file(QWidget* parent, const QString& info, const QString& filter);
static void sort_by_repeat(std::vector<std::string>& vec);
static void msg(QWidget* parent, const QString& content);
static bool affirm(QWidget* parent, const QString& titile,
const QString& content);
static QString select_file(QWidget* parent, const QString& info,
const QString& filter);
static void sort_by_repeat(std::vector<std::string>& vec);
public:
static std::string utf8_to_gbk(const std::string& utf8_str);
static std::vector<std::string> splitString(const std::string& input, const std::string& delimiter);
static std::string utf8_to_gbk(const std::string& utf8_str);
static std::vector<std::string> splitString(const std::string& input,
const std::string& delimiter);
};
#endif

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.8 KiB

After

Width:  |  Height:  |  Size: 17 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 9.1 KiB

36
src/QCustomQLineEdit.cpp Normal file
View File

@ -0,0 +1,36 @@
#include "QCustomQLineEdit.h"
QCustomQLineEdit::QCustomQLineEdit(QWidget* parent) : QLineEdit(parent)
{
setAcceptDrops(true);
}
void QCustomQLineEdit::dragEnterEvent(QDragEnterEvent* event)
{
if (event->mimeData()->hasUrls()) {
event->acceptProposedAction();
}
//QLineEdit::dragEnterEvent(event);
}
void QCustomQLineEdit::dragMoveEvent(QDragMoveEvent* event)
{
}
void QCustomQLineEdit::dropEvent(QDropEvent* event)
{
const QMimeData* mimeData = event->mimeData();
if (mimeData->hasUrls()) {
QList<QUrl> urls = mimeData->urls();
if (urls.size() > 0) {
QString file_name = urls.at(0).toLocalFile();
setText(file_name);
event->accept();
}
}
//QLineEdit::dropEvent(event);
}
QCustomQLineEdit::~QCustomQLineEdit()
{
}

27
src/QCustomQLineEdit.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef QCUSTOMQLINE
#define QCUSTOMQLINE
#include <QLineEdit>
#include <QDropEvent>
#include <QMimeData>
#include <QDragEnterEvent>
class QCustomQLineEdit : public QLineEdit
{
Q_OBJECT
public:
QCustomQLineEdit(QWidget* parent = nullptr);
~QCustomQLineEdit() override;
protected:
// 拖动文件到窗口 触发
void dragEnterEvent(QDragEnterEvent* event) override;
// 拖动文件到窗口移动文件 触发
void dragMoveEvent(QDragMoveEvent* event) override;
// 拖动文件到窗口释放文件触发
void dropEvent(QDropEvent* event) override;
};
#endif

View File

@ -1,7 +1,9 @@
#include "attribute_edit.h"
#include "ui_attribute_edit.h"
CAttributeEdit::CAttributeEdit(QWidget* parent) : QDialog(parent), ui(new Ui::CAttributeEdit)
CAttributeEdit::CAttributeEdit(QWidget* parent)
: QDialog(parent), ui(new Ui::CAttributeEdit)
{
ui->setupUi(this);
@ -22,13 +24,13 @@ void CAttributeEdit::handle_ok()
for (int i = 0; i < row; ++i) {
QString key = table_->item(i, 0)->text();
QString value = table_->item(i, 1)->text();
property_.emplace_back(key.toLocal8Bit().constData(), value.toLocal8Bit().constData());
property_.emplace_back(key.toStdString().c_str(),
value.toStdString().c_str());
}
is_ok_ = true;
close();
}
CAttributeEdit::~CAttributeEdit()
{
delete ui;
@ -59,7 +61,7 @@ void CAttributeEdit::show_before()
is_ok_ = false;
for(auto i = 0; i < property_.size(); ++i) {
for (auto i = 0; i < property_.size(); ++i) {
int row = table_->rowCount();
table_->insertRow(row);
@ -87,9 +89,10 @@ void CAttributeEdit::init_table()
table_->setColumnCount(list.size());
table_->setHorizontalHeaderLabels(list);
table_->setSelectionBehavior(QAbstractItemView::SelectRows);
table_->setSelectionMode(QAbstractItemView::SelectionMode::SingleSelection);
table_->setSelectionMode(
QAbstractItemView::SelectionMode::SingleSelection);
table_->setColumnWidth(0, 100);
table_->setColumnWidth(1, 250);
table_->setColumnWidth(1, 550);
QHBoxLayout* ly = new QHBoxLayout();
ly->addWidget(table_);
ui->widget->setLayout(ly);
@ -97,4 +100,4 @@ void CAttributeEdit::init_table()
table_->clearContents();
table_->setRowCount(0);
}
}
}

View File

@ -3,6 +3,7 @@
#include <QDialog>
#include <QTableWidget>
#include "xml_opr.h"
namespace Ui {
@ -30,13 +31,13 @@ private:
void handle_ok();
public:
bool is_ok_{ false };
bool is_ok_{false};
private:
Ui::CAttributeEdit* ui;
Property_t property_{};
QTableWidget* table_{};
bool is_key_edit_{true};
Property_t property_{};
QTableWidget* table_{};
bool is_key_edit_{true};
};
#endif // ATTRIBUTE_EDIT_H

View File

@ -6,7 +6,7 @@
<rect>
<x>0</x>
<y>0</y>
<width>318</width>
<width>769</width>
<height>618</height>
</rect>
</property>
@ -29,7 +29,7 @@
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Horizontal</enum>
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
@ -42,7 +42,7 @@
<item>
<widget class="QPushButton" name="btnOk">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
<enum>Qt::FocusPolicy::NoFocus</enum>
</property>
<property name="text">
<string>确认</string>
@ -52,7 +52,7 @@
<item>
<widget class="QPushButton" name="btnCancel">
<property name="focusPolicy">
<enum>Qt::NoFocus</enum>
<enum>Qt::FocusPolicy::NoFocus</enum>
</property>
<property name="text">
<string>取消</string>

View File

@ -1,53 +1,104 @@
#include "config.h"
#include <QDir>
#include <filesystem>
namespace fs = std::filesystem;
bool ConfigIni::set_work_exe(const std::string& dir)
CGroupIni::CGroupIni()
{
work_dir_ = dir;
default_set();
}
auto ini_path = fs::path(work_dir_).parent_path().append("xmlopr.ini");
if (!fs::exists(ini_path)) {
return false;
void CGroupIni::default_set()
{
QDir dir;
std::string path = dir.homePath().toStdString();
fs::path p(path);
p.append(".config/OneLevelXmlOpr");
if (!fs::exists(p)) {
fs::create_directories(p);
}
ini_path_ = ini_path.string();
if (!parse_ini()) {
work_dir_ = p.string();
p.append("OneLevelXmlOpr.ini");
work_file_ = p.string();
}
bool CGroupIni::load_ini()
{
SI_Error rc = ini_.LoadFile(work_file_.c_str());
if (rc != SI_OK) {
rc = ini_.SaveFile(work_file_.c_str());
if (rc < 0) {
return false;
}
return true;
}
return true;
}
void CGroupIni::get_all_node(StrVec_t& vec)
{
vec.clear();
CSimpleIniA::TNamesDepend secs;
ini_.GetAllSections(secs);
for (const auto& sec : secs) {
vec.push_back(sec.pItem);
}
}
bool CGroupIni::add_item(const OneGroupIni& group)
{
ini_.SetValue(group.name.c_str(), "MainNodes", group.main_nodes.c_str());
ini_.SetValue(group.name.c_str(), "RelativeNodes", group.relative_nodes.c_str());
ini_.SetValue(group.name.c_str(), "ItemKey", group.item_key.c_str());
ini_.SetValue(group.name.c_str(), "Properties", group.propertis.c_str());
ini_.SetLongValue(group.name.c_str(), "MaxColLen", group.max_col_len);
ini_.SetLongValue(group.name.c_str(), "MaxBlankAdd", group.max_blank_add);
ini_.SetBoolValue(group.name.c_str(), "IsSameStruct", group.is_same);
if (ini_.SaveFile(work_file_.c_str()) != SI_OK) {
return false;
}
return true;
}
bool ConfigIni::set_xml_path(const std::string& path)
bool CGroupIni::get_item(OneGroupIni& group)
{
if (ini_.IsEmpty()) {
StrVec_t vec;
get_all_node(vec);
bool find = false;
for (const auto& item : vec) {
if (group.name != item) {
continue;
}
find = true;
break;
}
if (!find) {
return false;
}
ini_.SetValue("Basic", "xml_path", path.c_str());
if (ini_.SaveFile(ini_path_.c_str()) != SI_OK) {
group.main_nodes = ini_.GetValue(group.name.c_str(), "MainNodes");
group.relative_nodes = ini_.GetValue(group.name.c_str(), "RelativeNodes");
group.item_key = ini_.GetValue(group.name.c_str(), "ItemKey");
group.propertis = ini_.GetValue(group.name.c_str(), "Properties");
group.max_col_len = ini_.GetLongValue(group.name.c_str(), "MaxColLen");
group.max_blank_add = ini_.GetLongValue(group.name.c_str(), "MaxBlankAdd");
group.is_same = ini_.GetBoolValue(group.name.c_str(), "IsSameStruct");
return true;
}
bool CGroupIni::del_item(const std::string& key)
{
ini_.Delete(key.c_str(), nullptr);
if (ini_.SaveFile(work_file_.c_str()) != SI_OK) {
return false;
}
return true;
}
OprBase ConfigIni::get_config()
{
return opr_base_;
}
bool ConfigIni::parse_ini()
{
if (ini_.LoadFile(ini_path_.c_str()) != SI_OK) {
return false;
}
ini_.SetUnicode();
opr_base_.node_path = ini_.GetValue("Basic", "oper_node");
opr_base_.purpose = ini_.GetValue("Basic", "purpose");
opr_base_.the_node = ini_.GetValue("Basic", "the_node");
opr_base_.xml_path = ini_.GetValue("Basic", "xml_path");
opr_base_.allow_max_width = ini_.GetLongValue("Basic", "max_col_width");
opr_base_.blank_width = ini_.GetLongValue("Basic", "blank_width");
return true;
}

View File

@ -1,10 +1,10 @@
#ifndef CONIFG_HEADER
#define CONIFG_HEADER
#include <string>
#include <SimpleIni.h>
#include "../public_def.h"
#include <string>
#include <vector>
/*
[Basic]
@ -12,25 +12,37 @@ oper_node=IODEF/ITEMS
*/
class ConfigIni
using StrVec_t = std::vector<std::string>;
struct OneGroupIni {
std::string name;
std::string main_nodes;
std::string relative_nodes;
std::string item_key;
std::string propertis;
long max_col_len{1000};
long max_blank_add{60};
bool is_same;
};
class CGroupIni
{
public:
ConfigIni() = default;
~ConfigIni() = default;
CGroupIni();
public:
bool set_work_exe(const std::string& dir);
bool set_xml_path(const std::string& path);
OprBase get_config();
bool load_ini();
void get_all_node(StrVec_t& vec);
bool add_item(const OneGroupIni& group);
bool get_item(OneGroupIni& group);
bool del_item(const std::string& key);
private:
bool parse_ini();
void default_set();
private:
std::string work_dir_{};
std::string ini_path_{};
std::string work_file_{};
CSimpleIniA ini_{};
OprBase opr_base_{};
};
#endif

View File

@ -1,11 +1,14 @@
#include "data_edit.h"
#include "ui_data_edit.h"
#include <QScreen>
#include <QClipboard>
#include <tinyxml2.h>
#include <vector>
#include <QClipboard>
#include <QScreen>
#include <string>
#include <vector>
#include "../public_def.h"
#include "ui_data_edit.h"
CDataEdit::CDataEdit(QWidget* parent) : QDialog(parent), ui(new Ui::CDataEdit)
{
@ -16,7 +19,8 @@ CDataEdit::CDataEdit(QWidget* parent) : QDialog(parent), ui(new Ui::CDataEdit)
connect(ui->btnExit, &QPushButton::clicked, this, [&]() { close(); });
connect(ui->btnReplace, &QPushButton::clicked, this, [&]() { replace(); });
connect(ui->btnWithDraw, &QPushButton::clicked, this, [&]() { with_draw(); });
connect(ui->btnWithDraw, &QPushButton::clicked, this,
[&]() { with_draw(); });
connect(ui->btnAdd, &QPushButton::clicked, this, [&]() { import_data(); });
connect(ui->btnCopy, &QPushButton::clicked, this, [&]() {
QClipboard* clip = QApplication::clipboard();
@ -53,12 +57,13 @@ void CDataEdit::import_data()
return;
}
if (!CUtil::affirm(this, u8"提示", u8"如果出现重复的 key 将跳过,继续吗?")) {
if (!CUtil::affirm(this, u8"提示",
u8"如果出现重复的 key 将跳过,继续吗?")) {
return;
}
std::vector<std::string> valid_data{};
QStringList list = data.trimmed().split("\n");
QStringList list = data.trimmed().split("\n");
for (int i = 0; i < list.size(); ++i) {
const QString& item = list[i];
if (item.trimmed().isEmpty()) {
@ -70,13 +75,15 @@ void CDataEdit::import_data()
}
valid_data.push_back(item.toStdString());
}
auto task_count = valid_data.size();
auto task_count = valid_data.size();
std::size_t success_count{};
if (!xml_opr_->import_newer_data(valid_data, success_count)) {
CUtil::msg(this, u8"导入失败。");
return;
}
QString info = QString(u8"需要导入 %1 条数据,成功导入 %2 条。").arg(task_count).arg(success_count);
QString info = QString(u8"需要导入 %1 条数据,成功导入 %2 条。")
.arg(task_count)
.arg(success_count);
CUtil::msg(this, info);
close();
is_import_sucess_ = true;
@ -91,7 +98,7 @@ void CDataEdit::showEvent(QShowEvent* event)
void CDataEdit::show_before()
{
QScreen* primaryScreen = QGuiApplication::primaryScreen();
QRect screenGeometry = primaryScreen->geometry();
QRect screenGeometry = primaryScreen->geometry();
setMinimumWidth(screenGeometry.width() * 0.8);
if (is_import_) {
ui->btnCopy->setVisible(false);

View File

@ -39,8 +39,8 @@ public:
private:
Ui::CDataEdit* ui;
QString data_{};
CXmlOpr* xml_opr_{};
QString data_{};
CXmlOpr* xml_opr_{};
};
#endif // DATA_EDIT_H

81
src/history.cpp Normal file
View File

@ -0,0 +1,81 @@
#include "history.h"
#include <QDir>
#include <algorithm>
#include <filesystem>
#include <fstream>
namespace fs = std::filesystem;
CHistory::CHistory()
{
default_set();
}
bool CHistory::push(const std::string& content)
{
std::vector<std::string> vec;
read_file(vec);
if (std::find(vec.begin(), vec.end(), content) == vec.end()) {
vec.push_back(content);
} else {
return true;
}
if (vec.size() > 10) {
vec.erase(vec.begin());
}
if (!write_file(vec)) {
return false;
}
return true;
}
bool CHistory::get_history(std::vector<std::string>& vec)
{
return read_file(vec);
}
void CHistory::default_set()
{
QDir dir;
std::string path = dir.homePath().toStdString();
fs::path p(path);
p.append(".config/OneLevelXmlOpr");
if (!fs::exists(p)) {
fs::create_directories(p);
}
work_dir_ = p.string();
p.append("OneLevelXmlOpr.history");
work_file_ = p.string();
}
bool CHistory::read_file(std::vector<std::string>& vec)
{
vec.clear();
std::ifstream file(work_file_);
if (!file.is_open()) {
return false;
}
std::string line;
while (std::getline(file, line)) {
vec.push_back(line);
}
return true;
}
bool CHistory::write_file(std::vector<std::string>& vec)
{
std::ofstream file(work_file_);
if (!file.is_open()) {
return false;
}
for (const auto& line : vec) {
file << line << std::endl;
}
file.close();
return true;
}

27
src/history.h Normal file
View File

@ -0,0 +1,27 @@
#ifndef HISTORY_H
#define HISTORY_H
#include <string>
#include <vector>
// 只保留最近的10条数据
class CHistory
{
public:
CHistory();
public:
bool push(const std::string& content);
bool get_history(std::vector<std::string>& vec);
bool read_file(std::vector<std::string>& vec);
bool write_file(std::vector<std::string>& vec);
private:
void default_set();
private:
std::string work_dir_{};
std::string work_file_{};
};
#endif // HISTORY_H

71
src/uhistory.cpp Normal file
View File

@ -0,0 +1,71 @@
#include "uhistory.h"
#include "src/ui_uhistory.h"
#include "ui_uhistory.h"
CUIHistory::CUIHistory(QWidget* parent, CHistory* his) : QDialog(parent), ui(new Ui::CUIHistory)
{
ui->setupUi(this);
his_ = his;
connect(ui->btnExit, &QPushButton::clicked, this, [&]() { close(); });
connect(ui->btnOk, &QPushButton::clicked, this, [&]() { select_ok(); });
connect(ui->btnDel, &QPushButton::clicked, this, [&]() { del_item(); });
connect(ui->listWidget, &QListWidget::doubleClicked, this, [&](const QModelIndex& index) { double_click(index); });
}
CUIHistory::~CUIHistory()
{
delete ui;
}
void CUIHistory::showEvent(QShowEvent* event)
{
std::vector<std::string> vec;
his_->get_history(vec);
QStringList list;
for (const auto& data : vec) {
list.append(QString::fromStdString(data));
}
if (!list.empty()) {
ui->listWidget->addItems(list);
}
cur_.clear();
QDialog::showEvent(event);
}
void CUIHistory::select_ok()
{
auto re = ui->listWidget->selectedItems();
if (re.empty()) {
return;
}
cur_ = re[0]->text();
close();
}
void CUIHistory::del_item()
{
auto re = ui->listWidget->selectedItems();
if (re.empty()) {
return;
}
for (auto& item : re) {
delete ui->listWidget->takeItem(ui->listWidget->row(item));
}
std::vector<std::string> vec;
for (int i = 0; i < ui->listWidget->count(); ++i) {
QListWidgetItem* item = ui->listWidget->item(i);
if (item) {
vec.push_back(item->text().toStdString());
}
}
his_->write_file(vec);
}
void CUIHistory::double_click(const QModelIndex& index)
{
cur_ = index.data().toString();
close();
}

34
src/uhistory.h Normal file
View File

@ -0,0 +1,34 @@
#ifndef UHISTORY_H
#define UHISTORY_H
#include <QDialog>
#include "history.h"
namespace Ui {
class CUIHistory;
}
class CUIHistory : public QDialog
{
Q_OBJECT
public:
explicit CUIHistory(QWidget* parent, CHistory* his);
~CUIHistory();
private:
void showEvent(QShowEvent* event);
void select_ok();
void del_item();
void double_click(const QModelIndex& index);
public:
QString cur_{};
private:
Ui::CUIHistory* ui;
CHistory* his_{};
};
#endif // UHISTORY_H

87
src/uhistory.ui Normal file
View File

@ -0,0 +1,87 @@
<?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0">
<class>CUIHistory</class>
<widget class="QDialog" name="CUIHistory">
<property name="geometry">
<rect>
<x>0</x>
<y>0</y>
<width>561</width>
<height>277</height>
</rect>
</property>
<property name="windowTitle">
<string>历史文件加载</string>
</property>
<layout class="QVBoxLayout" name="verticalLayout">
<item>
<widget class="QListWidget" name="listWidget"/>
</item>
<item>
<layout class="QHBoxLayout" name="horizontalLayout">
<item>
<widget class="QPushButton" name="btnDel">
<property name="text">
<string>删除</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnOk">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>选择</string>
</property>
</widget>
</item>
<item>
<spacer name="horizontalSpacer_2">
<property name="orientation">
<enum>Qt::Orientation::Horizontal</enum>
</property>
<property name="sizeHint" stdset="0">
<size>
<width>40</width>
<height>20</height>
</size>
</property>
</spacer>
</item>
<item>
<widget class="QPushButton" name="btnExit">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Fixed">
<horstretch>0</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="text">
<string>退出</string>
</property>
</widget>
</item>
</layout>
</item>
</layout>
</widget>
<resources/>
<connections/>
</ui>

View File

@ -1,5 +1,11 @@
#include "xml_opr.h"
#include <filesystem>
#include <fstream>
#include <regex>
#include <sstream>
#include "../public_def.h"
namespace fs = std::filesystem;
@ -8,15 +14,20 @@ CXmlOpr::~CXmlOpr() = default;
bool CXmlOpr::open(const std::string& xml_path)
{
#ifdef _WIN32
if (doc_.LoadFile(CUtil::utf8_to_gbk(xml_path).c_str()) != tinyxml2::XML_SUCCESS) {
return false;
}
#else
// #ifdef _WIN32
// if (doc_.LoadFile(CUtil::utf8_to_gbk(xml_path).c_str()) != tinyxml2::XML_SUCCESS) {
// return false;
// }
// xml_path_ = CUtil::utf8_to_gbk(xml_path);
// #else
// if (doc_.LoadFile(xml_path.c_str()) != tinyxml2::XML_SUCCESS) {
// return false;
// }
// xml_path_ = xml_path;
// #endif
if (doc_.LoadFile(xml_path.c_str()) != tinyxml2::XML_SUCCESS) {
return false;
}
#endif
xml_path_ = xml_path;
return true;
}
@ -34,15 +45,30 @@ bool CXmlOpr::backup_file(const std::string& desti_folder, const std::string& ti
return fs::copy_file(xml_path_, des);
}
void CXmlOpr::set_baseinfo(const OprBase& base)
void CXmlOpr::set_baseinfo(const OneGroupIni& base)
{
opr_base_ = base;
}
bool CXmlOpr::get_all_elements(std::vector<Element_t*>& vec)
bool CXmlOpr::get_all_elements(std::vector<Element_t*>& vec, const std::string& unit)
{
vec.clear();
Element_t* purpose_node = parent_node_->FirstChildElement(opr_base_.the_node.c_str());
parent_node2_ = parent_node_;
if (!unit.empty()) {
parent_node2_ = parent_node2_->FirstChildElement(unit.c_str());
}
if (!opr_base_.relative_nodes.empty()) {
auto v = CUtil::splitString(opr_base_.relative_nodes, ",");
// 向下子项跳跃
for (const auto& it : v) {
parent_node2_ = parent_node2_->FirstChildElement(it.c_str());
}
}
auto purpose_node = parent_node2_->FirstChildElement(opr_base_.item_key.c_str());
while (purpose_node) {
vec.push_back(purpose_node);
purpose_node = purpose_node->NextSiblingElement();
@ -53,9 +79,9 @@ bool CXmlOpr::get_all_elements(std::vector<Element_t*>& vec)
bool CXmlOpr::parse_xml(std::vector<tinyxml2::XMLElement*>& vec)
{
std::string next_node{};
std::string node_path = opr_base_.node_path;
std::string node_path = opr_base_.item_key;
keys_.clear();
auto keys = CUtil::splitString(opr_base_.purpose, ",");
auto keys = CUtil::splitString(opr_base_.propertis, ",");
for (const auto& item : keys) {
if (item.empty()) {
continue;
@ -63,9 +89,8 @@ bool CXmlOpr::parse_xml(std::vector<tinyxml2::XMLElement*>& vec)
keys_.push_back(item);
}
auto nodes = CUtil::splitString(opr_base_.node_path, "/");
auto nodes = CUtil::splitString(opr_base_.main_nodes, "/");
for (const auto& item : nodes) {
if (item.empty()) {
continue;
}
@ -76,7 +101,31 @@ bool CXmlOpr::parse_xml(std::vector<tinyxml2::XMLElement*>& vec)
parent_node_ = parent_node_->FirstChildElement(item.c_str());
}
}
get_all_elements(vec);
if (parent_node_ == nullptr) {
return false;
}
if (opr_base_.is_same) {
units_.clear();
auto p = parent_node_->FirstChildElement();
while (p) {
units_.push_back(p->Name());
p = p->NextSiblingElement();
}
if (!units_.empty()) {
get_all_elements(vec, units_[0]);
}
} else {
get_all_elements(vec);
}
return true;
}
bool CXmlOpr::get_all_unit(std::vector<std::string>& units)
{
units = units_;
return true;
}
@ -85,7 +134,7 @@ void CXmlOpr::copy_and_del(std::vector<Element_t*>& vec, std::vector<Element_t*>
{
out.clear();
// 先找到最后一个节点
Element_t* last_node = parent_node_->LastChildElement(opr_base_.the_node.c_str());
Element_t* last_node = parent_node2_->LastChildElement(opr_base_.item_key.c_str());
Element_t* last_node_bk = last_node;
if (last_node == nullptr) {
return;
@ -97,14 +146,14 @@ void CXmlOpr::copy_and_del(std::vector<Element_t*>& vec, std::vector<Element_t*>
last_node = n;
}
// 删除原有的节点
Element_t* fnode = parent_node_->FirstChildElement(opr_base_.the_node.c_str());
Element_t* fnode = parent_node2_->FirstChildElement(opr_base_.item_key.c_str());
Element_t* fnext = fnode->NextSiblingElement();
while (fnode != last_node_bk) {
parent_node_->DeleteChild(fnode);
parent_node2_->DeleteChild(fnode);
fnode = fnext;
fnext = fnode->NextSiblingElement();
}
parent_node_->DeleteChild(last_node_bk);
parent_node2_->DeleteChild(last_node_bk);
}
void CXmlOpr::insert_brother_node(Element_t* brother, Element_t* newer)
@ -112,7 +161,7 @@ void CXmlOpr::insert_brother_node(Element_t* brother, Element_t* newer)
if (!brother || !newer) {
return;
}
parent_node_->InsertAfterChild(brother, newer);
parent_node2_->InsertAfterChild(brother, newer);
}
Element_t* CXmlOpr::copy_element(Element_t* ele)
@ -120,7 +169,7 @@ Element_t* CXmlOpr::copy_element(Element_t* ele)
if (!ele) {
return nullptr;
}
Element_t* ret = doc_.NewElement(ele->Name());
Element_t* ret = doc_.NewElement(ele->Name());
const auto* attribute = ele->FirstAttribute();
while (attribute) {
ret->SetAttribute(attribute->Name(), attribute->Value());
@ -141,7 +190,7 @@ bool CXmlOpr::check_valid_xml_data(const std::string& data)
bool CXmlOpr::check_same_struct(const std::string& data)
{
auto* own_ele = parent_node_->FirstChildElement(opr_base_.the_node.c_str());
auto* own_ele = parent_node2_->FirstChildElement(opr_base_.item_key.c_str());
if (own_ele == nullptr) {
return true;
}
@ -150,12 +199,12 @@ bool CXmlOpr::check_same_struct(const std::string& data)
if (doc.Error()) {
return false;
}
const auto* import_ele = doc.FirstChildElement(opr_base_.the_node.c_str());
const auto* import_ele = doc.FirstChildElement(opr_base_.item_key.c_str());
if (import_ele == nullptr) {
return false;
}
const auto* attribute = own_ele->FirstAttribute();
int own_cnt = 0;
int own_cnt = 0;
while (attribute) {
++own_cnt;
if (import_ele->FindAttribute(attribute->Name()) == nullptr) {
@ -165,7 +214,7 @@ bool CXmlOpr::check_same_struct(const std::string& data)
}
const auto* attr_import = import_ele->FirstAttribute();
int import_cnt = 0;
int import_cnt = 0;
while (attr_import) {
++import_cnt;
attr_import = attr_import->Next();
@ -183,7 +232,7 @@ bool CXmlOpr::check_same_struct(const std::string& data)
bool CXmlOpr::import_newer_data(const std::vector<std::string>& vec, std::size_t& success_count)
{
success_count = 0;
auto* last_item = parent_node_->LastChildElement(opr_base_.the_node.c_str());
auto* last_item = parent_node2_->LastChildElement(opr_base_.item_key.c_str());
if (last_item == nullptr) {
return false;
}
@ -191,7 +240,7 @@ bool CXmlOpr::import_newer_data(const std::vector<std::string>& vec, std::size_t
for (const auto& data : vec) {
tinyxml2::XMLDocument doc;
doc.Parse(data.c_str());
auto* item = doc.FirstChildElement(opr_base_.the_node.c_str());
auto* item = doc.FirstChildElement(opr_base_.item_key.c_str());
if (item == nullptr) {
continue;
}
@ -202,13 +251,142 @@ bool CXmlOpr::import_newer_data(const std::vector<std::string>& vec, std::size_t
++success_count;
auto* nitem = copy_element(item);
insert_brother_node(last_item, nitem);
last_item = nitem;
}
return true;
}
std::string CXmlOpr::handle_space(const std::string& content, const std::vector<std::string>& keychars)
{
std::string result;
size_t pos = 0;
size_t len = content.length();
std::ostringstream oss;
for (auto i = size_t(0); i < keychars.size(); ++i) {
if (i > 0) {
oss << "|";
}
std::string op(keychars[i]);
for (const char& c : op) {
if (c == '|' || c == '\\' || c == '(' || c == ')' || c == '[' || c == ']' || c == '{' ||
c == '}' || c == '^' || c == '$' || c == '.' || c == '*' || c == '+' || c == '?' ||
c == '|' || c == '\\') {
oss << '\\'; // 添加转义字符
}
oss << c;
}
}
// Define a regular expression for the operators
// std::regex operators_regex(R"(&&|!=|==|<|>|\|\||\+|-|\*|/)");
std::regex operators_regex(oss.str());
while (pos < len) {
size_t start_quote = content.find('"', pos);
if (start_quote == std::string::npos) {
result.append(content.substr(pos));
break;
}
// Append everything before the first quote
result.append(content.substr(pos, start_quote - pos));
// Find the ending quote
size_t end_quote = content.find('"', start_quote + 1);
if (end_quote == std::string::npos) {
result.append(content.substr(start_quote));
break;
}
// Extract the quoted content
std::string quoted_content = content.substr(start_quote + 1, end_quote - start_quote - 1);
std::string processed_content = std::regex_replace(quoted_content, operators_regex, " $& ");
// Process quoted content to replace multiple spaces with a single space
std::istringstream iss(processed_content);
std::ostringstream oss;
std::string word;
bool first = true;
while (iss >> word) {
if (!first) {
oss << ' ';
}
oss << word;
first = false;
}
// Append processed content with quotes
result.append("\"" + oss.str() + "\"");
// Move past the ending quote
pos = end_quote + 1;
}
return result;
}
bool CXmlOpr::handle_transfer(const std::string& path, const std::vector<std::string>& keychars)
{
std::ifstream file(path);
if (!file.is_open()) {
return false;
}
std::istreambuf_iterator<char> ifter(file);
std::istreambuf_iterator<char> iter;
std::string content(ifter, iter);
file.close();
size_t pos = 0;
std::string result = content;
// Replace XML entities with their corresponding characters
while ((pos = result.find("&amp;", pos)) != std::string::npos) {
result.replace(pos, 5, "&");
pos += 1; // Move past the replaced character
}
pos = 0;
while ((pos = result.find("&lt;", pos)) != std::string::npos) {
result.replace(pos, 4, "<");
pos += 1; // Move past the replaced character
}
pos = 0;
while ((pos = result.find("&gt;", pos)) != std::string::npos) {
result.replace(pos, 4, ">");
pos += 1; // Move past the replaced character
}
pos = 0;
while ((pos = result.find("&quot;", pos)) != std::string::npos) {
result.replace(pos, 6, "\"");
pos += 1; // Move past the replaced character
}
pos = 0;
while ((pos = result.find("&apos;", pos)) != std::string::npos) {
result.replace(pos, 6, "'");
pos += 1; // Move past the replaced character
}
std::ofstream ofile(path);
if (!ofile.is_open()) {
return false;
}
if (keychars.size() < 1) {
ofile << result;
} else {
// 处理空格格式化
std::string sec_handle = handle_space(result, keychars);
ofile << sec_handle;
}
return true;
}
void CXmlOpr::del_element(Element_t* ele)
{
parent_node_->DeleteChild(ele);
parent_node2_->DeleteChild(ele);
}
bool CXmlOpr::check_key_exists(const Property_t& property)
@ -216,7 +394,7 @@ bool CXmlOpr::check_key_exists(const Property_t& property)
if (keys_.size() < 1 || property.size() < 1) {
return false;
}
return check_key_exists(property[0].key);
return check_key_exists(property[0].value);
}
bool CXmlOpr::check_key_exists(const std::string& key)
@ -224,7 +402,7 @@ bool CXmlOpr::check_key_exists(const std::string& key)
if (keys_.size() < 1 || key.empty()) {
return false;
}
Element_t* purpose_node = parent_node_->FirstChildElement(opr_base_.the_node.c_str());
Element_t* purpose_node = parent_node2_->FirstChildElement(opr_base_.item_key.c_str());
while (purpose_node) {
const char* value = purpose_node->Attribute(keys_[0].c_str());
if (key == std::string(value)) {
@ -244,6 +422,31 @@ bool CXmlOpr::save()
return true;
}
void CXmlOpr::clear_data()
{
xml_path_.clear();
parent_node_ = nullptr;
parent_node2_ = nullptr;
keys_.clear();
units_.clear();
doc_.Clear();
}
bool CXmlOpr::handle_save(const std::string& path, const std::vector<std::string>& keychars)
{
if (!open(path)) {
return false;
}
auto ret = doc_.SaveFile(xml_path_.c_str());
if (ret != tinyxml2::XML_SUCCESS) {
return false;
}
if (!handle_transfer(xml_path_, keychars)) {
return false;
}
return true;
}
void CXmlOpr::get_attributes(Element_t* ele, Property_t& vec)
{
if (ele == nullptr) {

View File

@ -1,10 +1,12 @@
#ifndef XML_OPERT_HEADER
#define XML_OPERT_HEADER
#include <string>
#include <tinyxml2.h>
#include <string>
#include <vector>
#include "../public_def.h"
#include "config.h"
struct SKeyValue {
SKeyValue(const char* pkey, const char* pvalue);
@ -12,7 +14,7 @@ struct SKeyValue {
std::string value;
};
typedef tinyxml2::XMLElement Element_t;
typedef tinyxml2::XMLElement Element_t;
typedef std::vector<SKeyValue> Property_t;
class CXmlOpr
{
@ -23,15 +25,19 @@ public:
public:
bool open(const std::string& xml_path);
bool backup_file(const std::string& desti_folder, const std::string& time);
void set_baseinfo(const OprBase& base);
void set_baseinfo(const OneGroupIni& base);
bool parse_xml(std::vector<Element_t*>& vec);
bool get_all_elements(std::vector<Element_t*>& vec);
bool get_all_unit(std::vector<std::string>& units);
bool get_all_elements(std::vector<Element_t*>& vec, const std::string& unit = "");
void copy_and_del(std::vector<Element_t*>& vec, std::vector<Element_t*>& out);
void insert_brother_node(Element_t* brother, Element_t* newer);
void del_element(Element_t* ele);
bool check_key_exists(const Property_t& property);
bool check_key_exists(const std::string& key);
bool save();
void clear_data();
bool handle_save(const std::string& path, const std::vector<std::string>& keychars);
std::string handle_space(const std::string& content, const std::vector<std::string>& keychars);
public:
Element_t* copy_element(Element_t* ele);
@ -41,17 +47,21 @@ public:
bool check_same_struct(const std::string& data);
// 不检查 xml 格式合法性,请自行调用 check_valid_xml_data
bool import_newer_data(const std::vector<std::string>& vec, std::size_t& success_count);
// 处理转义
bool handle_transfer(const std::string& path, const std::vector<std::string>& keychars);
public:
void get_attributes(Element_t* ele, Property_t& vec);
void attributes_to_element(Element_t* ele, const Property_t& vec);
private:
tinyxml2::XMLDocument doc_{};
OprBase opr_base_{};
std::string xml_path_{};
Element_t* parent_node_{};
tinyxml2::XMLDocument doc_{};
OneGroupIni opr_base_{};
std::string xml_path_{};
Element_t* parent_node_{};
Element_t* parent_node2_{};
std::vector<std::string> keys_{};
std::vector<std::string> units_{};
};
#endif