mirror of
https://github.com/jaredtao/TaoQuick.git
synced 2025-01-17 20:12:54 +08:00
update format; update TaoCommon
This commit is contained in:
parent
6e88f1d107
commit
2b0e06450a
233
.clang-format
233
.clang-format
@ -1,233 +0,0 @@
|
||||
---
|
||||
# 关闭格式化
|
||||
DisableFormat: false
|
||||
# 语言: None, Cpp, Java, JavaScript, ObjC, Proto, TableGen, TextProto
|
||||
Language: Cpp
|
||||
# BasedOnStyle: WebKit
|
||||
# 访问说明符(public、private等)的偏移
|
||||
AccessModifierOffset: -4
|
||||
# 开括号(开圆括号、开尖括号、开方括号)后的对齐: Align, DontAlign, AlwaysBreak(总是在开括号后换行)
|
||||
AlignAfterOpenBracket: AlwaysBreak
|
||||
# 连续赋值时,对齐所有等号
|
||||
AlignConsecutiveAssignments: false
|
||||
# 连续声明时,对齐所有声明的变量名
|
||||
AlignConsecutiveDeclarations: true
|
||||
# 左对齐逃脱换行(使用反斜杠换行)的反斜杠
|
||||
AlignEscapedNewlines: Right
|
||||
# 水平对齐二元和三元表达式的操作数
|
||||
AlignOperands: true
|
||||
# 对齐连续的尾随的注释
|
||||
AlignTrailingComments: true
|
||||
# 允许函数声明的所有参数在放在下一行
|
||||
AllowAllParametersOfDeclarationOnNextLine: false
|
||||
# 允许短的块放在同一行
|
||||
AllowShortBlocksOnASingleLine: false
|
||||
# 允许短的case标签放在同一行
|
||||
AllowShortCaseLabelsOnASingleLine: false
|
||||
# 允许短的函数放在同一行: None, InlineOnly(定义在类中), Empty(空函数), Inline(定义在类中,空函数), All
|
||||
AllowShortFunctionsOnASingleLine: Empty
|
||||
# 允许短的if语句保持在同一行
|
||||
AllowShortIfStatementsOnASingleLine: false
|
||||
# 允许短的循环保持在同一行
|
||||
AllowShortLoopsOnASingleLine: false
|
||||
# 总是在定义返回类型后换行(deprecated)
|
||||
AlwaysBreakAfterDefinitionReturnType: None
|
||||
# 总是在返回类型后换行: None, All, TopLevel(顶级函数,不包括在类中的函数),
|
||||
# AllDefinitions(所有的定义,不包括声明), TopLevelDefinitions(所有的顶级函数的定义)
|
||||
AlwaysBreakAfterReturnType: None
|
||||
# 总是在多行string字面量前换行
|
||||
AlwaysBreakBeforeMultilineStrings: false
|
||||
# 总是在template声明后换行
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
# false表示函数实参要么都在同一行,要么都各自一行
|
||||
BinPackArguments: false
|
||||
# false表示所有形参要么都在同一行,要么都各自一行
|
||||
BinPackParameters: false
|
||||
|
||||
# 在大括号前换行: Attach(始终将大括号附加到周围的上下文), Linux(除函数、命名空间和类定义,与Attach类似),
|
||||
# Mozilla(除枚举、函数、记录定义,与Attach类似), Stroustrup(除函数定义、catch、else,与Attach类似),
|
||||
# Allman(总是在大括号前换行), GNU(总是在大括号前换行,并对于控制语句的大括号增加额外的缩进), WebKit(在函数前换行), Custom
|
||||
# 注:这里认为语句块也属于函数
|
||||
BreakBeforeBraces: Custom
|
||||
# 大括号换行,只有当BreakBeforeBraces设置为Custom时才有效
|
||||
BraceWrapping:
|
||||
# class定义后面
|
||||
AfterClass: true
|
||||
# 控制语句后面
|
||||
AfterControlStatement: false
|
||||
# enum定义后面
|
||||
AfterEnum: true
|
||||
# 函数定义后面
|
||||
AfterFunction: true
|
||||
# 命名空间定义后面
|
||||
AfterNamespace: true
|
||||
# ObjC定义后面
|
||||
AfterObjCDeclaration: false
|
||||
# struct定义后面
|
||||
AfterStruct: true
|
||||
# union定义后面
|
||||
AfterUnion: true
|
||||
# extern 定义后面
|
||||
AfterExternBlock: true
|
||||
# catch之前
|
||||
BeforeCatch: false
|
||||
# else 之前
|
||||
BeforeElse: false
|
||||
# 缩进大括号
|
||||
IndentBraces: false
|
||||
|
||||
#SplitEmptyFunction: true
|
||||
|
||||
#SplitEmptyRecord: true
|
||||
|
||||
#SplitEmptyNamespace: true
|
||||
# 在二元运算符前换行: None(在操作符后换行), NonAssignment(在非赋值的操作符前换行), All(在操作符前换行)
|
||||
BreakBeforeBinaryOperators: All
|
||||
|
||||
# 继承列表的逗号前换行
|
||||
BreakBeforeInheritanceComma: true
|
||||
# 继承列表换行
|
||||
BreakInheritanceList: BeforeColon
|
||||
# 在三元运算符前换行
|
||||
BreakBeforeTernaryOperators: true
|
||||
# 在构造函数的初始化列表的逗号前换行
|
||||
BreakConstructorInitializersBeforeComma: true
|
||||
# 初始化列表前换行
|
||||
BreakConstructorInitializers: BeforeComma
|
||||
# Java注解后换行
|
||||
BreakAfterJavaFieldAnnotations: true
|
||||
|
||||
BreakStringLiterals: true
|
||||
# 每行字符的限制,0表示没有限制
|
||||
ColumnLimit: 160
|
||||
# 描述具有特殊意义的注释的正则表达式,它不应该被分割为多行或以其它方式改变
|
||||
CommentPragmas: '^ IWYU pragma:'
|
||||
# 紧凑 命名空间
|
||||
CompactNamespaces: false
|
||||
# 构造函数的初始化列表要么都在同一行,要么都各自一行
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: false
|
||||
# 构造函数的初始化列表的缩进宽度
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
# 延续的行的缩进宽度
|
||||
ContinuationIndentWidth: 4
|
||||
# 去除C++11的列表初始化的大括号{后和}前的空格
|
||||
Cpp11BracedListStyle: false
|
||||
# 继承最常用的指针和引用的对齐方式
|
||||
DerivePointerAlignment: false
|
||||
|
||||
# 自动检测函数的调用和定义是否被格式为每行一个参数(Experimental)
|
||||
ExperimentalAutoDetectBinPacking: false
|
||||
# 固定命名空间注释
|
||||
FixNamespaceComments: true
|
||||
# 需要被解读为foreach循环而不是函数调用的宏
|
||||
ForEachMacros:
|
||||
- foreach
|
||||
- Q_FOREACH
|
||||
- BOOST_FOREACH
|
||||
|
||||
IncludeBlocks: Preserve
|
||||
# 对#include进行排序,匹配了某正则表达式的#include拥有对应的优先级,匹配不到的则默认优先级为INT_MAX(优先级越小排序越靠前),
|
||||
# 可以定义负数优先级从而保证某些#include永远在最前面
|
||||
IncludeCategories:
|
||||
- Regex: '^"(llvm|llvm-c|clang|clang-c)/'
|
||||
Priority: 2
|
||||
- Regex: '^(<|"(gtest|gmock|isl|json)/)'
|
||||
Priority: 3
|
||||
- Regex: 'stdafx\.'
|
||||
Priority: 1
|
||||
- Regex: '.*'
|
||||
Priority: 1
|
||||
|
||||
IncludeIsMainRegex: '(Test)?$'
|
||||
# 缩进case标签
|
||||
IndentCaseLabels: true
|
||||
|
||||
IndentPPDirectives: None
|
||||
# 缩进宽度
|
||||
IndentWidth: 4
|
||||
# 函数返回类型换行时,缩进函数声明或函数定义的函数名
|
||||
IndentWrappedFunctionNames: true
|
||||
|
||||
JavaScriptQuotes: Leave
|
||||
|
||||
JavaScriptWrapImports: true
|
||||
#KeepLineBreaksForNonEmptyLines: false
|
||||
# 保留在块开始处的空行
|
||||
KeepEmptyLinesAtTheStartOfBlocks: true
|
||||
# 开始一个块的宏的正则表达式
|
||||
MacroBlockBegin: ''
|
||||
# 结束一个块的宏的正则表达式
|
||||
MacroBlockEnd: ''
|
||||
# 连续空行的最大数量
|
||||
MaxEmptyLinesToKeep: 1
|
||||
|
||||
# 命名空间的缩进: None, Inner(缩进嵌套的命名空间中的内容), All
|
||||
NamespaceIndentation: All
|
||||
ObjCBinPackProtocolList: Auto
|
||||
# 使用ObjC块时缩进宽度
|
||||
ObjCBlockIndentWidth: 4
|
||||
# 在ObjC的@property后添加一个空格
|
||||
ObjCSpaceAfterProperty: true
|
||||
# 在ObjC的protocol列表前添加一个空格
|
||||
ObjCSpaceBeforeProtocolList: true
|
||||
|
||||
PenaltyBreakAssignment: 2
|
||||
|
||||
PenaltyBreakBeforeFirstCallParameter: 19
|
||||
# 在一个注释中引入换行的penalty
|
||||
PenaltyBreakComment: 300
|
||||
# 第一次在<<前换行的penalty
|
||||
PenaltyBreakFirstLessLess: 120
|
||||
# 在一个字符串字面量中引入换行的penalty
|
||||
PenaltyBreakString: 1000
|
||||
PenaltyBreakTemplateDeclaration: 10
|
||||
# 对于每个在行字符数限制之外的字符的penalty
|
||||
PenaltyExcessCharacter: 1000000
|
||||
# 将函数的返回类型放到它自己的行的penalty
|
||||
PenaltyReturnTypeOnItsOwnLine: 60
|
||||
# 指针和引用的对齐: Left, Right, Middle
|
||||
PointerAlignment: Right
|
||||
|
||||
#RawStringFormats:
|
||||
# - Delimiter: pb
|
||||
# Language: TextProto
|
||||
# BasedOnStyle: google
|
||||
# 允许重新排版注释
|
||||
ReflowComments: false
|
||||
# 允许排序#include
|
||||
SortIncludes: true
|
||||
|
||||
SortUsingDeclarations: true
|
||||
# 在C风格类型转换后添加空格
|
||||
SpaceAfterCStyleCast: false
|
||||
# 模板关键字后面添加空格
|
||||
SpaceAfterTemplateKeyword: true
|
||||
# 在赋值运算符之前添加空格
|
||||
SpaceBeforeAssignmentOperators: true
|
||||
# 开圆括号之前添加一个空格: Never, ControlStatements, Always
|
||||
SpaceBeforeCpp11BracedList: false
|
||||
SpaceBeforeCtorInitializerColon: true
|
||||
SpaceBeforeInheritanceColon: true
|
||||
SpaceBeforeParens: ControlStatements
|
||||
SpaceBeforeRangeBasedForLoopColon: true
|
||||
# 在空的圆括号中添加空格
|
||||
SpaceInEmptyParentheses: false
|
||||
# 在尾随的评论前添加的空格数(只适用于//)
|
||||
SpacesBeforeTrailingComments: 1
|
||||
# 在尖括号的<后和>前添加空格
|
||||
SpacesInAngles: false
|
||||
# 在容器(ObjC和JavaScript的数组和字典等)字面量中添加空格
|
||||
SpacesInContainerLiterals: true
|
||||
# 在C风格类型转换的括号中添加空格
|
||||
SpacesInCStyleCastParentheses: false
|
||||
# 在圆括号的(后和)前添加空格
|
||||
SpacesInParentheses: false
|
||||
# 在方括号的[后和]前添加空格,lamda表达式和未指明大小的数组的声明不受影响
|
||||
SpacesInSquareBrackets: false
|
||||
# 标准: Cpp03, Cpp11, Auto
|
||||
Standard: Cpp11
|
||||
# tab宽度
|
||||
TabWidth: 4
|
||||
# 使用tab字符: Never, ForIndentation, ForContinuationAndIndentation, Always
|
||||
UseTab: Never
|
||||
...
|
39
.commit-template
Normal file
39
.commit-template
Normal file
@ -0,0 +1,39 @@
|
||||
# ==[ Subject: One line only short meaningful description for logs ]===|
|
||||
|
||||
|
||||
# ==[ Details: Describe what changed and explain why it changed ]======|
|
||||
|
||||
|
||||
# Change log entry (see below for instructions).
|
||||
#[ChangeLog][][]
|
||||
|
||||
# ==[ Footers: Uncomment and edit where applicable ]===================|
|
||||
#
|
||||
# One task per entry. Add a space after the colon.
|
||||
# Use Fixes to automatically close an issue, and Task-number to
|
||||
# reference it without further action.
|
||||
# You do not need both for the same issue.
|
||||
#Fixes:
|
||||
#Task-number:
|
||||
#Coverity-Id:
|
||||
#
|
||||
# Add a space-separated list of target branches that the change should
|
||||
# be cherry-picked to automatically.
|
||||
#Pick-to:
|
||||
#
|
||||
# ==[ Please wrap at 72 characters ]===================================|
|
||||
#
|
||||
# Remember to read http://wiki.qt.io/Commit_Policy
|
||||
#
|
||||
# Change log entry: If this commit adds a significant feature, fixes an
|
||||
# issue or contains a behavior change that is relevant to others,
|
||||
# add a change log entry. It can be multiple lines long and ends with an
|
||||
# empty newline. Try to integrate it into the flow of the commit message
|
||||
# to avoid redundancy.
|
||||
# Use the module name to indicate the area of the change e.g. [QtCore].
|
||||
# Optionally specify a class or subtopic [QtNetwork][QSslSocket].
|
||||
# Other common tags are: [General], [Important Behavior Changes],
|
||||
# [Platform Specific Changes][Windows][OS X][Linux/XCB].
|
||||
#
|
||||
# [ChangeLog][module][class/topic] description of the really important
|
||||
# change that was just made on several lines.
|
68
.gitattributes
vendored
68
.gitattributes
vendored
@ -1,62 +1,6 @@
|
||||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
||||
#*.png filter=lfs diff=lfs merge=lfs -text
|
||||
#*.jpg filter=lfs diff=lfs merge=lfs -text
|
||||
#*.gif filter=lfs diff=lfs merge=lfs -text
|
||||
.tag export-subst
|
||||
.gitignore export-ignore
|
||||
.gitattributes export-ignore
|
||||
.commit-template export-ignore eol=lf
|
||||
init-repository export-ignore
|
||||
README.git export-ignore
|
||||
|
268
.gitignore
vendored
268
.gitignore
vendored
@ -1,264 +1,4 @@
|
||||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
build/
|
||||
run/
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.userosscache
|
||||
*.sln.docstates
|
||||
|
||||
# User-specific files (MonoDevelop/Xamarin Studio)
|
||||
*.userprefs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Dd]ebugPublic/
|
||||
[Rr]elease/
|
||||
[Rr]eleases/
|
||||
x64/
|
||||
x86/
|
||||
bld/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Ll]og/
|
||||
|
||||
# Visual Studio 2015 cache/options directory
|
||||
.vs/
|
||||
# Uncomment if you have tasks that create the project's static files in wwwroot
|
||||
#wwwroot/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
# NUNIT
|
||||
*.VisualState.xml
|
||||
TestResult.xml
|
||||
|
||||
# Build Results of an ATL Project
|
||||
[Dd]ebugPS/
|
||||
[Rr]eleasePS/
|
||||
dlldata.c
|
||||
|
||||
# DNX
|
||||
project.lock.json
|
||||
project.fragment.lock.json
|
||||
artifacts/
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*_i.h
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.svclog
|
||||
*.scc
|
||||
*.qmlc
|
||||
# Chutzpah Test files
|
||||
_Chutzpah*
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opendb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
*.VC.db
|
||||
*.VC.VC.opendb
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
*.sap
|
||||
|
||||
# TFS 2012 Local Workspace
|
||||
$tf/
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
*.DotSettings.user
|
||||
|
||||
# JustCode is a .NET coding add-in
|
||||
.JustCode
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
_NCrunch_*
|
||||
.*crunch*.local.xml
|
||||
nCrunchTemp_*
|
||||
|
||||
# MightyMoose
|
||||
*.mm.*
|
||||
AutoTest.Net/
|
||||
|
||||
# Web workbench (sass)
|
||||
.sass-cache/
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.[Pp]ublish.xml
|
||||
*.azurePubxml
|
||||
# TODO: Comment the next line if you want to checkin your web deploy settings
|
||||
# but database connection strings (with potential passwords) will be unencrypted
|
||||
#*.pubxml
|
||||
*.publishproj
|
||||
|
||||
# Microsoft Azure Web App publish settings. Comment the next line if you want to
|
||||
# checkin your Azure Web App publish settings, but sensitive information contained
|
||||
# in these scripts will be unencrypted
|
||||
PublishScripts/
|
||||
|
||||
# NuGet Packages
|
||||
*.nupkg
|
||||
# The packages folder can be ignored because of Package Restore
|
||||
**/packages/*
|
||||
# except build/, which is used as an MSBuild target.
|
||||
!**/packages/build/
|
||||
# Uncomment if necessary however generally it will be regenerated when needed
|
||||
#!**/packages/repositories.config
|
||||
# NuGet v3's project.json files produces more ignoreable files
|
||||
*.nuget.props
|
||||
*.nuget.targets
|
||||
|
||||
# Microsoft Azure Build Output
|
||||
csx/
|
||||
*.build.csdef
|
||||
|
||||
# Microsoft Azure Emulator
|
||||
ecf/
|
||||
rcf/
|
||||
|
||||
# Windows Store app package directories and files
|
||||
AppPackages/
|
||||
BundleArtifacts/
|
||||
Package.StoreAssociation.xml
|
||||
_pkginfo.txt
|
||||
|
||||
# Visual Studio cache files
|
||||
# files ending in .cache can be ignored
|
||||
*.[Cc]ache
|
||||
# but keep track of directories ending in .cache
|
||||
!*.[Cc]ache/
|
||||
|
||||
# Others
|
||||
ClientBin/
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.dbproj.schemaview
|
||||
*.jfm
|
||||
*.pfx
|
||||
*.publishsettings
|
||||
node_modules/
|
||||
orleans.codegen.cs
|
||||
|
||||
# Since there are multiple workflows, uncomment next line to ignore bower_components
|
||||
# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622)
|
||||
#bower_components/
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file
|
||||
# to a newer Visual Studio version. Backup files are not needed,
|
||||
# because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
*.mdf
|
||||
*.ldf
|
||||
|
||||
# Business Intelligence projects
|
||||
*.rdl.data
|
||||
*.bim.layout
|
||||
*.bim_*.settings
|
||||
|
||||
# Microsoft Fakes
|
||||
FakesAssemblies/
|
||||
|
||||
# GhostDoc plugin setting file
|
||||
*.GhostDoc.xml
|
||||
|
||||
# Node.js Tools for Visual Studio
|
||||
.ntvs_analysis.dat
|
||||
|
||||
# Visual Studio 6 build log
|
||||
*.plg
|
||||
|
||||
# Visual Studio 6 workspace options file
|
||||
*.opt
|
||||
|
||||
# Visual Studio LightSwitch build output
|
||||
**/*.HTMLClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/GeneratedArtifacts
|
||||
**/*.DesktopClient/ModelManifest.xml
|
||||
**/*.Server/GeneratedArtifacts
|
||||
**/*.Server/ModelManifest.xml
|
||||
_Pvt_Extensions
|
||||
|
||||
# Paket dependency manager
|
||||
.paket/paket.exe
|
||||
paket-files/
|
||||
|
||||
# FAKE - F# Make
|
||||
.fake/
|
||||
|
||||
# JetBrains Rider
|
||||
.idea/
|
||||
*.sln.iml
|
||||
|
||||
# CodeRush
|
||||
.cr/
|
||||
|
||||
# Python Tools for Visual Studio (PTVS)
|
||||
__pycache__/
|
||||
*.pyc
|
||||
/.vscode/settings.json
|
||||
Makefile
|
||||
.qmake.cache
|
||||
.qmake.super
|
||||
*.pro.user*
|
||||
|
27
3rdparty/TaoCommon/Common/filereadwrite.h
vendored
27
3rdparty/TaoCommon/Common/filereadwrite.h
vendored
@ -6,13 +6,11 @@
|
||||
#include <QJsonObject>
|
||||
#include <QString>
|
||||
#include "Logger/logger.h"
|
||||
namespace TaoCommon
|
||||
{
|
||||
namespace TaoCommon {
|
||||
static bool readFile(const QString &filePath, QByteArray &content)
|
||||
{
|
||||
QFile file(filePath);
|
||||
if (!file.open(QFile::ReadOnly))
|
||||
{
|
||||
if (!file.open(QFile::ReadOnly)) {
|
||||
LOG_WARN << "open file " << filePath << "failed:" << file.errorString();
|
||||
return false;
|
||||
}
|
||||
@ -24,8 +22,7 @@ namespace TaoCommon
|
||||
{
|
||||
QJsonParseError err;
|
||||
doc = QJsonDocument::fromJson(data, &err);
|
||||
if (doc.isNull())
|
||||
{
|
||||
if (doc.isNull()) {
|
||||
LOG_WARN << "parse json failed:" << err.errorString();
|
||||
return false;
|
||||
}
|
||||
@ -35,8 +32,7 @@ namespace TaoCommon
|
||||
{
|
||||
QJsonDocument doc;
|
||||
bool ok = readJson(data, doc);
|
||||
if (ok)
|
||||
{
|
||||
if (ok) {
|
||||
array = doc.array();
|
||||
}
|
||||
return ok;
|
||||
@ -45,8 +41,7 @@ namespace TaoCommon
|
||||
{
|
||||
QJsonDocument doc;
|
||||
bool ok = readJson(data, doc);
|
||||
if (ok)
|
||||
{
|
||||
if (ok) {
|
||||
object = doc.object();
|
||||
}
|
||||
return ok;
|
||||
@ -55,8 +50,7 @@ namespace TaoCommon
|
||||
static bool readJsonFile(const QString &filePath, QJsonDocument &jsonDoc)
|
||||
{
|
||||
QByteArray data;
|
||||
if (!readFile(filePath, data))
|
||||
{
|
||||
if (!readFile(filePath, data)) {
|
||||
return false;
|
||||
}
|
||||
return readJson(data, jsonDoc);
|
||||
@ -64,8 +58,7 @@ namespace TaoCommon
|
||||
static bool readJsonFile(const QString &filePath, QJsonObject &jsonObj)
|
||||
{
|
||||
QByteArray data;
|
||||
if (!readFile(filePath, data))
|
||||
{
|
||||
if (!readFile(filePath, data)) {
|
||||
return false;
|
||||
}
|
||||
return readJson(data, jsonObj);
|
||||
@ -73,8 +66,7 @@ namespace TaoCommon
|
||||
static bool readJsonFile(const QString &filePath, QJsonArray &jsonArray)
|
||||
{
|
||||
QByteArray data;
|
||||
if (!readFile(filePath, data))
|
||||
{
|
||||
if (!readFile(filePath, data)) {
|
||||
return false;
|
||||
}
|
||||
return readJson(data, jsonArray);
|
||||
@ -82,8 +74,7 @@ namespace TaoCommon
|
||||
static bool writeFile(const QString &filePath, const QByteArray &content)
|
||||
{
|
||||
QFile file(filePath);
|
||||
if (!file.open(QFile::WriteOnly))
|
||||
{
|
||||
if (!file.open(QFile::WriteOnly)) {
|
||||
LOG_WARN << "open file " << filePath << "failed:" << file.errorString();
|
||||
return false;
|
||||
}
|
||||
|
77
3rdparty/TaoCommon/Common/objectmap.h
vendored
77
3rdparty/TaoCommon/Common/objectmap.h
vendored
@ -10,20 +10,12 @@ namespace TaoCommon {
|
||||
|
||||
//对象存储器
|
||||
template<typename Key, typename Value>
|
||||
class ObjectMap {
|
||||
class ObjectMap
|
||||
{
|
||||
public:
|
||||
virtual ~ObjectMap()
|
||||
{
|
||||
clear();
|
||||
}
|
||||
void addObj(const Key& key, const Value& obj)
|
||||
{
|
||||
m_objMap[key] = obj;
|
||||
}
|
||||
bool removeObj(const Key& key)
|
||||
{
|
||||
return (0 != m_objMap.erase(key));
|
||||
}
|
||||
virtual ~ObjectMap() { clear(); }
|
||||
void addObj(const Key &key, const Value &obj) { m_objMap[key] = obj; }
|
||||
bool removeObj(const Key &key) { return (0 != m_objMap.erase(key)); }
|
||||
Value getObj(const Key &key) const
|
||||
{
|
||||
auto itor = m_objMap.find(key);
|
||||
@ -40,26 +32,22 @@ public:
|
||||
callback(pair.second.get());
|
||||
}
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
m_objMap.clear();
|
||||
}
|
||||
void clear() { m_objMap.clear(); }
|
||||
|
||||
protected:
|
||||
std::unordered_map<Key, Value> m_objMap;
|
||||
};
|
||||
//智能对象存储器。自动生成key,自动管理对象。
|
||||
template<typename ObjectType>
|
||||
class CObjectMap {
|
||||
public:
|
||||
virtual ~CObjectMap()
|
||||
class CObjectMap
|
||||
{
|
||||
clear();
|
||||
}
|
||||
public:
|
||||
virtual ~CObjectMap() { clear(); }
|
||||
template<typename DeriveObjectType>
|
||||
DeriveObjectType *getObject() const
|
||||
{
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value, "DeriveObjectType must be derive from ObjectType");
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value,
|
||||
"DeriveObjectType must be derive from ObjectType");
|
||||
|
||||
auto objPtr = m_objMap.getObj(std::type_index(typeid(std::shared_ptr<DeriveObjectType>)));
|
||||
return std::static_pointer_cast<DeriveObjectType>(objPtr).get();
|
||||
@ -67,7 +55,8 @@ public:
|
||||
template<typename DeriveObjectType, typename... Args>
|
||||
void createObject(Args &... args)
|
||||
{
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value, "DeriveObjectType must be derive from ObjectType");
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value,
|
||||
"DeriveObjectType must be derive from ObjectType");
|
||||
|
||||
auto obj = std::make_shared<DeriveObjectType>(args...);
|
||||
m_objMap.addObj(std::type_index(typeid(obj)), std::static_pointer_cast<ObjectType>(obj));
|
||||
@ -75,7 +64,8 @@ public:
|
||||
template<typename DeriveObjectType>
|
||||
bool destroyObject()
|
||||
{
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value, "DeriveObjectType must be derive from ObjectType");
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value,
|
||||
"DeriveObjectType must be derive from ObjectType");
|
||||
|
||||
return m_objMap.removeObj(std::type_index(typeid(std::shared_ptr<DeriveObjectType>)));
|
||||
}
|
||||
@ -83,30 +73,28 @@ public:
|
||||
{
|
||||
m_objMap.forEach(callback);
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
m_objMap.clear();
|
||||
}
|
||||
void clear() { m_objMap.clear(); }
|
||||
|
||||
protected:
|
||||
ObjectMap<std::type_index, std::shared_ptr<ObjectType>> m_objMap;
|
||||
};
|
||||
//优先级对象存储器。自动生成key,自动管理对象。支持按优先级处理
|
||||
template<typename ObjectType>
|
||||
class CLevelObjectMap {
|
||||
public:
|
||||
virtual ~CLevelObjectMap()
|
||||
class CLevelObjectMap
|
||||
{
|
||||
clear();
|
||||
}
|
||||
public:
|
||||
virtual ~CLevelObjectMap() { clear(); }
|
||||
template<typename DeriveObjectType>
|
||||
DeriveObjectType *getObject() const
|
||||
{
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value, "DeriveObjectType must be derive from ObjectType");
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value,
|
||||
"DeriveObjectType must be derive from ObjectType");
|
||||
|
||||
auto index = std::type_index(typeid(std::shared_ptr<DeriveObjectType>));
|
||||
|
||||
for (const auto &mainPair : m_map) {
|
||||
const std::unordered_map<std::type_index, std::shared_ptr<ObjectType>>& subMap = mainPair.second;
|
||||
const std::unordered_map<std::type_index, std::shared_ptr<ObjectType>> &subMap =
|
||||
mainPair.second;
|
||||
|
||||
auto itor = subMap.find(index);
|
||||
if (itor != subMap.end()) {
|
||||
@ -118,7 +106,8 @@ public:
|
||||
template<typename DeriveObjectType, typename... Args>
|
||||
void createObject(uint32_t level, Args &&... args)
|
||||
{
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value, "DeriveObjectType must be derive from ObjectType");
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value,
|
||||
"DeriveObjectType must be derive from ObjectType");
|
||||
|
||||
auto obj = std::make_shared<DeriveObjectType>(args...);
|
||||
m_map[level][std::type_index(typeid(obj))] = std::static_pointer_cast<ObjectType>(obj);
|
||||
@ -126,11 +115,13 @@ public:
|
||||
template<typename DeriveObjectType>
|
||||
bool destroyObject()
|
||||
{
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value, "DeriveObjectType must be derive from ObjectType");
|
||||
static_assert(std::is_base_of<ObjectType, DeriveObjectType>::value,
|
||||
"DeriveObjectType must be derive from ObjectType");
|
||||
|
||||
auto index = std::type_index(typeid(std::shared_ptr<DeriveObjectType>));
|
||||
for (auto &mainPair : m_map) {
|
||||
std::unordered_map<std::type_index, std::shared_ptr<ObjectType>>& subMap = mainPair.second;
|
||||
std::unordered_map<std::type_index, std::shared_ptr<ObjectType>> &subMap =
|
||||
mainPair.second;
|
||||
|
||||
auto itor = subMap.find(index);
|
||||
if (itor != subMap.end()) {
|
||||
@ -143,16 +134,14 @@ public:
|
||||
void forEach(const std::function<void(ObjectType *)> &callback) const
|
||||
{
|
||||
for (const auto &mainPair : m_map) {
|
||||
const std::unordered_map<std::type_index, std::shared_ptr<ObjectType>>& subMap = mainPair.second;
|
||||
const std::unordered_map<std::type_index, std::shared_ptr<ObjectType>> &subMap =
|
||||
mainPair.second;
|
||||
for (const auto &subPair : subMap) {
|
||||
callback(subPair.second.get());
|
||||
}
|
||||
}
|
||||
}
|
||||
void clear()
|
||||
{
|
||||
m_map.clear();
|
||||
}
|
||||
void clear() { m_map.clear(); }
|
||||
|
||||
private:
|
||||
std::map<uint32_t, std::unordered_map<std::type_index, std::shared_ptr<ObjectType>>> m_map;
|
||||
|
10
3rdparty/TaoCommon/Common/package.h
vendored
10
3rdparty/TaoCommon/Common/package.h
vendored
@ -1,8 +1,8 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <QByteArray>
|
||||
#include <QByteArrayList>
|
||||
#include <QDataStream>
|
||||
|
||||
#include <QIODevice>
|
||||
const int static headerLength = sizeof(quint32);
|
||||
|
||||
static QByteArray pack(const QByteArray &data)
|
||||
@ -19,12 +19,10 @@ static QByteArrayList unpack(const QByteArray &data)
|
||||
quint32 sum = data.size();
|
||||
quint32 pos = 0;
|
||||
quint32 packageLen = 0;
|
||||
while (pos + headerLength < sum)
|
||||
{
|
||||
while (pos + headerLength < sum) {
|
||||
packageLen = 0;
|
||||
inStream >> packageLen;
|
||||
if (packageLen <= 0 || packageLen + headerLength > sum - pos)
|
||||
{
|
||||
if (packageLen <= 0 || packageLen + headerLength > sum - pos) {
|
||||
break;
|
||||
}
|
||||
QByteArray subPackage = data.mid(pos + headerLength, packageLen);
|
||||
|
46
3rdparty/TaoCommon/Common/subject.h
vendored
46
3rdparty/TaoCommon/Common/subject.h
vendored
@ -2,24 +2,19 @@
|
||||
#include <algorithm>
|
||||
#include <map>
|
||||
#include <vector>
|
||||
namespace TaoCommon
|
||||
{
|
||||
namespace TaoCommon {
|
||||
//观察者模式,Subject-Observer。
|
||||
// Subject 事件或消息的主体。模板参数为观察者类型
|
||||
template<typename ObserverType>
|
||||
class Subject
|
||||
{
|
||||
public:
|
||||
virtual ~Subject()
|
||||
{
|
||||
m_obsList.clear();
|
||||
}
|
||||
virtual ~Subject() { m_obsList.clear(); }
|
||||
//订阅
|
||||
void subscibe(ObserverType *obs)
|
||||
{
|
||||
auto itor = std::find(m_obsList.begin(), m_obsList.end(), obs);
|
||||
if (m_obsList.end() == itor)
|
||||
{
|
||||
if (m_obsList.end() == itor) {
|
||||
m_obsList.push_back(obs);
|
||||
}
|
||||
}
|
||||
@ -32,8 +27,7 @@ namespace TaoCommon
|
||||
template<typename FuncType>
|
||||
void publish(FuncType func)
|
||||
{
|
||||
for (auto obs : m_obsList)
|
||||
{
|
||||
for (auto obs : m_obsList) {
|
||||
//调用回调函数,将obs作为第一个参数传递
|
||||
func(obs);
|
||||
}
|
||||
@ -42,11 +36,9 @@ namespace TaoCommon
|
||||
template<typename FuncType>
|
||||
void publish(FuncType func, ObserverType *exceptObs)
|
||||
{
|
||||
for (auto obs : m_obsList)
|
||||
{
|
||||
for (auto obs : m_obsList) {
|
||||
//调用回调函数,将obs作为第一个参数传递
|
||||
if (obs != exceptObs)
|
||||
{
|
||||
if (obs != exceptObs) {
|
||||
func(obs);
|
||||
}
|
||||
}
|
||||
@ -61,25 +53,20 @@ namespace TaoCommon
|
||||
class LevelSubject
|
||||
{
|
||||
public:
|
||||
virtual ~LevelSubject()
|
||||
{
|
||||
m_obsMap.clear();
|
||||
}
|
||||
virtual ~LevelSubject() { m_obsMap.clear(); }
|
||||
//订阅
|
||||
void subscibe(ObserverType *obs, uint32_t level)
|
||||
{
|
||||
auto &vec = m_obsMap[level];
|
||||
auto itor = std::find(vec.begin(), vec.end(), obs);
|
||||
if (vec.end() == itor)
|
||||
{
|
||||
if (vec.end() == itor) {
|
||||
vec.push_back(obs);
|
||||
}
|
||||
}
|
||||
//取消订阅
|
||||
void unSubscibe(ObserverType *obs)
|
||||
{
|
||||
for (auto &obsPair : m_obsMap)
|
||||
{
|
||||
for (auto &obsPair : m_obsMap) {
|
||||
obsPair.second.erase(std::remove(obsPair.second.begin(), obsPair.second.end(), obs));
|
||||
}
|
||||
}
|
||||
@ -87,10 +74,8 @@ namespace TaoCommon
|
||||
template<typename FuncType>
|
||||
void publish(FuncType func)
|
||||
{
|
||||
for (const auto &obsPair : m_obsMap)
|
||||
{
|
||||
for (const auto &obs : obsPair.second)
|
||||
{
|
||||
for (const auto &obsPair : m_obsMap) {
|
||||
for (const auto &obs : obsPair.second) {
|
||||
func(obs);
|
||||
}
|
||||
}
|
||||
@ -98,12 +83,9 @@ namespace TaoCommon
|
||||
template<typename FuncType>
|
||||
void publish(FuncType func, ObserverType *exceptObs)
|
||||
{
|
||||
for (const auto &obsPair : m_obsMap)
|
||||
{
|
||||
for (const auto &obs : obsPair.second)
|
||||
{
|
||||
if (obs != exceptObs)
|
||||
{
|
||||
for (const auto &obsPair : m_obsMap) {
|
||||
for (const auto &obs : obsPair.second) {
|
||||
if (obs != exceptObs) {
|
||||
func(obs);
|
||||
}
|
||||
}
|
||||
|
@ -11,7 +11,8 @@
|
||||
# include <objidl.h> // Fixes error C2504: 'IUnknown' : base class undefined
|
||||
# include <windows.h>
|
||||
# include <windowsx.h>
|
||||
#pragma comment(lib, "Dwmapi.lib") // Adds missing library, fixes error LNK2019: unresolved external symbol __imp__DwmExtendFrameIntoClientArea
|
||||
# pragma comment(lib, "Dwmapi.lib") // Adds missing library, fixes error LNK2019: unresolved
|
||||
// external symbol __imp__DwmExtendFrameIntoClientArea
|
||||
# pragma comment(lib, "user32.lib")
|
||||
|
||||
#endif
|
||||
@ -20,13 +21,17 @@
|
||||
static long hitTest(RECT winrect, long x, long y, int borderWidth)
|
||||
{
|
||||
// 鼠标区域位于窗体边框,进行缩放
|
||||
if ((x >= winrect.left) && (x < winrect.left + borderWidth) && (y >= winrect.top) && (y < winrect.top + borderWidth)) {
|
||||
if ((x >= winrect.left) && (x < winrect.left + borderWidth) && (y >= winrect.top)
|
||||
&& (y < winrect.top + borderWidth)) {
|
||||
return HTTOPLEFT;
|
||||
} else if (x < winrect.right && x >= winrect.right - borderWidth && y >= winrect.top && y < winrect.top + borderWidth) {
|
||||
} else if (x < winrect.right && x >= winrect.right - borderWidth && y >= winrect.top
|
||||
&& y < winrect.top + borderWidth) {
|
||||
return HTTOPRIGHT;
|
||||
} else if (x >= winrect.left && x < winrect.left + borderWidth && y < winrect.bottom && y >= winrect.bottom - borderWidth) {
|
||||
} else if (x >= winrect.left && x < winrect.left + borderWidth && y < winrect.bottom
|
||||
&& y >= winrect.bottom - borderWidth) {
|
||||
return HTBOTTOMLEFT;
|
||||
} else if (x < winrect.right && x >= winrect.right - borderWidth && y < winrect.bottom && y >= winrect.bottom - borderWidth) {
|
||||
} else if (x < winrect.right && x >= winrect.right - borderWidth && y < winrect.bottom
|
||||
&& y >= winrect.bottom - borderWidth) {
|
||||
return HTBOTTOMRIGHT;
|
||||
} else if (x >= winrect.left && x < winrect.left + borderWidth) {
|
||||
return HTLEFT;
|
||||
@ -51,14 +56,11 @@ static bool isFullWin(QQuickView *win)
|
||||
return win->windowState() == Qt::WindowFullScreen;
|
||||
}
|
||||
|
||||
TaoFrameLessView::TaoFrameLessView(QWindow *parent)
|
||||
: QQuickView(parent)
|
||||
TaoFrameLessView::TaoFrameLessView(QWindow *parent) : QQuickView(parent)
|
||||
{
|
||||
setFlags(/*Qt::CustomizeWindowHint | */Qt::Window | Qt::FramelessWindowHint | Qt::WindowMinMaxButtonsHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
|
||||
setResizeMode(SizeViewToRootObject);
|
||||
setColor(QColor(Qt::transparent));
|
||||
setMinimumSize({1024, 720});
|
||||
resize(1440, 960);
|
||||
setFlags(/*Qt::CustomizeWindowHint | */ Qt::Window | Qt::FramelessWindowHint
|
||||
| Qt::WindowMinMaxButtonsHint | Qt::WindowTitleHint | Qt::WindowSystemMenuHint);
|
||||
setResizeMode(SizeRootObjectToView);
|
||||
|
||||
// WS_THICKFRAME 带回Areo效果
|
||||
#if WIN32
|
||||
@ -68,7 +70,8 @@ TaoFrameLessView::TaoFrameLessView(QWindow *parent)
|
||||
#endif
|
||||
|
||||
setIsMax(isMaxWin(this));
|
||||
connect(this, &QWindow::windowStateChanged, this, [&](Qt::WindowState state) { setIsMax(state == Qt::WindowMaximized); });
|
||||
connect(this, &QWindow::windowStateChanged, this,
|
||||
[&](Qt::WindowState state) { setIsMax(state == Qt::WindowMaximized); });
|
||||
}
|
||||
|
||||
TaoFrameLessView::~TaoFrameLessView() {}
|
||||
@ -98,7 +101,7 @@ void TaoFrameLessView::setIsMax(bool isMax)
|
||||
#if WIN32
|
||||
const long border_width = 6;
|
||||
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool TaoView::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
|
||||
bool TaoFrameLessView::nativeEvent(const QByteArray &eventType, void *message, qintptr *result)
|
||||
# else
|
||||
bool TaoFrameLessView::nativeEvent(const QByteArray &eventType, void *message, long *result)
|
||||
# endif
|
||||
@ -115,16 +118,16 @@ bool TaoFrameLessView::nativeEvent(const QByteArray &eventType, void *message, l
|
||||
const auto mode = static_cast<BOOL>(msg->wParam);
|
||||
*result = mode ? WVR_REDRAW : 0;
|
||||
|
||||
const auto clientRect = mode ? &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(msg->lParam)->rgrc[0]) : reinterpret_cast<LPRECT>(msg->lParam);
|
||||
const auto clientRect = mode
|
||||
? &(reinterpret_cast<LPNCCALCSIZE_PARAMS>(msg->lParam)->rgrc[0])
|
||||
: reinterpret_cast<LPRECT>(msg->lParam);
|
||||
//规避 拖动border进行resize时界面闪烁
|
||||
if (!isMaxWin(this) && !isFullWin(this)) {
|
||||
if (clientRect->top != 0)
|
||||
{
|
||||
if (clientRect->top != 0) {
|
||||
clientRect->top -= 1;
|
||||
}
|
||||
} else {
|
||||
if (clientRect->top != 0)
|
||||
{
|
||||
if (clientRect->top != 0) {
|
||||
clientRect->top += 1;
|
||||
}
|
||||
}
|
||||
@ -147,11 +150,11 @@ bool TaoFrameLessView::nativeEvent(const QByteArray &eventType, void *message, l
|
||||
}
|
||||
}
|
||||
|
||||
if (m_titleItem)
|
||||
{
|
||||
if (m_titleItem) {
|
||||
auto titlePos = m_titleItem->mapToGlobal(m_titleItem->position());
|
||||
titlePos = mapFromGlobal(titlePos.toPoint());
|
||||
auto titleRect = QRect(titlePos.x(), titlePos.y(), m_titleItem->width(), m_titleItem->height());
|
||||
auto titleRect =
|
||||
QRect(titlePos.x(), titlePos.y(), m_titleItem->width(), m_titleItem->height());
|
||||
double dpr = qApp->devicePixelRatio();
|
||||
QPoint pos = mapFromGlobal(QPoint(x / dpr, y / dpr));
|
||||
if (titleRect.contains(pos)) {
|
||||
|
12
3rdparty/TaoCommon/Frameless/TaoFrameLessView.h
vendored
12
3rdparty/TaoCommon/Frameless/TaoFrameLessView.h
vendored
@ -11,14 +11,8 @@ public:
|
||||
explicit TaoFrameLessView(QWindow *parent = nullptr);
|
||||
~TaoFrameLessView();
|
||||
void moveToScreenCenter();
|
||||
bool isMax() const
|
||||
{
|
||||
return m_isMax;
|
||||
}
|
||||
QQuickItem *titleItem() const
|
||||
{
|
||||
return m_titleItem;
|
||||
}
|
||||
bool isMax() const { return m_isMax; }
|
||||
QQuickItem *titleItem() const { return m_titleItem; }
|
||||
public slots:
|
||||
void setIsMax(bool isMax);
|
||||
void setTitleItem(QQuickItem *item);
|
||||
@ -26,7 +20,6 @@ signals:
|
||||
void isMaxChanged(bool isMax);
|
||||
|
||||
protected:
|
||||
|
||||
#if WIN32
|
||||
# if QT_VERSION >= QT_VERSION_CHECK(6, 0, 0)
|
||||
bool nativeEvent(const QByteArray &eventType, void *message, qintptr *result) override;
|
||||
@ -38,4 +31,3 @@ private:
|
||||
bool m_isMax;
|
||||
QQuickItem *m_titleItem = nullptr;
|
||||
};
|
||||
|
||||
|
37
3rdparty/TaoCommon/Logger/logger.cpp
vendored
37
3rdparty/TaoCommon/Logger/logger.cpp
vendored
@ -15,40 +15,36 @@
|
||||
# include <cstdio>
|
||||
#endif
|
||||
|
||||
namespace Logger
|
||||
{
|
||||
namespace Logger {
|
||||
static QString gLogDir;
|
||||
static int gLogMaxCount;
|
||||
|
||||
static void outputMessage(QtMsgType type, const QMessageLogContext &context, const QString &msg);
|
||||
static void outputMessageAsync(QtMsgType type, const QMessageLogContext& context, const QString& msg);
|
||||
static void outputMessageAsync(QtMsgType type, const QMessageLogContext &context,
|
||||
const QString &msg);
|
||||
|
||||
void initLog(const QString &logPath, int logMaxCount, bool async)
|
||||
{
|
||||
if (async)
|
||||
{
|
||||
if (async) {
|
||||
qInstallMessageHandler(outputMessageAsync);
|
||||
}
|
||||
else
|
||||
{
|
||||
} else {
|
||||
qInstallMessageHandler(outputMessage);
|
||||
}
|
||||
|
||||
gLogDir = QCoreApplication::applicationDirPath() + QStringLiteral("/") + logPath;
|
||||
gLogMaxCount = logMaxCount;
|
||||
QDir dir(gLogDir);
|
||||
if (!dir.exists())
|
||||
{
|
||||
if (!dir.exists()) {
|
||||
dir.mkpath(dir.absolutePath());
|
||||
}
|
||||
QStringList infoList = dir.entryList(QDir::Files, QDir::Name);
|
||||
while (infoList.size() > gLogMaxCount)
|
||||
{
|
||||
while (infoList.size() > gLogMaxCount) {
|
||||
dir.remove(infoList.first());
|
||||
infoList.removeFirst();
|
||||
}
|
||||
}
|
||||
static void outputMessageAsync(QtMsgType type, const QMessageLogContext &context, const QString &msg)
|
||||
static void outputMessageAsync(QtMsgType type, const QMessageLogContext &context,
|
||||
const QString &msg)
|
||||
{
|
||||
static const QString messageTemp = QStringLiteral("<div class=\"%1\">%2</div>\r\n");
|
||||
static const char typeList[] = { 'd', 'w', 'c', 'f', 'i' };
|
||||
@ -71,10 +67,8 @@ namespace Logger
|
||||
QString htmlMessage = messageTemp.arg(typeList[static_cast<int>(type)]).arg(message);
|
||||
QString newfileName = QStringLiteral("%1/%2_log.html").arg(gLogDir).arg(fileNameDt);
|
||||
mutex.lock();
|
||||
if (file.fileName() != newfileName)
|
||||
{
|
||||
if (file.isOpen())
|
||||
{
|
||||
if (file.fileName() != newfileName) {
|
||||
if (file.isOpen()) {
|
||||
file.close();
|
||||
}
|
||||
file.setFileName(newfileName);
|
||||
@ -86,16 +80,14 @@ namespace Logger
|
||||
#else
|
||||
textStream.setCodec("UTF-8");
|
||||
#endif
|
||||
if (!exist)
|
||||
{
|
||||
if (!exist) {
|
||||
textStream << logTemplate << "\r\n";
|
||||
}
|
||||
}
|
||||
textStream << htmlMessage;
|
||||
textStream.flush();
|
||||
count += htmlMessage.length();
|
||||
if (count >= maxCount)
|
||||
{
|
||||
if (count >= maxCount) {
|
||||
file.close();
|
||||
file.open(QIODevice::WriteOnly | QIODevice::Append);
|
||||
}
|
||||
@ -136,8 +128,7 @@ namespace Logger
|
||||
#else
|
||||
textStream.setCodec("UTF-8");
|
||||
#endif
|
||||
if (!exist)
|
||||
{
|
||||
if (!exist) {
|
||||
textStream << logTemplate << "\r\n";
|
||||
}
|
||||
textStream << htmlMessage;
|
||||
|
6
3rdparty/TaoCommon/Logger/logger.h
vendored
6
3rdparty/TaoCommon/Logger/logger.h
vendored
@ -2,8 +2,7 @@
|
||||
#include "taocommonglobal.h"
|
||||
#include <QString>
|
||||
#include <QDebug>
|
||||
namespace Logger
|
||||
{
|
||||
namespace Logger {
|
||||
#ifdef _DEBUG
|
||||
# define LOG_DEBUG qDebug() << __FILE__ << __LINE__
|
||||
# define LOG_INFO qInfo() << __FILE__ << __LINE__
|
||||
@ -19,5 +18,6 @@ namespace Logger
|
||||
// logPath 存储路径
|
||||
// logMaxCount 最大数
|
||||
// async 是否异步存储 默认异步存储。异步存储会缓存log,达到一定数量、或者软件退出时才写入文件。
|
||||
void TAO_API initLog(const QString &logPath = QStringLiteral("Log"), int logMaxCount = 1024, bool async = true);
|
||||
void TAO_API initLog(const QString &logPath = QStringLiteral("Log"), int logMaxCount = 1024,
|
||||
bool async = true);
|
||||
} // namespace Logger
|
||||
|
5
3rdparty/TaoCommon/Logger/loggertemplate.h
vendored
5
3rdparty/TaoCommon/Logger/loggertemplate.h
vendored
@ -1,8 +1,7 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include <QString>
|
||||
#include <string>
|
||||
namespace Logger
|
||||
{
|
||||
namespace Logger {
|
||||
const static auto logTemplate = QString::fromUtf8(u8R"logTemplate(
|
||||
<?xml version="1.0" encoding="utf-8" standalone="yes"?>
|
||||
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
|
||||
|
3
3rdparty/TaoCommon/Thread/threadcommon.h
vendored
3
3rdparty/TaoCommon/Thread/threadcommon.h
vendored
@ -1,8 +1,7 @@
|
||||
#pragma once
|
||||
#include <QMetaType>
|
||||
#include <functional>
|
||||
namespace TaoCommon
|
||||
{
|
||||
namespace TaoCommon {
|
||||
using WorkCallback = std::function<bool()>;
|
||||
using WorkResultCallback = std::function<void(bool)>;
|
||||
}
|
||||
|
5
3rdparty/TaoCommon/Thread/threadpool.cpp
vendored
5
3rdparty/TaoCommon/Thread/threadpool.cpp
vendored
@ -1,8 +1,7 @@
|
||||
#include "threadpool.h"
|
||||
|
||||
#include <QThreadPool>
|
||||
namespace TaoCommon
|
||||
{
|
||||
namespace TaoCommon {
|
||||
ThreadObject::ThreadObject(const WorkCallback &work) : m_workCall(work) {}
|
||||
void ThreadObject::run()
|
||||
{
|
||||
@ -18,5 +17,3 @@ namespace TaoCommon
|
||||
QThreadPool::globalInstance()->start(obj);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
10
3rdparty/TaoCommon/Thread/threadpool.h
vendored
10
3rdparty/TaoCommon/Thread/threadpool.h
vendored
@ -1,18 +1,15 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "taocommonglobal.h"
|
||||
#include "threadcommon.h"
|
||||
#include <QObject>
|
||||
#include <QRunnable>
|
||||
namespace TaoCommon
|
||||
{
|
||||
namespace TaoCommon {
|
||||
// 对Qt线程池的简单封装,适合一次性执行的任务。
|
||||
// 用法: ThreadPool::getInstance()->work(workCall, resultCall)
|
||||
// workCall是在新线程中执行的任务,resultCall是任务执行完成后,回到调用线程中用来处理执行结果。
|
||||
// 不支持任务取消、暂停。
|
||||
|
||||
class ThreadObject
|
||||
: public QObject
|
||||
, public QRunnable
|
||||
class ThreadObject : public QObject, public QRunnable
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
@ -35,6 +32,7 @@ namespace TaoCommon
|
||||
}
|
||||
// workCall in sub thread, resultCall in main thread
|
||||
void work(const WorkCallback &workCall, const WorkResultCallback &resultCall);
|
||||
|
||||
private:
|
||||
ThreadPool() {}
|
||||
};
|
||||
|
@ -1,10 +1,9 @@
|
||||
#pragma once
|
||||
#pragma once
|
||||
#include "taocommonglobal.h"
|
||||
#include "threadcommon.h"
|
||||
#include <QMap>
|
||||
#include <QThread>
|
||||
namespace TaoCommon
|
||||
{
|
||||
namespace TaoCommon {
|
||||
// 对Qt Worker-Controller 线程模型的简单封装,适合精确控制的任务。
|
||||
// 用法: ThreadController::getInstance()->work(workCall, resultCall)
|
||||
// workCall是在新线程中执行的任务,resultCall是任务执行完成后,回到调用线程中用来处理执行结果。
|
||||
@ -14,7 +13,10 @@ namespace TaoCommon
|
||||
{
|
||||
Q_OBJECT
|
||||
public:
|
||||
ThreadWorker(uint64_t id, const WorkCallback &workCall, QObject *parent = nullptr) : QObject(parent), m_id(id), m_workCall(workCall) {}
|
||||
ThreadWorker(uint64_t id, const WorkCallback &workCall, QObject *parent = nullptr)
|
||||
: QObject(parent), m_id(id), m_workCall(workCall)
|
||||
{
|
||||
}
|
||||
|
||||
signals:
|
||||
void workFinished(bool, uint64_t);
|
||||
@ -24,6 +26,7 @@ namespace TaoCommon
|
||||
bool ret = m_workCall();
|
||||
emit workFinished(ret, m_id);
|
||||
}
|
||||
|
||||
private:
|
||||
const uint64_t m_id;
|
||||
WorkCallback m_workCall;
|
||||
@ -40,10 +43,8 @@ namespace TaoCommon
|
||||
|
||||
~ThreadController()
|
||||
{
|
||||
for (auto k : m_threadMap.uniqueKeys())
|
||||
{
|
||||
if (m_threadMap.value(k)->isRunning())
|
||||
{
|
||||
for (const auto &k : m_threadMap.keys()) {
|
||||
if (m_threadMap.value(k)->isRunning()) {
|
||||
m_threadMap.value(k)->quit();
|
||||
m_threadMap.value(k)->wait();
|
||||
}
|
||||
@ -63,17 +64,16 @@ namespace TaoCommon
|
||||
|
||||
connect(thread, &QThread::finished, obj, &QObject::deleteLater);
|
||||
connect(thread, &QThread::started, obj, &ThreadWorker::doWork);
|
||||
connect(obj, &ThreadWorker::workFinished, this, &ThreadController::onWorkFinished, Qt::QueuedConnection);
|
||||
connect(obj, &ThreadWorker::workFinished, this, &ThreadController::onWorkFinished,
|
||||
Qt::QueuedConnection);
|
||||
thread->start();
|
||||
return m_rollId;
|
||||
}
|
||||
void cancle(uint64_t id)
|
||||
{
|
||||
auto it = m_threadMap.find(id);
|
||||
if (it != m_threadMap.end())
|
||||
{
|
||||
if ((*it)->isRunning())
|
||||
{
|
||||
if (it != m_threadMap.end()) {
|
||||
if ((*it)->isRunning()) {
|
||||
(*it)->terminate();
|
||||
}
|
||||
}
|
||||
@ -82,10 +82,8 @@ namespace TaoCommon
|
||||
void quit(uint64_t id)
|
||||
{
|
||||
auto it = m_threadMap.find(id);
|
||||
if (it != m_threadMap.end())
|
||||
{
|
||||
if ((*it)->isRunning())
|
||||
{
|
||||
if (it != m_threadMap.end()) {
|
||||
if ((*it)->isRunning()) {
|
||||
(*it)->quit();
|
||||
(*it)->wait();
|
||||
(*it)->deleteLater();
|
||||
@ -93,18 +91,13 @@ namespace TaoCommon
|
||||
}
|
||||
m_resultCallback.remove(id);
|
||||
}
|
||||
QList<uint64_t> getAllWorkId() const
|
||||
{
|
||||
return m_threadMap.uniqueKeys();
|
||||
}
|
||||
QList<uint64_t> getAllWorkId() const { return m_threadMap.keys(); }
|
||||
protected slots:
|
||||
void onWorkFinished(bool ok, uint64_t id)
|
||||
{
|
||||
auto it = m_threadMap.find(id);
|
||||
if (it != m_threadMap.end())
|
||||
{
|
||||
if ((*it)->isRunning())
|
||||
{
|
||||
if (it != m_threadMap.end()) {
|
||||
if ((*it)->isRunning()) {
|
||||
(*it)->quit();
|
||||
(*it)->wait();
|
||||
(*it)->deleteLater();
|
||||
@ -112,12 +105,12 @@ namespace TaoCommon
|
||||
m_threadMap.remove(id);
|
||||
}
|
||||
auto caller = m_resultCallback.find(id);
|
||||
if (caller != m_resultCallback.end())
|
||||
{
|
||||
if (caller != m_resultCallback.end()) {
|
||||
(*caller)(ok);
|
||||
m_resultCallback.remove(id);
|
||||
}
|
||||
}
|
||||
|
||||
protected:
|
||||
ThreadController(QObject *parent = nullptr) : QObject(parent) {}
|
||||
|
||||
|
20
3rdparty/TaoCommon/Trans/Trans.cpp
vendored
20
3rdparty/TaoCommon/Trans/Trans.cpp
vendored
@ -8,10 +8,7 @@
|
||||
#include <QQmlEngine>
|
||||
const static auto cEnglisthStr = QStringLiteral("English");
|
||||
const static auto cChineseStr = QStringLiteral("简体中文");
|
||||
Trans::Trans(QObject* parent)
|
||||
: QTranslator(parent)
|
||||
{
|
||||
}
|
||||
Trans::Trans(QObject *parent) : QTranslator(parent) {}
|
||||
|
||||
void Trans::beforeUiReady(QQmlContext *ctx)
|
||||
{
|
||||
@ -21,12 +18,10 @@ void Trans::beforeUiReady(QQmlContext* ctx)
|
||||
qApp->installTranslator(this);
|
||||
}
|
||||
|
||||
void Trans::afterUiReady()
|
||||
{
|
||||
void Trans::afterUiReady() {}
|
||||
|
||||
}
|
||||
|
||||
QString Trans::translate(const char *context, const char *sourceText, const char *disambiguation, int n) const
|
||||
QString Trans::translate(const char *context, const char *sourceText, const char *disambiguation,
|
||||
int n) const
|
||||
{
|
||||
Q_UNUSED(context)
|
||||
Q_UNUSED(disambiguation)
|
||||
@ -40,7 +35,7 @@ void Trans::loadFolder(const QString& folder)
|
||||
QDir dir(folder);
|
||||
auto infos = dir.entryInfoList({ "language_*.json" }, QDir::Files);
|
||||
QString lang;
|
||||
for (auto info : infos) {
|
||||
for (const auto &info : infos) {
|
||||
load(lang, info.absoluteFilePath());
|
||||
}
|
||||
|
||||
@ -68,7 +63,7 @@ bool Trans::load(QString& lang, const QString& filePath)
|
||||
}
|
||||
lang = rootObj.value("lang").toString();
|
||||
const auto &trans = rootObj.value("trans").toArray();
|
||||
for (auto i : trans) {
|
||||
for (const auto &i : trans) {
|
||||
auto transObj = i.toObject();
|
||||
QString key = transObj.value("key").toString();
|
||||
QString value = transObj.value("value").toString();
|
||||
@ -102,7 +97,7 @@ void Trans::initEnglish()
|
||||
} else {
|
||||
map = m_map.value(m_map.keys().first());
|
||||
}
|
||||
for (auto key : map.keys()) {
|
||||
for (const auto &key : map.keys()) {
|
||||
m_map[cEnglisthStr][key] = key;
|
||||
}
|
||||
}
|
||||
@ -126,7 +121,6 @@ void Trans::setCurrentLang(const QString& currentLang)
|
||||
#else
|
||||
emit transStringChanged();
|
||||
#endif
|
||||
|
||||
}
|
||||
|
||||
void Trans::setLanguages(const QStringList &languages)
|
||||
|
9
3rdparty/TaoCommon/Trans/Trans.h
vendored
9
3rdparty/TaoCommon/Trans/Trans.h
vendored
@ -19,16 +19,18 @@ public:
|
||||
Q_INVOKABLE void loadFolder(const QString &folder);
|
||||
|
||||
Q_INVOKABLE bool load(QString &lang, const QString &filePath);
|
||||
|
||||
public:
|
||||
void beforeUiReady(QQmlContext *ctx);
|
||||
|
||||
void afterUiReady();
|
||||
|
||||
QString translate(const char *context, const char *sourceText, const char *disambiguation = nullptr, int n = -1) const override;
|
||||
QString translate(const char *context, const char *sourceText,
|
||||
const char *disambiguation = nullptr, int n = -1) const override;
|
||||
|
||||
public:
|
||||
const QString ¤tLang() const;
|
||||
|
||||
|
||||
const QStringList &languages() const;
|
||||
|
||||
const QString &transString() const;
|
||||
@ -46,10 +48,12 @@ signals:
|
||||
void folderLoaded(const QString &folder);
|
||||
|
||||
void transStringChanged();
|
||||
|
||||
protected:
|
||||
void setLanguages(const QStringList &languages);
|
||||
|
||||
void initEnglish();
|
||||
|
||||
private:
|
||||
QString m_currentLang;
|
||||
// <"English", <"key", "value">>
|
||||
@ -58,4 +62,3 @@ private:
|
||||
QString m_transString;
|
||||
QQmlContext *m_ctx;
|
||||
};
|
||||
|
||||
|
85
_clang-format
Normal file
85
_clang-format
Normal file
@ -0,0 +1,85 @@
|
||||
# Copyright (C) 2016 Olivier Goffart <ogoffart@woboq.com>
|
||||
#
|
||||
# You may use this file under the terms of the 3-clause BSD license.
|
||||
# See the file LICENSE from this package for details.
|
||||
|
||||
# This is the clang-format configuration style to be used by Qt,
|
||||
# based on the rules from https://wiki.qt.io/Qt_Coding_Style and
|
||||
# https://wiki.qt.io/Coding_Conventions
|
||||
|
||||
---
|
||||
# Webkit style was loosely based on the Qt style
|
||||
BasedOnStyle: WebKit
|
||||
|
||||
Standard: Cpp11
|
||||
|
||||
# Column width is limited to 100 in accordance with Qt Coding Style.
|
||||
# https://wiki.qt.io/Qt_Coding_Style
|
||||
# Note that this may be changed at some point in the future.
|
||||
ColumnLimit: 100
|
||||
# How much weight do extra characters after the line length limit have.
|
||||
# PenaltyExcessCharacter: 4
|
||||
|
||||
# Disable reflow of qdoc comments: indentation rules are different.
|
||||
# Translation comments are also excluded.
|
||||
CommentPragmas: "^!|^:"
|
||||
|
||||
# We want a space between the type and the star for pointer types.
|
||||
PointerBindsToType: false
|
||||
|
||||
# We use template< without space.
|
||||
SpaceAfterTemplateKeyword: false
|
||||
|
||||
# We want to break before the operators, but not before a '='.
|
||||
BreakBeforeBinaryOperators: NonAssignment
|
||||
|
||||
# Braces are usually attached, but not after functions or class declarations.
|
||||
BreakBeforeBraces: Custom
|
||||
BraceWrapping:
|
||||
AfterClass: true
|
||||
AfterControlStatement: false
|
||||
AfterEnum: false
|
||||
AfterFunction: true
|
||||
AfterNamespace: false
|
||||
AfterObjCDeclaration: false
|
||||
AfterStruct: true
|
||||
AfterUnion: false
|
||||
BeforeCatch: false
|
||||
BeforeElse: false
|
||||
IndentBraces: false
|
||||
|
||||
# When constructor initializers do not fit on one line, put them each on a new line.
|
||||
ConstructorInitializerAllOnOneLineOrOnePerLine: true
|
||||
# Indent initializers by 4 spaces
|
||||
ConstructorInitializerIndentWidth: 4
|
||||
|
||||
# Indent width for line continuations.
|
||||
ContinuationIndentWidth: 8
|
||||
|
||||
# No indentation for namespaces.
|
||||
NamespaceIndentation: None
|
||||
|
||||
# Allow indentation for preprocessing directives (if/ifdef/endif). https://reviews.llvm.org/rL312125
|
||||
IndentPPDirectives: AfterHash
|
||||
|
||||
# Horizontally align arguments after an open bracket.
|
||||
# The coding style does not specify the following, but this is what gives
|
||||
# results closest to the existing code.
|
||||
AlignAfterOpenBracket: true
|
||||
AlwaysBreakTemplateDeclarations: true
|
||||
|
||||
# Ideally we should also allow less short function in a single line, but
|
||||
# clang-format does not handle that.
|
||||
AllowShortFunctionsOnASingleLine: Inline
|
||||
|
||||
# The coding style specifies some include order categories, but also tells to
|
||||
# separate categories with an empty line. It does not specify the order within
|
||||
# the categories. Since the SortInclude feature of clang-format does not
|
||||
# re-order includes separated by empty lines, the feature is not used.
|
||||
SortIncludes: false
|
||||
|
||||
# macros for which the opening brace stays attached.
|
||||
ForEachMacros: [ foreach, Q_FOREACH, BOOST_FOREACH, forever, Q_FOREVER, QBENCHMARK, QBENCHMARK_ONCE ]
|
||||
|
||||
# Break constructor initializers before the colon and after the commas.
|
||||
BreakConstructorInitializers: BeforeColon
|
BIN
bin/debug/TaoQuickShow.exe
Normal file
BIN
bin/debug/TaoQuickShow.exe
Normal file
Binary file not shown.
BIN
bin/debug/TaoQuickShow.ilk
Normal file
BIN
bin/debug/TaoQuickShow.ilk
Normal file
Binary file not shown.
BIN
bin/debug/TaoQuickShow.pdb
Normal file
BIN
bin/debug/TaoQuickShow.pdb
Normal file
Binary file not shown.
422
bin/debug/Trans/language_zh.json
Normal file
422
bin/debug/Trans/language_zh.json
Normal file
@ -0,0 +1,422 @@
|
||||
{
|
||||
"lang": "简体中文",
|
||||
"trans":[
|
||||
{
|
||||
"key": "Chinese",
|
||||
"value": "简体中文"
|
||||
},
|
||||
{
|
||||
"key": "Quit",
|
||||
"value": "退出"
|
||||
},
|
||||
{
|
||||
"key": "minimal",
|
||||
"value": "最小化"
|
||||
},
|
||||
{
|
||||
"key": "maximize",
|
||||
"value": "最大化"
|
||||
},
|
||||
{
|
||||
"key": "normal",
|
||||
"value": "窗口"
|
||||
},
|
||||
{
|
||||
"key": "skin",
|
||||
"value": "皮肤"
|
||||
},
|
||||
{
|
||||
"key": "Language",
|
||||
"value": "语言"
|
||||
},
|
||||
{
|
||||
"key": "Settings",
|
||||
"value": "设置"
|
||||
},
|
||||
{
|
||||
"key": "About",
|
||||
"value": "关于"
|
||||
},
|
||||
{
|
||||
"key": "Badget",
|
||||
"value": "徽章"
|
||||
},
|
||||
{
|
||||
"key": "Barrage",
|
||||
"value": "弹幕"
|
||||
},
|
||||
{
|
||||
"key": "Label",
|
||||
"value": "标签"
|
||||
},
|
||||
{
|
||||
"key": "ProgressBar",
|
||||
"value": "进度条"
|
||||
},
|
||||
{
|
||||
"key": "Scrolling",
|
||||
"value": "滚动列表"
|
||||
},
|
||||
{
|
||||
"key": "Menu",
|
||||
"value": "菜单"
|
||||
},
|
||||
{
|
||||
"key": "TaoQuick",
|
||||
"value": "TaoQuick"
|
||||
},
|
||||
{
|
||||
"key": "Blue",
|
||||
"value": "苍穹蓝"
|
||||
},
|
||||
{
|
||||
"key": "Green",
|
||||
"value": " 清爽绿"
|
||||
},
|
||||
{
|
||||
"key": "Pink",
|
||||
"value": "淑女粉"
|
||||
},
|
||||
{
|
||||
"key": "Red",
|
||||
"value": "一品红"
|
||||
},
|
||||
|
||||
{
|
||||
"key": "Gold",
|
||||
"value": "富贵金"
|
||||
},
|
||||
{
|
||||
"key": "Black",
|
||||
"value": "高冷黑"
|
||||
},
|
||||
{
|
||||
"key": "Search",
|
||||
"value": "搜索"
|
||||
},
|
||||
{
|
||||
"key": "TaoQuick provides a set of controls that can be used to build complete interfaces in Qt Quick.",
|
||||
"value": "TaoQuick 提供一系列功能组件,可用于Qt Quick 构建的应用中。"
|
||||
},
|
||||
{
|
||||
"key": "Welcome",
|
||||
"value": "欢迎"
|
||||
},
|
||||
{
|
||||
"key": "Close",
|
||||
"value": "关闭"
|
||||
},
|
||||
|
||||
{
|
||||
"key": "QRcode",
|
||||
"value": "二维码"
|
||||
},
|
||||
|
||||
{
|
||||
"key": "IP address",
|
||||
"value": "IP地址"
|
||||
},
|
||||
{
|
||||
"key": "Home",
|
||||
"value": "首页"
|
||||
},
|
||||
{
|
||||
"key": "Button",
|
||||
"value": "按钮"
|
||||
},
|
||||
{
|
||||
"key": "Gradient",
|
||||
"value": "渐变"
|
||||
},
|
||||
{
|
||||
"key": "Background",
|
||||
"value": "背景"
|
||||
},
|
||||
{
|
||||
"key": "Dialog",
|
||||
"value": "对话框"
|
||||
},
|
||||
{
|
||||
"key": "ShaderEffect",
|
||||
"value": "着色器特效"
|
||||
},
|
||||
|
||||
{
|
||||
"key": "Super Mario",
|
||||
"value": "超级马里奥"
|
||||
},
|
||||
{
|
||||
"key": "Effect",
|
||||
"value": "特效"
|
||||
},
|
||||
{
|
||||
"key": "Ring",
|
||||
"value": "环"
|
||||
},
|
||||
{
|
||||
"key": "Snail",
|
||||
"value": "蜗牛"
|
||||
},
|
||||
{
|
||||
"key": "CloudHole",
|
||||
"value": "穿云洞"
|
||||
},
|
||||
{
|
||||
"key": "Brilliant Starry Sky",
|
||||
"value": "璀璨星空"
|
||||
},
|
||||
{
|
||||
"key": "Keep up with the pace",
|
||||
"value": "跟上节奏"
|
||||
},
|
||||
{
|
||||
"key": "Undercurrent surge",
|
||||
"value": "暗流涌动"
|
||||
},
|
||||
{
|
||||
"key": "Magic Circle",
|
||||
"value": "魔力圈圈"
|
||||
},
|
||||
{
|
||||
"key": "Animation",
|
||||
"value": "动画"
|
||||
},
|
||||
{
|
||||
"key": "Enter",
|
||||
"value": "飞入"
|
||||
},
|
||||
{
|
||||
"key": "Grad",
|
||||
"value": "梯度"
|
||||
},
|
||||
{
|
||||
"key": "Cleavage",
|
||||
"value": "劈裂"
|
||||
},
|
||||
{
|
||||
"key": "Diagonal",
|
||||
"value": "对角线"
|
||||
},
|
||||
{
|
||||
"key": "Louver",
|
||||
"value": "百叶窗"
|
||||
},
|
||||
{
|
||||
"key": "Square",
|
||||
"value": "方盒"
|
||||
},
|
||||
{
|
||||
"key": "Circle",
|
||||
"value": "圆盒"
|
||||
},
|
||||
{
|
||||
"key": "Cross",
|
||||
"value": "十字"
|
||||
},
|
||||
{
|
||||
"key": "Rhombus",
|
||||
"value": "菱形"
|
||||
},
|
||||
{
|
||||
"key": "Wheel",
|
||||
"value": "轮子"
|
||||
},
|
||||
{
|
||||
"key": "Board",
|
||||
"value": "棋盘"
|
||||
},
|
||||
{
|
||||
"key": "Dissolve",
|
||||
"value": "溶解"
|
||||
},
|
||||
{
|
||||
"key": "PageSwitch",
|
||||
"value": "页面切换"
|
||||
},
|
||||
{
|
||||
"key": "FadeInOut",
|
||||
"value": "淡入淡出"
|
||||
},
|
||||
{
|
||||
"key": "Animation",
|
||||
"value":"动画"
|
||||
},
|
||||
{
|
||||
"key": "Effect",
|
||||
"value":"效果"
|
||||
},
|
||||
{
|
||||
"key": "PageSwitch",
|
||||
"value":"页面切换"
|
||||
},
|
||||
{
|
||||
"key": "ShaderEffect",
|
||||
"value":"着色器特效"
|
||||
},
|
||||
{
|
||||
"key": "Shape",
|
||||
"value":"图元"
|
||||
},
|
||||
{
|
||||
"key": "Text Button has no background and border",
|
||||
"value": "文本按钮 没有背景和边框"
|
||||
},
|
||||
{
|
||||
"key": "Material Button has a gradiant background when clicked",
|
||||
"value":"Material 按钮 在点击时,展示一个渐变的背景"
|
||||
},
|
||||
{
|
||||
"key": "General Button is consist of text, background and tooltip, it has normal, hover, pressed and disable states",
|
||||
"value": "通用按钮 由文本、背景和悬浮框组成,状态包含常规、悬浮、按下和禁用"
|
||||
},
|
||||
{
|
||||
"key": "Button can be design with different colors according to importance, example: blue for normal operation, red for delete operation and white for cancel operation",
|
||||
"value": "按钮可以按照重要度设计为不同的颜色,例如: 常规操作用蓝色,删除操作用红色,取消操作用白色"
|
||||
},
|
||||
{
|
||||
"key": "General Button can be custom style, such as round background, icon background, icon text ans so on",
|
||||
"value": "通用按钮可以任意自定义风格, 诸如: 圆角背景、图标、带图标文字等等"
|
||||
},
|
||||
{
|
||||
"key": "Image",
|
||||
"value": "图片"
|
||||
},
|
||||
{
|
||||
"key": "General Image",
|
||||
"value": "通用图片"
|
||||
},
|
||||
{
|
||||
"key": "Image with tip",
|
||||
"value": "带悬浮的图片"
|
||||
},
|
||||
{
|
||||
"key": "View Source Code",
|
||||
"value": "查看源码"
|
||||
},
|
||||
{
|
||||
"key": "Image Button",
|
||||
"value": "图片按钮"
|
||||
},
|
||||
{
|
||||
"key": "Image Text Button",
|
||||
"value": "图文按钮"
|
||||
},
|
||||
{
|
||||
"key": "Data Entry",
|
||||
"value": "数据输入"
|
||||
},
|
||||
{
|
||||
"key": "Hello, TaoQuick",
|
||||
"value": "你好, TaoQuick"
|
||||
},
|
||||
{
|
||||
"key": "Sunday",
|
||||
"value": "星期天"
|
||||
},
|
||||
{
|
||||
"key": "Monday",
|
||||
"value": "星期一"
|
||||
},
|
||||
{
|
||||
"key": "Tuesday",
|
||||
"value": "星期二"
|
||||
},
|
||||
{
|
||||
"key": "Wednesday",
|
||||
"value": "星期三"
|
||||
},
|
||||
{
|
||||
"key": "Thursday",
|
||||
"value": "星期四"
|
||||
},
|
||||
{
|
||||
"key": "Friday",
|
||||
"value": "星期五"
|
||||
},
|
||||
{
|
||||
"key": "Saturday",
|
||||
"value": "星期六"
|
||||
},
|
||||
{
|
||||
"key": "Others",
|
||||
"value": "其它"
|
||||
},
|
||||
{
|
||||
"key": "Sponsors",
|
||||
"value": "赞助"
|
||||
},
|
||||
{
|
||||
"key": "RectDraw, can draw rect by mouse press and move",
|
||||
"value": "RectDraw 可以通过鼠标按下和移动来画框"
|
||||
},
|
||||
{
|
||||
"key": "Drag Rect",
|
||||
"value": "拖动框"
|
||||
},
|
||||
{
|
||||
"key": "TemplateDragBorder can be use to resize, move or rotation Rectangle by draging corner or border handler",
|
||||
"value": "TemplateDragBorder 可通过操作器改变尺寸、坐标或旋转"
|
||||
},
|
||||
{
|
||||
"key": "General",
|
||||
"value": "通用"
|
||||
},
|
||||
{
|
||||
"key": "Animation",
|
||||
"value": "动画"
|
||||
},
|
||||
{
|
||||
"key": "Effect",
|
||||
"value": "特效"
|
||||
},
|
||||
{
|
||||
"key": "PageSwitch",
|
||||
"value": "页面切换"
|
||||
},
|
||||
{
|
||||
"key": "ShaderEffect",
|
||||
"value": "着色器特效"
|
||||
},
|
||||
{
|
||||
"key": "Auto Play",
|
||||
"value": "自动播放"
|
||||
},
|
||||
{
|
||||
"key": "Replay",
|
||||
"value": "重新播放"
|
||||
},
|
||||
{
|
||||
"key": "No Data",
|
||||
"value": "无数据"
|
||||
},
|
||||
{
|
||||
"key": "last %1 item",
|
||||
"value": "前%1项"
|
||||
},
|
||||
{
|
||||
"key": "last %1 items",
|
||||
"value": "前%1项"
|
||||
},
|
||||
{
|
||||
"key": "next %1 item",
|
||||
"value": "后%1项"
|
||||
},
|
||||
{
|
||||
"key": "next %1 items",
|
||||
"value": "后%1项"
|
||||
},
|
||||
{
|
||||
"key": "Total %1 item",
|
||||
"value": "共计%1项"
|
||||
},
|
||||
{
|
||||
"key": "Total %1 items",
|
||||
"value": "共计%1项"
|
||||
},
|
||||
{
|
||||
"key": "Go to",
|
||||
"value": "转到"
|
||||
}
|
||||
|
||||
]
|
||||
}
|
@ -1,6 +1,5 @@
|
||||
import QtQuick 2.9
|
||||
import QtQuick.Controls 2.2
|
||||
import QtGraphicalEffects 1.0
|
||||
import TaoQuick 1.0
|
||||
import "../Biz"
|
||||
|
||||
@ -116,13 +115,6 @@ Popup {
|
||||
}
|
||||
}
|
||||
}
|
||||
DropShadow {
|
||||
source: back
|
||||
anchors.fill: back
|
||||
radius: 4
|
||||
samples: 16
|
||||
color: "#80000000"
|
||||
}
|
||||
}
|
||||
|
||||
function show() {
|
||||
|
@ -29,6 +29,8 @@ int main(int argc, char** argv)
|
||||
qWarning() << "appPath" << appPath;
|
||||
|
||||
TaoFrameLessView view;
|
||||
view.setMinimumSize({ 800, 600 });
|
||||
view.resize(1440, 960);
|
||||
Trans trans;
|
||||
AppInfo appInfo;
|
||||
trans.beforeUiReady(view.rootContext());
|
||||
|
Loading…
x
Reference in New Issue
Block a user