修复飞子阶段bug,增加标签页

This commit is contained in:
liuweilhy 2018-06-03 19:44:45 +08:00
parent e66ef36927
commit 47aca2dfb7
13 changed files with 187 additions and 78 deletions

1
.gitignore vendored
View File

@ -6,5 +6,6 @@
/NineChess/release /NineChess/release
/NineChess/GeneratedFiles /NineChess/GeneratedFiles
/NineChess/x64 /NineChess/x64
/NineChess/x86
/NineChess/.vs /NineChess/.vs
/.vs /.vs

22
NineChess/.qmake.stash Normal file
View File

@ -0,0 +1,22 @@
QMAKE_CXX.INCDIRS = \
"D:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\ATLMFC\\include" \
"D:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\include" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\include\\um" \
"D:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\ucrt" \
"D:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\shared" \
"D:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\um" \
"D:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\winrt" \
"D:\\Program Files (x86)\\Windows Kits\\10\\include\\10.0.17134.0\\cppwinrt"
QMAKE_CXX.LIBDIRS = \
"D:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\ATLMFC\\lib\\x64" \
"D:\\Program Files (x86)\\Microsoft Visual Studio\\2017\\Community\\VC\\Tools\\MSVC\\14.14.26428\\lib\\x64" \
"C:\\Program Files (x86)\\Windows Kits\\NETFXSDK\\4.6.1\\lib\\um\\x64" \
"D:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\ucrt\\x64" \
"D:\\Program Files (x86)\\Windows Kits\\10\\lib\\10.0.17134.0\\um\\x64"
QMAKE_CXX.QT_COMPILER_STDCXX = 199711L
QMAKE_CXX.QMAKE_MSC_VER = 1914
QMAKE_CXX.QMAKE_MSC_FULL_VER = 191426428
QMAKE_CXX.COMPILER_MACROS = \
QT_COMPILER_STDCXX \
QMAKE_MSC_VER \
QMAKE_MSC_FULL_VER

View File

@ -31,6 +31,7 @@ HEADERS += \
src\boarditem.h \ src\boarditem.h \
src\gameview.h \ src\gameview.h \
src\ninechess.h \ src\ninechess.h \
src\sizehinttextedit.h \
src\sizehintlistview.h \ src\sizehintlistview.h \
src\gamescene.h src\gamescene.h
@ -41,8 +42,9 @@ RESOURCES += \
ninechesswindow.qrc ninechesswindow.qrc
DISTFILES += \ DISTFILES += \
Readme.txt \
NineChess.rc \ NineChess.rc \
Readme.md \
Licence.txt \
History.txt History.txt
RC_FILE += NineChess.rc RC_FILE += NineChess.rc

View File

@ -1,6 +1,6 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE QtCreatorProject> <!DOCTYPE QtCreatorProject>
<!-- Written by QtCreator 4.5.1, 2018-05-17T00:26:36. --> <!-- Written by QtCreator 4.6.1, 2018-06-03T17:03:31. -->
<qtcreator> <qtcreator>
<data> <data>
<variable>EnvironmentId</variable> <variable>EnvironmentId</variable>
@ -59,14 +59,14 @@
<data> <data>
<variable>ProjectExplorer.Project.Target.0</variable> <variable>ProjectExplorer.Project.Target.0</variable>
<valuemap type="QVariantMap"> <valuemap type="QVariantMap">
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.10.1 MSVC2017 64bit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Desktop Qt 5.11.0 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.10.1 MSVC2017 64bit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Desktop Qt 5.11.0 MSVC2017 64bit</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5101.win64_msvc2017_64_kit</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">qt.qt5.5110.win64_msvc2017_64_kit</value>
<value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveBuildConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveDeployConfiguration">0</value>
<value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value> <value type="int" key="ProjectExplorer.Target.ActiveRunConfiguration">0</value>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.0">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/My program/QT/build-ninechess-Desktop_Qt_5_10_1_MSVC2017_64bit-Debug</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/My program/QT/NineChess/NineChess/debug/build-ninechess-Desktop_Qt_5_11_0_MSVC2017_64bit-Debug</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -90,7 +90,7 @@
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap> </valuemap>
@ -106,7 +106,7 @@
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap> </valuemap>
@ -114,13 +114,13 @@
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Debug</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value> <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">2</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.1">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/My program/QT/build-ninechess-Desktop_Qt_5_10_1_MSVC2017_64bit-Release</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/My program/QT/NineChess/build-ninechess-Desktop_Qt_5_11_0_MSVC2017_64bit-Release</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -144,7 +144,7 @@
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap> </valuemap>
@ -160,7 +160,7 @@
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap> </valuemap>
@ -168,13 +168,13 @@
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Release</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
</valuemap> </valuemap>
<valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2"> <valuemap type="QVariantMap" key="ProjectExplorer.Target.BuildConfiguration.2">
<value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/My program/QT/build-ninechess-Desktop_Qt_5_10_1_MSVC2017_64bit-Profile</value> <value type="QString" key="ProjectExplorer.BuildConfiguration.BuildDirectory">E:/My program/QT/NineChess/build-ninechess-Desktop_Qt_5_11_0_MSVC2017_64bit-Profile</value>
<valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildConfiguration.BuildStepList.0">
<valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0"> <valuemap type="QVariantMap" key="ProjectExplorer.BuildStepList.Step.0">
<value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value> <value type="bool" key="ProjectExplorer.BuildStep.Enabled">true</value>
@ -198,7 +198,7 @@
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value> <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">2</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">构建</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Build</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Build</value>
</valuemap> </valuemap>
@ -214,7 +214,7 @@
<value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value> <value type="QString" key="Qt4ProjectManager.MakeStep.MakeCommand"></value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value> <value type="int" key="ProjectExplorer.BuildStepList.StepsCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">清理</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Clean</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Clean</value>
</valuemap> </valuemap>
@ -222,7 +222,7 @@
<value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value> <value type="bool" key="ProjectExplorer.BuildConfiguration.ClearSystemEnvironment">false</value>
<valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/> <valuelist type="QVariantList" key="ProjectExplorer.BuildConfiguration.UserEnvironmentChanges"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">Profile</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4BuildConfiguration</value>
<value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value> <value type="int" key="Qt4ProjectManager.Qt4BuildConfiguration.BuildConfiguration">0</value>
<value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value> <value type="bool" key="Qt4ProjectManager.Qt4BuildConfiguration.UseShadowBuild">true</value>
@ -236,7 +236,7 @@
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.BuildSteps.Deploy</value>
</valuemap> </valuemap>
<value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value> <value type="int" key="ProjectExplorer.BuildConfiguration.BuildStepListCount">1</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">在本地部署</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">部署设置</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">ProjectExplorer.DefaultDeployConfiguration</value>
</valuemap> </valuemap>
@ -285,14 +285,14 @@
<value type="int" key="PE.EnvironmentAspect.Base">2</value> <value type="int" key="PE.EnvironmentAspect.Base">2</value>
<valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/> <valuelist type="QVariantList" key="PE.EnvironmentAspect.Changes"/>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">ninechess</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DefaultDisplayName">ninechess</value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName">ninechess2</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.DisplayName"></value>
<value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/My program/QT/NineChess/NineChess/ninechess.pro</value> <value type="QString" key="ProjectExplorer.ProjectConfiguration.Id">Qt4ProjectManager.Qt4RunConfiguration:E:/My program/QT/NineChess/NineChess/ninechess.pro</value>
<value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value> <value type="bool" key="QmakeProjectManager.QmakeRunConfiguration.UseLibrarySearchPath">true</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.CommandLineArguments"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">ninechess.pro</value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.ProFile">ninechess.pro</value>
<value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value> <value type="bool" key="Qt4ProjectManager.Qt4RunConfiguration.UseDyldImageSuffix">false</value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory"></value>
<value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">E:/My program/QT/build-ninechess-Desktop_Qt_5_10_1_MSVC2017_64bit-Debug</value> <value type="QString" key="Qt4ProjectManager.Qt4RunConfiguration.UserWorkingDirectory.default">E:/My program/QT/NineChess/NineChess/debug/build-ninechess-Desktop_Qt_5_11_0_MSVC2017_64bit-Debug</value>
<value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value> <value type="uint" key="RunConfiguration.QmlDebugServerPort">3768</value>
<value type="bool" key="RunConfiguration.UseCppDebugger">false</value> <value type="bool" key="RunConfiguration.UseCppDebugger">false</value>
<value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value> <value type="bool" key="RunConfiguration.UseCppDebuggerAuto">true</value>

View File

@ -15,6 +15,7 @@
<RootNamespace>NineChess</RootNamespace> <RootNamespace>NineChess</RootNamespace>
<Keyword>Qt4VSv1.0</Keyword> <Keyword>Qt4VSv1.0</Keyword>
<WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion> <WindowsTargetPlatformVersion>10.0.17134.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.17134.0</WindowsTargetPlatformMinVersion>
</PropertyGroup> </PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
@ -86,7 +87,7 @@
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>$(QTDIR)\lib\qtmain.lib;shell32.lib;$(QTDIR)\lib\Qt5Multimedia.lib;$(QTDIR)\lib\Qt5Widgets.lib;$(QTDIR)\lib\Qt5Gui.lib;$(QTDIR)\lib\Qt5Network.lib;$(QTDIR)\lib\Qt5Core.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>$(QTDIR)\lib\qtmain.lib;shell32.lib;$(QTDIR)\lib\Qt5Multimedia.lib;$(QTDIR)\lib\Qt5Widgets.lib;$(QTDIR)\lib\Qt5Gui.lib;$(QTDIR)\lib\Qt5Network.lib;$(QTDIR)\lib\Qt5Core.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(QTDIR)\lib;C:\utils\my_sql\my_sql\lib;C:\utils\postgresql\pgsql\lib;$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(QTDIR)\lib;C:\openssl\lib;C:\Utils\my_sql\my_sql\lib;C:\Utils\postgresql\pgsql\lib;$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention> <DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>false</GenerateDebugInformation> <GenerateDebugInformation>false</GenerateDebugInformation>
@ -153,7 +154,7 @@
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>$(QTDIR)\lib\qtmaind.lib;shell32.lib;$(QTDIR)\lib\Qt5Multimediad.lib;$(QTDIR)\lib\Qt5Widgetsd.lib;$(QTDIR)\lib\Qt5Guid.lib;$(QTDIR)\lib\Qt5Networkd.lib;$(QTDIR)\lib\Qt5Cored.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>$(QTDIR)\lib\qtmaind.lib;shell32.lib;$(QTDIR)\lib\Qt5Multimediad.lib;$(QTDIR)\lib\Qt5Widgetsd.lib;$(QTDIR)\lib\Qt5Guid.lib;$(QTDIR)\lib\Qt5Networkd.lib;$(QTDIR)\lib\Qt5Cored.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>$(QTDIR)\lib;C:\utils\my_sql\my_sql\lib;C:\utils\postgresql\pgsql\lib;$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories> <AdditionalLibraryDirectories>$(QTDIR)\lib;C:\openssl\lib;C:\Utils\my_sql\my_sql\lib;C:\Utils\postgresql\pgsql\lib;$(QTDIR)\lib;%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention> <DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>true</GenerateDebugInformation> <GenerateDebugInformation>true</GenerateDebugInformation>
@ -239,10 +240,12 @@
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">release\moc_predefs.h;%(Outputs)</Outputs> <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">release\moc_predefs.h;%(Outputs)</Outputs>
<ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild> <ExcludedFromBuild Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">true</ExcludedFromBuild>
</CustomBuild> </CustomBuild>
<ClInclude Include="src\sizehinttextedit.h" />
<ClInclude Include="ui_ninechesswindow.h" /> <ClInclude Include="ui_ninechesswindow.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<QtUic Include="ninechesswindow.ui"> <QtUic Include="ninechesswindow.ui">
<SubType>Designer</SubType>
</QtUic> </QtUic>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
@ -300,7 +303,7 @@
<ImportGroup Label="ExtensionTargets" /> <ImportGroup Label="ExtensionTargets" />
<ProjectExtensions> <ProjectExtensions>
<VisualStudio> <VisualStudio>
<UserProperties UicDir=".\GeneratedFiles" RccDir=".\GeneratedFiles" Qt5Version_x0020_x64="qt5.10.1" /> <UserProperties UicDir=".\GeneratedFiles" RccDir=".\GeneratedFiles" Qt5Version_x0020_x64="Qt5.11.0" />
</VisualStudio> </VisualStudio>
</ProjectExtensions> </ProjectExtensions>
</Project> </Project>

View File

@ -110,24 +110,17 @@
<ClInclude Include="src\sizehintlistview.h"> <ClInclude Include="src\sizehintlistview.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="src\sizehinttextedit.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<CustomBuild Include="debug\moc_predefs.h.cbt"> <CustomBuild Include="debug\moc_predefs.h.cbt">
<Filter>Generated Files</Filter> <Filter>Generated Files</Filter>
</CustomBuild> </CustomBuild>
<CustomBuild Include="release\moc_predefs.h.cbt"> <CustomBuild Include="release\moc_predefs.h.cbt">
<Filter>Generated Files</Filter> <Filter>Generated Files</Filter>
</CustomBuild> </CustomBuild>
<ClInclude Include="ui_ninechesswindow.h"> <ClInclude Include="ui_ninechesswindow.h">
<Filter>Generated Files</Filter> <Filter>Generated Files</Filter>
</ClInclude> </ClInclude>

View File

@ -1,11 +1,11 @@
<?xml version="1.0" encoding="utf-8"?> <?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003"> <Project ToolsVersion="15.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QTDIR>D:\Qt\Qt5.10.1\5.10.1\msvc2017_64\</QTDIR> <QTDIR>D:\Qt\Qt5.11.0\5.11.0\msvc2017_64</QTDIR>
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment> <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QTDIR>D:\Qt\Qt5.10.1\5.10.1\msvc2017_64\</QTDIR> <QTDIR>D:\Qt\Qt5.11.0\5.11.0\msvc2017_64</QTDIR>
<LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment> <LocalDebuggerEnvironment>PATH=$(QTDIR)\bin%3b$(PATH)</LocalDebuggerEnvironment>
</PropertyGroup> </PropertyGroup>
</Project> </Project>

View File

@ -6,8 +6,8 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>561</width> <width>491</width>
<height>490</height> <height>418</height>
</rect> </rect>
</property> </property>
<property name="windowTitle"> <property name="windowTitle">
@ -59,7 +59,7 @@
<rect> <rect>
<x>0</x> <x>0</x>
<y>0</y> <y>0</y>
<width>561</width> <width>491</width>
<height>26</height> <height>26</height>
</rect> </rect>
</property> </property>
@ -138,6 +138,7 @@
</property> </property>
<addaction name="separator"/> <addaction name="separator"/>
<addaction name="actionLimited_T"/> <addaction name="actionLimited_T"/>
<addaction name="separator"/>
</widget> </widget>
<addaction name="menu_F"/> <addaction name="menu_F"/>
<addaction name="menu_C"/> <addaction name="menu_C"/>
@ -277,7 +278,7 @@
<item> <item>
<widget class="QLCDNumber" name="lcdNumber_1"> <widget class="QLCDNumber" name="lcdNumber_1">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -353,7 +354,7 @@
<item> <item>
<widget class="QLCDNumber" name="lcdNumber_2"> <widget class="QLCDNumber" name="lcdNumber_2">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Preferred"> <sizepolicy hsizetype="Preferred" vsizetype="Minimum">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
@ -380,24 +381,51 @@
</item> </item>
</layout> </layout>
</widget> </widget>
<widget class="SizeHintListView" name="listView"> <widget class="QTabWidget" name="tabWidget">
<property name="sizePolicy"> <property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding"> <sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>0</horstretch> <horstretch>0</horstretch>
<verstretch>0</verstretch> <verstretch>0</verstretch>
</sizepolicy> </sizepolicy>
</property> </property>
<property name="font"> <property name="tabPosition">
<font> <enum>QTabWidget::South</enum>
<family>微软雅黑</family>
</font>
</property> </property>
<property name="styleSheet"> <property name="currentIndex">
<string notr="true">QToolTip { <number>0</number>
font: 9pt &quot;consolas&quot;;
color: black;
}</string>
</property> </property>
<widget class="SizeHintTextEdit" name="tab_Rule">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<property name="font">
<font>
<pointsize>8</pointsize>
</font>
</property>
<property name="readOnly">
<bool>true</bool>
</property>
<attribute name="title">
<string>规则</string>
</attribute>
<layout class="QFormLayout" name="formLayout"/>
</widget>
<widget class="SizeHintListView" name="tab_Manual">
<property name="sizePolicy">
<sizepolicy hsizetype="Preferred" vsizetype="Expanding">
<horstretch>1</horstretch>
<verstretch>0</verstretch>
</sizepolicy>
</property>
<attribute name="title">
<string>棋谱</string>
</attribute>
<layout class="QFormLayout" name="formLayout"/>
</widget>
</widget> </widget>
</widget> </widget>
</item> </item>
@ -827,6 +855,11 @@
<extends>QListView</extends> <extends>QListView</extends>
<header>sizehintlistview.h</header> <header>sizehintlistview.h</header>
</customwidget> </customwidget>
<customwidget>
<class>SizeHintTextEdit</class>
<extends>QPlainTextEdit</extends>
<header>sizehinttextedit.h</header>
</customwidget>
</customwidgets> </customwidgets>
<resources> <resources>
<include location="ninechesswindow.qrc"/> <include location="ninechesswindow.qrc"/>

View File

@ -152,6 +152,7 @@ void GameController::setRule(int ruleNo)
rule = NineChess::RULES[ruleNo]; rule = NineChess::RULES[ruleNo];
rule.maxSteps = stepsLimit; rule.maxSteps = stepsLimit;
rule.maxTime = timeLimit; rule.maxTime = timeLimit;
// 设置模型规则,重置游戏 // 设置模型规则,重置游戏
chess.setRule(&rule); chess.setRule(&rule);
@ -519,7 +520,7 @@ bool GameController::removePiece(QPointF pos)
bool GameController::cleanForbidden() bool GameController::cleanForbidden()
{ {
for each (PieceItem *p in pieceList) foreach (PieceItem *p, pieceList)
{ {
if (p->isDeleted()) { if (p->isDeleted()) {
pieceList.removeOne(p); pieceList.removeOne(p);

View File

@ -50,7 +50,7 @@ void GameScene::mousePressEvent(QGraphicsSceneMouseEvent *mouseEvent)
} }
// 取消其它棋子的选中状态 // 取消其它棋子的选中状态
//for each (QGraphicsItem * item in selectedItems()) //foreach (QGraphicsItem * item, selectedItems())
//{ //{
// item->setSelected(false); // item->setSelected(false);
//} //}

View File

@ -14,13 +14,14 @@
const struct NineChess::Rule NineChess::RULES[RULENUM] = { const struct NineChess::Rule NineChess::RULES[RULENUM] = {
{ {
"成三棋", // 成三棋 "成三棋", // 成三棋
"双方各九颗子,开局依次摆子;\n" // 规则说明 // 规则说明
"凡出现三子相连,就提掉对手一子;\n" "1. 双方各9颗子开局依次摆子\n"
"不能提对手的“三连”子,除非无子可提;\n" "2. 凡出现三子相连,就提掉对手一子;\n"
"同时出现两个“三连”只能提一子;\n" "3. 不能提对手的“三连”子,除非无子可提;\n"
"摆完后依次走子,每次只能往相邻位置走一步;\n" "4. 同时出现两个“三连”只能提一子;\n"
"把对手棋子提到少于3颗时胜利\n" "5. 摆完后依次走子,每次只能往相邻位置走一步;\n"
"走棋阶段不能行动(被“闷”)算负。", "6. 把对手棋子提到少于3颗时胜利\n"
"7. 走棋阶段不能行动(被“闷”)算负。",
9, // 双方各9子 9, // 双方各9子
3, // 赛点子数为3 3, // 赛点子数为3
false, // 没有斜线 false, // 没有斜线
@ -36,11 +37,13 @@ const struct NineChess::Rule NineChess::RULES[RULENUM] = {
}, },
{ {
"打三棋(12连棋)", // 打三棋 "打三棋(12连棋)", // 打三棋
"规则与成三棋基本相同只是它用12颗子并且有斜线\n" // 规则说明 // 规则说明
"摆棋阶段被提子的位置不能再摆子,直到走棋阶段;\n" "1. 双方各12颗子棋盘有斜线\n"
"摆棋阶段,摆满棋盘算先手负;\n" "2. 摆棋阶段被提子的位置不能再摆子,直到走棋阶段;\n"
"走棋阶段,后摆棋的一方先走;\n" "3. 摆棋阶段,摆满棋盘算先手负;\n"
"一步出现几个“三连”就可以提几个子。", "4. 走棋阶段,后摆棋的一方先走;\n"
"5. 一步出现几个“三连”就可以提几个子;\n"
"6. 其它规则与成三棋基本相同。",
12, // 双方各12子 12, // 双方各12子
3, // 赛点子数为3 3, // 赛点子数为3
true, // 有斜线 true, // 有斜线
@ -56,10 +59,11 @@ const struct NineChess::Rule NineChess::RULES[RULENUM] = {
}, },
{ {
"九连棋", // 九连棋 "九连棋", // 九连棋
"规则与成三棋基本相同,只是它的棋子有序号,\n" // 规则说明 // 规则说明
"相同序号、位置的“三连”不能重复提子;\n" "1. 规则与成三棋基本相同,只是它的棋子有序号,\n"
"走棋阶段不能行动(被“闷”),则由对手继续走棋;\n" "2. 相同序号、位置的“三连”不能重复提子;\n"
"一步出现几个“三连”就可以提几个子。", "3. 走棋阶段不能行动(被“闷”),则由对手继续走棋;\n"
"4. 一步出现几个“三连”就可以提几个子。",
9, // 双方各9子 9, // 双方各9子
3, // 赛点子数为3 3, // 赛点子数为3
false, // 没有斜线 false, // 没有斜线
@ -75,8 +79,8 @@ const struct NineChess::Rule NineChess::RULES[RULENUM] = {
}, },
{ {
"莫里斯九子棋", // 莫里斯九子棋 "莫里斯九子棋", // 莫里斯九子棋
"规则与成三棋基本相同,只是在走子阶段,\n" // 规则说明 // 规则说明
"当一方仅剩3子时他可以飞子到任意空位。", "规则与成三棋基本相同,只是在走子阶段,当一方仅剩3子时他可以飞子到任意空位。",
9, // 双方各9子 9, // 双方各9子
3, // 赛点子数为3 3, // 赛点子数为3
false, // 没有斜线 false, // 没有斜线
@ -820,7 +824,8 @@ bool NineChess::isSurrounded(int pos)
{ {
// 判断pos处的棋子是否被“闷” // 判断pos处的棋子是否被“闷”
if ((turn == PLAYER1 && (player1_Remain > rule.numAtLest || !rule.canFly)) || if ((turn == PLAYER1 && (player1_Remain > rule.numAtLest || !rule.canFly)) ||
(turn == PLAYER2 && (player2_Remain > rule.numAtLest || !rule.canFly))) { (turn == PLAYER2 && (player2_Remain > rule.numAtLest || !rule.canFly)))
{
int i, movePos; int i, movePos;
for (i = 0; i < 4; i++) { for (i = 0; i < 4; i++) {
movePos = moveTable[pos][i]; movePos = moveTable[pos][i];
@ -846,6 +851,13 @@ bool NineChess::isAllSurrounded(enum Player ply)
// 如果摆满 // 如果摆满
if (player1_Remain + player2_Remain >= SEAT * RING) if (player1_Remain + player2_Remain >= SEAT * RING)
return true; return true;
// 判断是否可以飞子
if ((turn == PLAYER1 && (player1_Remain <= rule.numAtLest && rule.canFly)) ||
(turn == PLAYER2 && (player2_Remain <= rule.numAtLest && rule.canFly)))
{
return false;
}
// 查询整个棋盘
for (int i = 1; i <= RING; i++) for (int i = 1; i <= RING; i++)
{ {
for (int j = 0; j < SEAT; j++) for (int j = 0; j < SEAT; j++)

View File

@ -4,6 +4,7 @@
#include "ninechesswindow.h" #include "ninechesswindow.h"
#include "gamecontroller.h" #include "gamecontroller.h"
#include "gamescene.h" #include "gamescene.h"
#include <QDesktopServices>
#include <QMap> #include <QMap>
#include <QMessageBox> #include <QMessageBox>
#include <QTimer> #include <QTimer>
@ -84,11 +85,12 @@ NineChessWindow::~NineChessWindow()
{ {
if (game != NULL) if (game != NULL)
delete game; delete game;
qDeleteAll(ruleActionList);
} }
bool NineChessWindow::eventFilter(QObject *watched, QEvent *event) bool NineChessWindow::eventFilter(QObject *watched, QEvent *event)
{ {
// 重载这个函数只是为了让规则菜单显示提示 // 重载这个函数只是为了让规则菜单(动态)显示提示
if (watched == ui.menu_R) if (watched == ui.menu_R)
{ {
switch (event->type()) switch (event->type())
@ -104,7 +106,7 @@ bool NineChessWindow::eventFilter(QObject *watched, QEvent *event)
break; break;
} }
} }
QMainWindow::eventFilter(watched, event); return QMainWindow::eventFilter(watched, event);
} }
void NineChessWindow::initialize() void NineChessWindow::initialize()
@ -174,6 +176,10 @@ void NineChessWindow::initialize()
// 重置游戏规则 // 重置游戏规则
game->setRule(ruleNo); game->setRule(ruleNo);
// 规则提示
QString tip_Rule = QString("%1\n%2").arg(tr(NineChess::RULES[ruleNo].name))
.arg(tr(NineChess::RULES[ruleNo].info));
ui.tab_Rule->setPlainText(tip_Rule);
} }
void NineChessWindow::actionRules_triggered() void NineChessWindow::actionRules_triggered()
@ -188,6 +194,10 @@ void NineChessWindow::actionRules_triggered()
ruleNo = action->data().toInt(); ruleNo = action->data().toInt();
// 重置游戏规则 // 重置游戏规则
game->setRule(ruleNo); game->setRule(ruleNo);
// 规则提示
QString tip_Rule = QString("%1\n%2").arg(tr(NineChess::RULES[ruleNo].name))
.arg(tr(NineChess::RULES[ruleNo].info));
ui.tab_Rule->setPlainText(tip_Rule);
} }
@ -279,10 +289,10 @@ void NineChessWindow::on_actionResign_R_triggered()
void NineChessWindow::on_actionLimited_T_triggered() void NineChessWindow::on_actionLimited_T_triggered()
{ {
/* 其实本来可以用设计器做个ui然后从QDialog派生个自己的对话框 /* 其实本来可以用设计器做个ui然后从QDialog派生个自己的对话框
* *
* *
* QDialog界面 * QDialog界面
*/ */
int stepLimited = game->getStepsLimit(); int stepLimited = game->getStepsLimit();
int timeLimited = game->getTimeLimit(); int timeLimited = game->getTimeLimit();
@ -339,6 +349,10 @@ void NineChessWindow::on_actionLimited_T_triggered()
if (dialog->exec() == QDialog::Accepted) { if (dialog->exec() == QDialog::Accepted) {
stepLimited = comboBox_step->currentData().toInt(); stepLimited = comboBox_step->currentData().toInt();
timeLimited = comboBox_time->currentData().toInt(); timeLimited = comboBox_time->currentData().toInt();
// 选择当前规则
QAction *action = dynamic_cast<QAction *>(sender());
action->setChecked(true);
int ruleNo = action->data().toInt();
// 重置游戏规则 // 重置游戏规则
game->setRule(ruleNo, stepLimited, timeLimited); game->setRule(ruleNo, stepLimited, timeLimited);
} }
@ -370,7 +384,7 @@ void NineChessWindow::on_actionViewHelp_V_triggered()
void NineChessWindow::on_actionWeb_W_triggered() void NineChessWindow::on_actionWeb_W_triggered()
{ {
QDesktopServices::openUrl(QUrl("http://hy-tech.top"));
} }
void NineChessWindow::on_actionAbout_A_triggered() void NineChessWindow::on_actionAbout_A_triggered()

View File

@ -0,0 +1,28 @@
/* QPlainTextEdit派生类
* sizeHint函数
*
* QDockWidget没有很好的控制初始大小的方法resize函数没效果
* 使
* this->setFixedWidth(108);
*
*/
#ifndef SIZEHINTTEXTEDIT
#define SIZEHINTTEXTEDIT
#include <QPlainTextEdit>
class SizeHintTextEdit : public QPlainTextEdit
{
public:
SizeHintTextEdit(QWidget * parent = 0) {}
QSize sizeHint() const{
QSize size = QPlainTextEdit::sizeHint();
// 缺省宽度设为128这样就不太宽了
size.setWidth(128);
return size;
}
};
#endif // SIZEHINTTEXTEDIT