添加项目完全代码
This commit is contained in:
parent
209c547dcc
commit
e3437e9bb6
|
@ -5,6 +5,8 @@ VisualStudioVersion = 15.0.34112.143
|
|||
MinimumVisualStudioVersion = 10.0.40219.1
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "QtNovels", "QtNovels\QtNovels.vcxproj", "{ECED0F1E-01F4-4FBB-BFC0-6A43BA55A52B}"
|
||||
EndProject
|
||||
Project("{8BC9CEB8-8B4A-11D0-8D11-00A0C91BC942}") = "libWsTextEdit", "libWsTextEdit\libWsTextEdit.vcxproj", "{DB6BC034-92EF-457C-B1B9-7997857E782B}"
|
||||
EndProject
|
||||
Global
|
||||
GlobalSection(SolutionConfigurationPlatforms) = preSolution
|
||||
Debug|x64 = Debug|x64
|
||||
|
@ -15,6 +17,10 @@ Global
|
|||
{ECED0F1E-01F4-4FBB-BFC0-6A43BA55A52B}.Debug|x64.Build.0 = Debug|x64
|
||||
{ECED0F1E-01F4-4FBB-BFC0-6A43BA55A52B}.Release|x64.ActiveCfg = Release|x64
|
||||
{ECED0F1E-01F4-4FBB-BFC0-6A43BA55A52B}.Release|x64.Build.0 = Release|x64
|
||||
{DB6BC034-92EF-457C-B1B9-7997857E782B}.Debug|x64.ActiveCfg = Debug|x64
|
||||
{DB6BC034-92EF-457C-B1B9-7997857E782B}.Debug|x64.Build.0 = Debug|x64
|
||||
{DB6BC034-92EF-457C-B1B9-7997857E782B}.Release|x64.ActiveCfg = Release|x64
|
||||
{DB6BC034-92EF-457C-B1B9-7997857E782B}.Release|x64.Build.0 = Release|x64
|
||||
EndGlobalSection
|
||||
GlobalSection(SolutionProperties) = preSolution
|
||||
HideSolutionNode = FALSE
|
||||
|
|
|
@ -13,19 +13,18 @@
|
|||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{ECED0F1E-01F4-4FBB-BFC0-6A43BA55A52B}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')"
|
||||
>$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>Application</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
|
@ -41,11 +40,8 @@
|
|||
<QtModules>core;gui;widgets</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound"
|
||||
BeforeTargets="CustomBuild;ClCompile"
|
||||
Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High"
|
||||
Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
|
@ -92,7 +88,6 @@
|
|||
<QtMoc Include="qtnovels.h" />
|
||||
<ClCompile Include="qtnovels.cpp" />
|
||||
<ClCompile Include="main.cpp" />
|
||||
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
|
|
|
@ -35,14 +35,10 @@
|
|||
<ClCompile Include="qtnovels.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ResourceCompile Include="$pro_name$.rc">
|
||||
</ResourceCompile>
|
||||
<None Include="$pro_name$.ico">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
<None Include="$pro_name$.def">
|
||||
<Filter>Resource Files</Filter>
|
||||
</None>
|
||||
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="main.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,98 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{D65CAF69-595C-445C-845B-8707EFA1ECC4}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v141</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core;xml;gui;widgets</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>WSTEXTEDIT_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>WSTEXTEDIT_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="wstextedit_global.h" />
|
||||
<QtMoc Include="wstextedit.h" />
|
||||
<ClCompile Include="wstextedit.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,37 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="wstextedit_global.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<QtMoc Include="wstextedit.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<ClCompile Include="wstextedit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
#include "wstextedit.h"
|
||||
|
||||
WsTextEdit::WsTextEdit()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "wstextedit_global.h"
|
||||
|
||||
class WSTEXTEDIT_EXPORT WsTextEdit
|
||||
{
|
||||
public:
|
||||
WsTextEdit();
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef BUILD_STATIC
|
||||
# if defined(WSTEXTEDIT_LIB)
|
||||
# define WSTEXTEDIT_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define WSTEXTEDIT_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define WSTEXTEDIT_EXPORT
|
||||
#endif
|
|
@ -0,0 +1,102 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project DefaultTargets="Build" ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup Label="ProjectConfigurations">
|
||||
<ProjectConfiguration Include="Debug|x64">
|
||||
<Configuration>Debug</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
<ProjectConfiguration Include="Release|x64">
|
||||
<Configuration>Release</Configuration>
|
||||
<Platform>x64</Platform>
|
||||
</ProjectConfiguration>
|
||||
</ItemGroup>
|
||||
<PropertyGroup Label="Globals">
|
||||
<ProjectGuid>{DB6BC034-92EF-457C-B1B9-7997857E782B}</ProjectGuid>
|
||||
<Keyword>QtVS_v304</Keyword>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">10.0</WindowsTargetPlatformVersion>
|
||||
<WindowsTargetPlatformVersion Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">10.0.22621.0</WindowsTargetPlatformVersion>
|
||||
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<PlatformToolset>v143</PlatformToolset>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt_defaults.props')">
|
||||
<Import Project="$(QtMsBuild)\qt_defaults.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>debug</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="QtSettings">
|
||||
<QtInstall>5.12.11_msvc2017_64</QtInstall>
|
||||
<QtModules>core</QtModules>
|
||||
<QtBuildConfig>release</QtBuildConfig>
|
||||
</PropertyGroup>
|
||||
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') or !Exists('$(QtMsBuild)\qt.props')">
|
||||
<Message Importance="High" Text="QtMsBuild: could not locate qt.targets, qt.props; project may not build correctly." />
|
||||
</Target>
|
||||
<ImportGroup Label="ExtensionSettings" />
|
||||
<ImportGroup Label="Shared" />
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
|
||||
<Import Project="$(QtMsBuild)\Qt.props" />
|
||||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'">
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'">
|
||||
</PropertyGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Debug|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DebugInformationFormat>ProgramDatabase</DebugInformationFormat>
|
||||
<Optimization>Disabled</Optimization>
|
||||
<PreprocessorDefinitions>LIBWSTEXTEDIT_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)' == 'Release|x64'" Label="Configuration">
|
||||
<ClCompile>
|
||||
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
|
||||
<MultiProcessorCompilation>true</MultiProcessorCompilation>
|
||||
<DebugInformationFormat>None</DebugInformationFormat>
|
||||
<Optimization>MaxSpeed</Optimization>
|
||||
<PreprocessorDefinitions>LIBWSTEXTEDIT_LIB;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
<GenerateDebugInformation>false</GenerateDebugInformation>
|
||||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="textpresents.cpp" />
|
||||
<ClCompile Include="textmodels.cpp" />
|
||||
<ClInclude Include="libwstextedit_global.h" />
|
||||
<ClInclude Include="textpresents.h" />
|
||||
<QtMoc Include="textmodels.h" />
|
||||
<QtMoc Include="libwstextedit.h" />
|
||||
<ClCompile Include="libwstextedit.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Condition="Exists('$(QtMsBuild)\qt.targets')">
|
||||
<Import Project="$(QtMsBuild)\qt.targets" />
|
||||
</ImportGroup>
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
</Project>
|
|
@ -0,0 +1,52 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<ItemGroup>
|
||||
<Filter Include="Source Files">
|
||||
<UniqueIdentifier>{4FC737F1-C7A5-4376-A066-2A32D752A2FF}</UniqueIdentifier>
|
||||
<Extensions>qml;cpp;c;cc;cxx;def;odl;idl;hpj;bat;asm;asmx</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Header Files">
|
||||
<UniqueIdentifier>{93995380-89BD-4b04-88EB-625FBE52EBFB}</UniqueIdentifier>
|
||||
<Extensions>h;hh;hpp;hxx;hm;inl;inc;xsd</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Resource Files">
|
||||
<UniqueIdentifier>{67DA6AB6-F800-4c08-8B7A-83BB121AAD01}</UniqueIdentifier>
|
||||
<Extensions>qrc;rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Form Files">
|
||||
<UniqueIdentifier>{99349809-55BA-4b9d-BF79-8FDBB0286EB3}</UniqueIdentifier>
|
||||
<Extensions>ui</Extensions>
|
||||
</Filter>
|
||||
<Filter Include="Translation Files">
|
||||
<UniqueIdentifier>{639EADAA-A684-42e4-A9AD-28FC9BCB8F7C}</UniqueIdentifier>
|
||||
<Extensions>ts</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="libwstextedit_global.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<QtMoc Include="libwstextedit.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
<ClCompile Include="libwstextedit.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClInclude Include="textpresents.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="textpresents.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="textmodels.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<QtMoc Include="textmodels.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</QtMoc>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,5 @@
|
|||
#include "libwstextedit.h"
|
||||
|
||||
libWsTextEdit::libWsTextEdit()
|
||||
{
|
||||
}
|
|
@ -0,0 +1,9 @@
|
|||
#pragma once
|
||||
|
||||
#include "libwstextedit_global.h"
|
||||
|
||||
class LIBWSTEXTEDIT_EXPORT libWsTextEdit
|
||||
{
|
||||
public:
|
||||
libWsTextEdit();
|
||||
};
|
|
@ -0,0 +1,13 @@
|
|||
#pragma once
|
||||
|
||||
#include <QtCore/qglobal.h>
|
||||
|
||||
#ifndef BUILD_STATIC
|
||||
# if defined(LIBWSTEXTEDIT_LIB)
|
||||
# define LIBWSTEXTEDIT_EXPORT Q_DECL_EXPORT
|
||||
# else
|
||||
# define LIBWSTEXTEDIT_EXPORT Q_DECL_IMPORT
|
||||
# endif
|
||||
#else
|
||||
# define LIBWSTEXTEDIT_EXPORT
|
||||
#endif
|
|
@ -0,0 +1,147 @@
|
|||
#include "textmodels.h"
|
||||
|
||||
using namespace wstext_model;
|
||||
using namespace wstext_present;
|
||||
|
||||
void WsDocument::bindFormat(std::shared_ptr<DocFormat> f) { this->document_format = f; }
|
||||
|
||||
std::shared_ptr<DocFormat> WsDocument::getFormat() const { return this->document_format; }
|
||||
|
||||
uint32_t WsDocument::blockCount() const
|
||||
{
|
||||
return this->block_store.size();
|
||||
}
|
||||
|
||||
QList<std::shared_ptr<WsBlock> > WsDocument::getBlocks(uint32_t offset, uint32_t count) const
|
||||
{
|
||||
QList<std::shared_ptr<WsBlock>> retvs;
|
||||
|
||||
for (auto idx = offset; idx < this->block_store.size(); ++idx)
|
||||
retvs << this->block_store.at(idx);
|
||||
|
||||
return retvs;
|
||||
}
|
||||
|
||||
void WsDocument::delBlocks(uint32_t offset, uint32_t count)
|
||||
{
|
||||
for (auto idx = offset; idx < this->block_store.size();) {
|
||||
this->block_store.removeAt(idx);
|
||||
}
|
||||
}
|
||||
|
||||
void WsDocument::addBlocks(const QList<std::shared_ptr<WsBlock>> &blks, uint32_t offset)
|
||||
{
|
||||
if (offset < this->block_store.size()) {
|
||||
for (auto ptr : blks)
|
||||
this->block_store.insert(offset, ptr);
|
||||
}
|
||||
else {
|
||||
this->block_store.append(blks);
|
||||
}
|
||||
}
|
||||
|
||||
QString WsDocument::toPlainText() const
|
||||
{
|
||||
QString text_content;
|
||||
for (auto idx = 0; idx < blockCount(); ++idx) {
|
||||
text_content += getBlocks(idx).at(0)->toText();
|
||||
}
|
||||
return text_content;
|
||||
}
|
||||
|
||||
void WsDocument::setPlainText(const QString &text)
|
||||
{
|
||||
auto sections = text.split("\n");
|
||||
QList<std::shared_ptr<WsBlock>> blocks;
|
||||
for (auto &t : sections) {
|
||||
auto binst = std::make_shared<WsBlock>();
|
||||
blocks.append(binst);
|
||||
|
||||
// 转换文本为内存实例
|
||||
auto codes = CharSetU16::combineToU(t);
|
||||
auto chars = WsChar::convertFrom(codes);
|
||||
|
||||
// 填充段落实例
|
||||
QList<Element*> buffers;
|
||||
for (auto &ptr : chars) {
|
||||
ptr->bindFormat(this->getFormat()->defaultCharFormat());
|
||||
ptr->refer(binst);
|
||||
buffers.append(ptr);
|
||||
}
|
||||
binst->addElements(buffers);
|
||||
}
|
||||
|
||||
addBlocks(blocks);
|
||||
}
|
||||
|
||||
void WsBlock::addElements(const QList<Element*> &text, uint32_t offset) {
|
||||
if (offset < this->element_store.size()) {
|
||||
for (auto *ptr : text)
|
||||
this->element_store.insert(offset, ptr);
|
||||
}
|
||||
else {
|
||||
this->element_store.append(text);
|
||||
}
|
||||
}
|
||||
|
||||
QList<Element *> WsBlock::getElements(uint32_t offset, uint32_t count) const
|
||||
{
|
||||
QList<Element*> retvs;
|
||||
|
||||
for (auto idx = offset; idx < this->element_store.size(); ++idx)
|
||||
retvs << this->element_store.at(idx);
|
||||
|
||||
return retvs;
|
||||
}
|
||||
|
||||
void WsBlock::delElements(uint32_t offset, uint32_t count)
|
||||
{
|
||||
for (auto idx = offset; idx < this->element_store.size();) {
|
||||
delete element_store.at(idx);
|
||||
this->element_store.removeAt(idx);
|
||||
}
|
||||
}
|
||||
|
||||
QString WsBlock::toText() const
|
||||
{
|
||||
QString text_content;
|
||||
for (auto &it : element_store)
|
||||
text_content += it->toText();
|
||||
return text_content;
|
||||
}
|
||||
|
||||
|
||||
wstext_model::WsChar::WsChar(uint32_t code) { this->code_store = code; }
|
||||
|
||||
uint32_t wstext_model::WsChar::code() const { return code_store; }
|
||||
|
||||
QList<std::shared_ptr<const WsChar>> WsChar::convertFrom(const QString &text)
|
||||
{
|
||||
QList<std::shared_ptr<const WsChar>> buffers;
|
||||
|
||||
for(auto &code : CharSetU16::combineToU(text))
|
||||
buffers << std::make_shared<WsChar>(code);
|
||||
|
||||
return buffers;
|
||||
}
|
||||
|
||||
|
||||
|
||||
Element::Element(AssembleType t) : type_store(t) {}
|
||||
|
||||
Element::Element(const Element &other) : Element(other.baseType()) {
|
||||
}
|
||||
|
||||
|
||||
AssembleType Element::baseType() const { return type_store; }
|
||||
|
||||
qulonglong Element::hashCode() const { return (qulonglong)this; }
|
||||
|
||||
std::shared_ptr<const Element> Element::clone() const {
|
||||
return std::make_shared<Element>(this->type_store);
|
||||
}
|
||||
|
||||
qulonglong wstext_model::Element::pos() const
|
||||
{
|
||||
return 0;
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
#pragma once
|
||||
|
||||
#include "textpresents.h"
|
||||
|
||||
namespace wstext_model {
|
||||
typedef QList<uint32_t> CharStream;
|
||||
|
||||
class CharSetU16 {
|
||||
public:
|
||||
static CharStream combineToU(const QString &buffer);
|
||||
static QString splitToC(const CharStream &buffer);
|
||||
static bool contains(uint32_t code);
|
||||
static uint size();
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 聚合体类型
|
||||
*/
|
||||
enum class AssembleType {
|
||||
INLINE_ELEMENT,
|
||||
FRAGMENT,
|
||||
DOCUMENT,
|
||||
};
|
||||
|
||||
/**
|
||||
* @brief 内存实例接口
|
||||
*/
|
||||
class Element : public std::enable_shared_from_this<Element> {
|
||||
public:
|
||||
explicit Element(AssembleType t);
|
||||
explicit Element(const Element & other);
|
||||
|
||||
AssembleType baseType() const;
|
||||
qulonglong hashCode() const;
|
||||
|
||||
virtual std::shared_ptr<const Element> clone() const;
|
||||
virtual qulonglong pos() const;
|
||||
|
||||
private:
|
||||
AssembleType type_store;
|
||||
};
|
||||
|
||||
class WsChar : public Element {
|
||||
private:
|
||||
uint32_t code_store;
|
||||
|
||||
public:
|
||||
explicit WsChar(uint32_t code);
|
||||
virtual ~WsChar() = default;
|
||||
|
||||
uint32_t code() const;
|
||||
|
||||
static QList<std::shared_ptr<const WsChar>> convertFrom(const QString &text);
|
||||
};
|
||||
|
||||
|
||||
class WsPart : public Element {
|
||||
public:
|
||||
/**
|
||||
* 获取指定元素的所有权.
|
||||
*
|
||||
* \param text
|
||||
* \param offset
|
||||
*/
|
||||
std::shared_ptr<const WsPart> insertChars(const QList<std::shared_ptr<const WsChar>> &text, uint32_t offset = -1);
|
||||
QList<std::shared_ptr<const WsChar>> getChars(uint32_t offset, uint32_t count) const;
|
||||
std::shared_ptr<const WsPart> delChars(uint32_t offset, uint32_t count);
|
||||
|
||||
std::shared_ptr<const WsPart> mergeFrom(const QList<std::shared_ptr<const Element>> &mbrs);
|
||||
};
|
||||
|
||||
class LIBWSTEXTEDIT_EXPORT WsBlock {
|
||||
private:
|
||||
QList<Element*> element_store;
|
||||
|
||||
public:
|
||||
uint32_t blockIndex() const;
|
||||
void addElements(const QList<Element*> &text, uint32_t offset = UINT32_MAX);
|
||||
QList<Element*> getElements(uint32_t offset, uint32_t count) const;
|
||||
void delElements(uint32_t offset, uint32_t count);
|
||||
QString toText() const;
|
||||
};
|
||||
|
||||
class LIBWSTEXTEDIT_EXPORT WsDocument : public QObject {
|
||||
Q_OBJECT
|
||||
private:
|
||||
std::shared_ptr<wstext_present::DocFormat> document_format;
|
||||
QList<std::shared_ptr<WsBlock>> block_store;
|
||||
|
||||
public:
|
||||
void bindFormat(std::shared_ptr<wstext_present::DocFormat> f);
|
||||
std::shared_ptr<wstext_present::DocFormat> getFormat() const;
|
||||
|
||||
void addBlocks(const QList<std::shared_ptr<WsBlock>> &blks, uint32_t offset = UINT32_MAX);
|
||||
uint32_t blockCount() const;
|
||||
QList<std::shared_ptr<WsBlock>> getBlocks(uint32_t offset, uint32_t count = 1) const;
|
||||
void delBlocks(uint32_t offset, uint32_t count = 1);
|
||||
|
||||
QString toPlainText() const;
|
||||
void setPlainText(const QString &text);
|
||||
|
||||
};
|
||||
}
|
|
@ -0,0 +1,192 @@
|
|||
#include "wspresentmodel.h"
|
||||
#include <tuple>
|
||||
|
||||
using namespace std;
|
||||
using namespace wstext_present;
|
||||
|
||||
CharStream CharSetU16::combineToU(const QString &buffer) {
|
||||
QList<uint32_t> retvs;
|
||||
|
||||
if (buffer.size() == 0)
|
||||
return retvs;
|
||||
|
||||
tuple<uint32_t, int> combine_current;
|
||||
auto aval = buffer[0];
|
||||
if (buffer.size() < 2)
|
||||
combine_current = std::make_tuple(aval.unicode(), 1);
|
||||
|
||||
else if (buffer.size() >= 2) {
|
||||
auto bval = buffer[1];
|
||||
if (aval.isHighSurrogate() && bval.isLowSurrogate()) {
|
||||
uint32_t avalx = aval.unicode();
|
||||
combine_current = std::make_tuple((avalx << 16) + bval.unicode(), 2);
|
||||
}
|
||||
else {
|
||||
combine_current = std::make_tuple(aval.unicode(), 1);
|
||||
}
|
||||
}
|
||||
|
||||
retvs.append(std::get<0>(combine_current));
|
||||
retvs.append(combineToU(buffer.mid(std::get<1>(combine_current))));
|
||||
return retvs;
|
||||
}
|
||||
|
||||
QString CharSetU16::splitToC(const CharStream &buffer) {
|
||||
if (!buffer.size())
|
||||
return "";
|
||||
|
||||
QString acc_str = "";
|
||||
auto head = buffer[0];
|
||||
if (head > 0xffffu) {
|
||||
auto high_v = (head & 0xffff0000u) >> 16;
|
||||
auto low_v = head & 0xffffu;
|
||||
|
||||
auto hc = QChar((ushort)high_v);
|
||||
auto lc = QChar((ushort)low_v);
|
||||
acc_str.append(hc);
|
||||
acc_str.append(lc);
|
||||
}
|
||||
else {
|
||||
acc_str.append(QChar((ushort)head & 0xffffu));
|
||||
}
|
||||
|
||||
acc_str.append(splitToC(buffer.mid(1)));
|
||||
return acc_str;
|
||||
}
|
||||
|
||||
bool CharSetU16::contains(uint32_t code) {
|
||||
if (code <= 0xffffu)
|
||||
return true;
|
||||
else {
|
||||
auto high_v = (code & 0xffff0000u) >> 16;
|
||||
auto low_v = code & 0xffffu;
|
||||
|
||||
auto hc = QChar((ushort)high_v);
|
||||
auto lc = QChar((ushort)low_v);
|
||||
return hc.isHighSurrogate() && lc.isLowSurrogate();
|
||||
}
|
||||
}
|
||||
|
||||
uint CharSetU16::size() { return 1114111u; }
|
||||
|
||||
CharFormat::CharFormat(qulonglong format_id) {
|
||||
this->unique_id = format_id;
|
||||
}
|
||||
|
||||
CharFormat::CharFormat(const CharFormat &other) {
|
||||
this->unique_id = other.unique_id;
|
||||
|
||||
this->point_size = other.point_size;
|
||||
this->fontfamily_store = other.fontfamily_store;
|
||||
this->bold_store = other.bold_store;
|
||||
this->italic_flag = other.italic_flag;
|
||||
this->kerning_flag = other.kerning_flag;
|
||||
this->overline_flag = other.overline_flag;
|
||||
this->underline_flag = other.underline_flag;
|
||||
this->float_Height = other.float_Height;
|
||||
this->weight_store = other.weight_store;
|
||||
}
|
||||
|
||||
qulonglong CharFormat::formatID() const { return unique_id; }
|
||||
|
||||
uint32_t CharFormat::pointSize() const { return point_size; }
|
||||
|
||||
QString CharFormat::fontFamily() const { return fontfamily_store; }
|
||||
|
||||
bool CharFormat::bold() const { return bold_store; }
|
||||
|
||||
bool CharFormat::italic() const { return italic_flag; }
|
||||
|
||||
bool CharFormat::kerning() const { return kerning_flag; }
|
||||
|
||||
bool CharFormat::overline() const { return overline_flag; }
|
||||
|
||||
bool CharFormat::underline() const { return underline_flag; }
|
||||
|
||||
double CharFormat::floatHeight() const { return float_Height; }
|
||||
|
||||
QFont::Weight CharFormat::weight() const { return weight_store; }
|
||||
|
||||
void CharFormat::setPointSize(uint32_t val) { this->point_size = val; }
|
||||
|
||||
void CharFormat::setFontFamily(const QString &name) { this->fontfamily_store = name; }
|
||||
|
||||
void CharFormat::setBold(bool ste) { this->bold_store = ste; }
|
||||
|
||||
void CharFormat::setItalic(bool ste) { this->italic_flag = ste; }
|
||||
|
||||
void CharFormat::setKerning(bool ste) { this->kerning_flag = ste; }
|
||||
|
||||
void CharFormat::setOverline(bool ste) { this->overline_flag = ste; }
|
||||
|
||||
void CharFormat::setUnderline(bool ste) { this->underline_flag = ste; }
|
||||
|
||||
void CharFormat::setFloatHeight(double val) { this->float_Height = val; }
|
||||
|
||||
void CharFormat::setWeight(QFont::Weight val) { this->weight_store = val; }
|
||||
|
||||
bool CharFormat::operator==(const CharFormat &other) {
|
||||
return this->point_size == other.point_size &&
|
||||
this->fontfamily_store == other.fontfamily_store &&
|
||||
this->bold_store == other.bold_store &&
|
||||
this->italic_flag == other.italic_flag &&
|
||||
this->kerning_flag == other.kerning_flag &&
|
||||
this->overline_flag == other.overline_flag &&
|
||||
this->underline_flag == other.underline_flag &&
|
||||
this->float_Height == other.float_Height &&
|
||||
this->weight_store == other.weight_store;
|
||||
}
|
||||
|
||||
CharFormat &CharFormat::operator=(const CharFormat &other) {
|
||||
this->point_size = other.point_size;
|
||||
this->fontfamily_store = other.fontfamily_store;
|
||||
this->bold_store = other.bold_store;
|
||||
this->italic_flag = other.italic_flag;
|
||||
this->kerning_flag = other.kerning_flag;
|
||||
this->overline_flag = other.overline_flag;
|
||||
this->underline_flag = other.underline_flag;
|
||||
this->float_Height = other.float_Height;
|
||||
this->weight_store = other.weight_store;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
|
||||
DocFormat::DocFormat() {}
|
||||
|
||||
DocFormat::DocFormat(const DocFormat &other) {
|
||||
this->char_format = other.char_format;
|
||||
this->line_height = other.line_height;
|
||||
this->indent_char_count = other.indent_char_count;
|
||||
this->margins_store = other.margins_store;
|
||||
this->visible_of_additional = other.visible_of_additional;
|
||||
}
|
||||
|
||||
double DocFormat::lineHeight() const { return line_height; }
|
||||
|
||||
QMargins DocFormat::margins() const { return margins_store; }
|
||||
|
||||
double DocFormat::indentChars() const { return indent_char_count; }
|
||||
|
||||
bool DocFormat::additionalVisible() const { return visible_of_additional; }
|
||||
|
||||
std::shared_ptr<CharFormat> DocFormat::defaultCharFormat() const { return this->char_format; }
|
||||
|
||||
void DocFormat::setLineHeight(double val) { this->line_height = val; }
|
||||
|
||||
void DocFormat::setMargins(const QMargins &val) { this->margins_store = val; }
|
||||
|
||||
void DocFormat::setIndentChars(double n) { this->indent_char_count = n; }
|
||||
|
||||
void DocFormat::setAdditionalVisible(bool ste) { this->visible_of_additional = ste; }
|
||||
|
||||
void DocFormat::setDefaultCharFormat(std::shared_ptr<CharFormat> format) { this->char_format = format; }
|
||||
|
||||
DocFormat &DocFormat::operator=(const DocFormat &other) {
|
||||
this->char_format = other.char_format;
|
||||
this->line_height = other.line_height;
|
||||
this->indent_char_count = other.indent_char_count;
|
||||
this->margins_store = other.margins_store;
|
||||
this->visible_of_additional = other.visible_of_additional;
|
||||
return *this;
|
||||
}
|
|
@ -0,0 +1,81 @@
|
|||
#pragma once
|
||||
#include "libwstextedit_global.h"
|
||||
|
||||
#include <QList>
|
||||
#include <QFont>
|
||||
|
||||
namespace wstext_present {
|
||||
/**
|
||||
* ×Ö·û¸ñʽ¶¨Òå.
|
||||
*/
|
||||
class LIBWSTEXTEDIT_EXPORT CharFormat {
|
||||
private:
|
||||
qulonglong unique_id;
|
||||
|
||||
uint32_t point_size;
|
||||
QString fontfamily_store;
|
||||
bool bold_store;
|
||||
bool italic_flag;
|
||||
bool kerning_flag;
|
||||
bool overline_flag;
|
||||
bool underline_flag;
|
||||
double float_Height;
|
||||
QFont::Weight weight_store;
|
||||
|
||||
public:
|
||||
CharFormat(qulonglong format_id);
|
||||
CharFormat(const CharFormat& other);
|
||||
|
||||
qulonglong formatID() const;
|
||||
|
||||
uint32_t pointSize() const;
|
||||
QString fontFamily() const;
|
||||
bool bold() const;
|
||||
bool italic() const;
|
||||
bool kerning() const;
|
||||
bool overline() const;
|
||||
bool underline() const;
|
||||
double floatHeight() const;
|
||||
QFont::Weight weight() const;
|
||||
|
||||
void setPointSize(uint32_t val);
|
||||
void setFontFamily(const QString &name);
|
||||
void setBold(bool ste);
|
||||
void setItalic(bool ste);
|
||||
void setKerning(bool ste);
|
||||
void setOverline(bool ste);
|
||||
void setUnderline(bool ste);
|
||||
void setFloatHeight(double val);
|
||||
void setWeight(QFont::Weight val);
|
||||
|
||||
bool operator==(const CharFormat &other);
|
||||
CharFormat &operator=(const CharFormat &other);
|
||||
};
|
||||
|
||||
class LIBWSTEXTEDIT_EXPORT DocFormat {
|
||||
private:
|
||||
std::shared_ptr<CharFormat> char_format;
|
||||
double line_height = 20;
|
||||
double indent_char_count = 2;
|
||||
QMargins margins_store = QMargins(5, 5, 5, 5);
|
||||
bool visible_of_additional = false;
|
||||
|
||||
public:
|
||||
DocFormat();
|
||||
DocFormat(const DocFormat &other);
|
||||
|
||||
double lineHeight() const;
|
||||
QMargins margins() const;
|
||||
double indentChars() const;
|
||||
bool additionalVisible() const;
|
||||
std::shared_ptr<CharFormat> defaultCharFormat() const;
|
||||
|
||||
void setLineHeight(double val);
|
||||
void setMargins(const QMargins &val);
|
||||
void setIndentChars(double n);
|
||||
void setAdditionalVisible(bool ste);
|
||||
void setDefaultCharFormat(std::shared_ptr<CharFormat> format);
|
||||
|
||||
DocFormat& operator=(const DocFormat &other);
|
||||
};
|
||||
}
|
Loading…
Reference in New Issue