cleanups.

This commit is contained in:
Christoph Holzheuer
2026-02-09 16:03:09 +01:00
parent 5a71884cfb
commit 7993247027
27 changed files with 814 additions and 2253 deletions

View File

@@ -51,14 +51,14 @@ SOURCES += \
bcdriver.cpp \ bcdriver.cpp \
bcdriverstatewidget.cpp \ bcdriverstatewidget.cpp \
bcdrivertinycan.cpp \ bcdrivertinycan.cpp \
bcsliderstyle.cpp \
bcthemeswitchbutton.cpp \ bcthemeswitchbutton.cpp \
bctoggleswitch.cpp \ bctoggleswitch.cpp \
bctransmitter.cpp \ bctransmitter.cpp \
bcvalue.cpp \ bcvalue.cpp \
bcvaluedelegate.cpp \ bcvaluedelegate.cpp \
bcvalueeditor.cpp \
bcvaluemodel.cpp \ bcvaluemodel.cpp \
bcvalueslider.cpp \
bcvaluesliderstyle.cpp \
bcxmlloader.cpp \ bcxmlloader.cpp \
libwin/can_drv_win.c \ libwin/can_drv_win.c \
libwin/mhs_can_drv.c \ libwin/mhs_can_drv.c \
@@ -73,19 +73,19 @@ HEADERS += \
bcdriverstatewidget.h \ bcdriverstatewidget.h \
bcdrivertinycan.h \ bcdrivertinycan.h \
bcmainwindow.h \ bcmainwindow.h \
bcsliderstyle.h \
bcthemeswitchbutton.h \ bcthemeswitchbutton.h \
bctoggleswitch.h \ bctoggleswitch.h \
bctransmitter.h \ bctransmitter.h \
bcvalue.h \ bcvalue.h \
bcvaluedelegate.h \ bcvaluedelegate.h \
bcvalueeditor.h \
bcvaluemodel.h \ bcvaluemodel.h \
bcvalueslider.h \
BCValueSliderStyle.h \
bcxmlloader.h bcxmlloader.h
FORMS += \ FORMS += \
bcmainwindow.ui \ bcmainwindow.ui \
bcvalueeditor.ui bcvalueslider.ui
# Default rules for deployment. # Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin qnx: target.path = /tmp/$${TARGET}/bin

File diff suppressed because one or more lines are too long

View File

@@ -2,5 +2,5 @@
<Configurations> <Configurations>
<Platform Name="x64" /> <Platform Name="x64" />
</Configurations> </Configurations>
<Project Path="BionxControl.vcxproj" Id="4294daef-a666-3d4c-a433-ace7fb2b0c2f" /> <Project Path="BionxControl.vcxproj" Id="84c4d2da-be54-3c31-bef9-6bccdd5c3277" />
</Solution> </Solution>

View File

@@ -11,16 +11,14 @@
</ProjectConfiguration> </ProjectConfiguration>
</ItemGroup> </ItemGroup>
<PropertyGroup Label="Globals"> <PropertyGroup Label="Globals">
<ProjectGuid>{4294DAEF-A666-3D4C-A433-ACE7FB2B0C2F}</ProjectGuid> <ProjectGuid>{84C4D2DA-BE54-3C31-BEF9-6BCCDD5C3277}</ProjectGuid>
<RootNamespace>BionxControl</RootNamespace> <RootNamespace>BionxControl</RootNamespace>
<Keyword>QtVS_v304</Keyword> <Keyword>QtVS_v304</Keyword>
<WindowsTargetPlatformVersion>10.0.26100.0</WindowsTargetPlatformVersion>
<WindowsTargetPlatformMinVersion>10.0.26100.0</WindowsTargetPlatformMinVersion>
<QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild> <QtMsBuild Condition="'$(QtMsBuild)'=='' OR !Exists('$(QtMsBuild)\qt.targets')">$(MSBuildProjectDirectory)\QtMsBuild</QtMsBuild>
</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">
<PlatformToolset>v145</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<OutputDirectory>release\</OutputDirectory> <OutputDirectory>release\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage> <ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
@@ -29,7 +27,7 @@
<PrimaryOutput>BionxControl</PrimaryOutput> <PrimaryOutput>BionxControl</PrimaryOutput>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration"> <PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<PlatformToolset>v145</PlatformToolset> <PlatformToolset>v143</PlatformToolset>
<OutputDirectory>debug\</OutputDirectory> <OutputDirectory>debug\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage> <ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet> <CharacterSet>NotSet</CharacterSet>
@@ -40,11 +38,11 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(QtMsBuild)\qt_defaults.props" Condition="Exists('$(QtMsBuild)\qt_defaults.props')" /> <Import Project="$(QtMsBuild)\qt_defaults.props" Condition="Exists('$(QtMsBuild)\qt_defaults.props')" />
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtInstall>6.10.1_msvc2022_64</QtInstall> <QtInstall>msvc2022x64Qt6</QtInstall>
<QtModules>core;gui;widgets;svg</QtModules> <QtModules>core;gui;widgets;svg</QtModules>
</PropertyGroup> </PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtInstall>6.10.1_msvc2022_64</QtInstall> <QtInstall>msvc2022x64Qt6</QtInstall>
<QtModules>core;gui;widgets;svg</QtModules> <QtModules>core;gui;widgets;svg</QtModules>
</PropertyGroup> </PropertyGroup>
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') OR !Exists('$(QtMsBuild)\Qt.props')"> <Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') OR !Exists('$(QtMsBuild)\Qt.props')">
@@ -73,7 +71,7 @@
</PropertyGroup> </PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;libwin;release;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;libwin;..\..\Qt\6.10.1\msvc2022_64\include;..\..\Qt\6.10.1\msvc2022_64\include\QtSvg;..\..\Qt\6.10.1\msvc2022_64\include\QtWidgets;..\..\Qt\6.10.1\msvc2022_64\include\QtGui;..\..\Qt\6.10.1\msvc2022_64\include\QtCore;release;/include;..\..\Qt\6.10.1\msvc2022_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -utf-8 -w34100 -w34189 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -utf-8 -w34100 -w34189 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>release\</AssemblerListingLocation> <AssemblerListingLocation>release\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation> <BrowseInformation>false</BrowseInformation>
@@ -85,8 +83,7 @@
<Optimization>MaxSpeed</Optimization> <Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions> <PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile> <PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName> <ProgramDataBaseFileName></ProgramDataBaseFileName>
</ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary> <RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner> <SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType> <TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
@@ -95,8 +92,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>$(QTDIR)\lib\Qt6EntryPoint.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>C:\Qt\6.10.1\msvc2022_64\lib\Qt6EntryPoint.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(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>
<EnableCOMDATFolding>true</EnableCOMDATFolding> <EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -119,7 +115,7 @@
</ResourceCompile> </ResourceCompile>
<QtMoc> <QtMoc>
<CompilerFlavor>msvc</CompilerFlavor> <CompilerFlavor>msvc</CompilerFlavor>
<Include>./$(Configuration)/moc_predefs.h</Include> <Include>C:/projects/BionxControl/$(Configuration)/moc_predefs.h</Include>
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription> <ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
<DynamicSource>output</DynamicSource> <DynamicSource>output</DynamicSource>
<QtMocDir>$(Configuration)</QtMocDir> <QtMocDir>$(Configuration)</QtMocDir>
@@ -141,7 +137,7 @@
</ItemDefinitionGroup> </ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'"> <ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<ClCompile> <ClCompile>
<AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;libwin;debug;/include;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories> <AdditionalIncludeDirectories>GeneratedFiles\$(ConfigurationName);GeneratedFiles;.;libwin;..\..\Qt\6.10.1\msvc2022_64\include;..\..\Qt\6.10.1\msvc2022_64\include\QtSvg;..\..\Qt\6.10.1\msvc2022_64\include\QtWidgets;..\..\Qt\6.10.1\msvc2022_64\include\QtGui;..\..\Qt\6.10.1\msvc2022_64\include\QtCore;debug;/include;..\..\Qt\6.10.1\msvc2022_64\mkspecs\win32-msvc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
<AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -utf-8 -w34100 -w34189 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions> <AdditionalOptions>-Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -utf-8 -w34100 -w34189 -w44456 -w44457 -w44458 %(AdditionalOptions)</AdditionalOptions>
<AssemblerListingLocation>debug\</AssemblerListingLocation> <AssemblerListingLocation>debug\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation> <BrowseInformation>false</BrowseInformation>
@@ -161,8 +157,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation> <MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile> </ClCompile>
<Link> <Link>
<AdditionalDependencies>$(QTDIR)\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies> <AdditionalDependencies>C:\Qt\6.10.1\msvc2022_64\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(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>
@@ -182,7 +177,7 @@
</ResourceCompile> </ResourceCompile>
<QtMoc> <QtMoc>
<CompilerFlavor>msvc</CompilerFlavor> <CompilerFlavor>msvc</CompilerFlavor>
<Include>./$(Configuration)/moc_predefs.h</Include> <Include>C:/projects/BionxControl/$(Configuration)/moc_predefs.h</Include>
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription> <ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
<DynamicSource>output</DynamicSource> <DynamicSource>output</DynamicSource>
<QtMocDir>$(Configuration)</QtMocDir> <QtMocDir>$(Configuration)</QtMocDir>
@@ -210,19 +205,20 @@
<ClCompile Include="bcdriverstatewidget.cpp" /> <ClCompile Include="bcdriverstatewidget.cpp" />
<ClCompile Include="bcdrivertinycan.cpp" /> <ClCompile Include="bcdrivertinycan.cpp" />
<ClCompile Include="bcmainwindow.cpp" /> <ClCompile Include="bcmainwindow.cpp" />
<ClCompile Include="bcsliderstyle.cpp" />
<ClCompile Include="bcthemeswitchbutton.cpp" /> <ClCompile Include="bcthemeswitchbutton.cpp" />
<ClCompile Include="bctoggleswitch.cpp" /> <ClCompile Include="bctoggleswitch.cpp" />
<ClCompile Include="bctransmitter.cpp" /> <ClCompile Include="bctransmitter.cpp" />
<ClCompile Include="bcvalue.cpp" /> <ClCompile Include="bcvalue.cpp" />
<ClCompile Include="bcvaluedelegate.cpp" /> <ClCompile Include="bcvaluedelegate.cpp" />
<ClCompile Include="bcvalueeditor.cpp" />
<ClCompile Include="bcvaluemodel.cpp" /> <ClCompile Include="bcvaluemodel.cpp" />
<ClCompile Include="bcvalueslider.cpp" />
<ClCompile Include="bcvaluesliderstyle.cpp" />
<ClCompile Include="bcxmlloader.cpp" /> <ClCompile Include="bcxmlloader.cpp" />
<ClCompile Include="libwin\can_drv_win.c" /> <ClCompile Include="libwin\can_drv_win.c" />
<ClCompile Include="main.cpp" /> <ClCompile Include="main.cpp" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="bcvaluesliderstyle.h" />
<QtMoc Include="bc.h" /> <QtMoc Include="bc.h" />
<QtMoc Include="bcdelightpmwidget.h" /> <QtMoc Include="bcdelightpmwidget.h" />
<QtMoc Include="bcdeviceview.h" /> <QtMoc Include="bcdeviceview.h" />
@@ -230,35 +226,34 @@
<QtMoc Include="bcdriverstatewidget.h" /> <QtMoc Include="bcdriverstatewidget.h" />
<ClInclude Include="bcdrivertinycan.h" /> <ClInclude Include="bcdrivertinycan.h" />
<QtMoc Include="bcmainwindow.h" /> <QtMoc Include="bcmainwindow.h" />
<ClInclude Include="bcsliderstyle.h" />
<QtMoc Include="bcthemeswitchbutton.h" /> <QtMoc Include="bcthemeswitchbutton.h" />
<QtMoc Include="bctoggleswitch.h" /> <QtMoc Include="bctoggleswitch.h" />
<QtMoc Include="bctransmitter.h" /> <QtMoc Include="bctransmitter.h" />
<QtMoc Include="bcvalue.h" /> <QtMoc Include="bcvalue.h" />
<QtMoc Include="bcvaluedelegate.h" /> <QtMoc Include="bcvaluedelegate.h" />
<QtMoc Include="bcvalueeditor.h" />
<QtMoc Include="bcvaluemodel.h" /> <QtMoc Include="bcvaluemodel.h" />
<QtMoc Include="bcvalueslider.h" />
<QtMoc Include="bcxmlloader.h" /> <QtMoc Include="bcxmlloader.h" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<CustomBuild Include="debug\moc_predefs.h.cbt"> <CustomBuild Include="debug\moc_predefs.h.cbt">
<FileType>Document</FileType> <FileType>Document</FileType>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs> <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -Zi -MDd -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;$(IntDir)\moc_predefs.h</Command> <Command Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">cl -BxC:\Qt\6.10.1\msvc2022_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -Zi -MDd -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;$(IntDir)\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generate moc_predefs.h</Message> <Message Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs> <Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild> </CustomBuild>
<CustomBuild Include="release\moc_predefs.h.cbt"> <CustomBuild Include="release\moc_predefs.h.cbt">
<FileType>Document</FileType> <FileType>Document</FileType>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs> <AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp;%(AdditionalInputs)</AdditionalInputs>
<Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl -Bx"$(QTDIR)\bin\qmake.exe" -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -O2 -MD -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E $(QTDIR)\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;$(IntDir)\moc_predefs.h</Command> <Command Condition="'$(Configuration)|$(Platform)'=='Release|x64'">cl -BxC:\Qt\6.10.1\msvc2022_64\bin\qmake.exe -nologo -Zc:wchar_t -FS -Zc:rvalueCast -Zc:inline -Zc:strictStrings -Zc:throwingNew -permissive- -Zc:__cplusplus -Zc:externConstexpr -std=c++23 -O2 -MD -std:c++latest -utf-8 -W3 -w34100 -w34189 -w44456 -w44457 -w44458 -wd4577 -wd4467 -E ..\..\Qt\6.10.1\msvc2022_64\mkspecs\features\data\dummy.cpp 2&gt;NUL &gt;$(IntDir)\moc_predefs.h</Command>
<Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generate moc_predefs.h</Message> <Message Condition="'$(Configuration)|$(Platform)'=='Release|x64'">Generate moc_predefs.h</Message>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs> <Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild> </CustomBuild>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<QtUic Include="bcmainwindow.ui" /> <QtUic Include="bcmainwindow.ui" />
<QtUic Include="bcvalueeditor.ui" /> <QtUic Include="bcvalueslider.ui" />
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<None Include="resources\bc_dark.qss" /> <None Include="resources\bc_dark.qss" />

View File

@@ -68,9 +68,6 @@
<ClCompile Include="bcmainwindow.cpp"> <ClCompile Include="bcmainwindow.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="bcsliderstyle.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bcthemeswitchbutton.cpp"> <ClCompile Include="bcthemeswitchbutton.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
@@ -86,10 +83,13 @@
<ClCompile Include="bcvaluedelegate.cpp"> <ClCompile Include="bcvaluedelegate.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="bcvalueeditor.cpp"> <ClCompile Include="bcvaluemodel.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="bcvaluemodel.cpp"> <ClCompile Include="bcvalueslider.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="bcvaluesliderstyle.cpp">
<Filter>Source Files</Filter> <Filter>Source Files</Filter>
</ClCompile> </ClCompile>
<ClCompile Include="bcxmlloader.cpp"> <ClCompile Include="bcxmlloader.cpp">
@@ -103,6 +103,9 @@
</ClCompile> </ClCompile>
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<ClInclude Include="bcvaluesliderstyle.h">
<Filter>Header Files</Filter>
</ClInclude>
<QtMoc Include="bc.h"> <QtMoc Include="bc.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</QtMoc> </QtMoc>
@@ -124,9 +127,6 @@
<QtMoc Include="bcmainwindow.h"> <QtMoc Include="bcmainwindow.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</QtMoc> </QtMoc>
<ClInclude Include="bcsliderstyle.h">
<Filter>Header Files</Filter>
</ClInclude>
<QtMoc Include="bcthemeswitchbutton.h"> <QtMoc Include="bcthemeswitchbutton.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</QtMoc> </QtMoc>
@@ -142,10 +142,10 @@
<QtMoc Include="bcvaluedelegate.h"> <QtMoc Include="bcvaluedelegate.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</QtMoc> </QtMoc>
<QtMoc Include="bcvalueeditor.h"> <QtMoc Include="bcvaluemodel.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</QtMoc> </QtMoc>
<QtMoc Include="bcvaluemodel.h"> <QtMoc Include="bcvalueslider.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</QtMoc> </QtMoc>
<QtMoc Include="bcxmlloader.h"> <QtMoc Include="bcxmlloader.h">
@@ -164,7 +164,7 @@
<QtUic Include="bcmainwindow.ui"> <QtUic Include="bcmainwindow.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</QtUic> </QtUic>
<QtUic Include="bcvalueeditor.ui"> <QtUic Include="bcvalueslider.ui">
<Filter>Form Files</Filter> <Filter>Form Files</Filter>
</QtUic> </QtUic>
</ItemGroup> </ItemGroup>

View File

@@ -1,3 +1,33 @@
/***************************************************************************
BionxControl
© 2025 -2026 christoph holzheuer
christoph.holzheuer@gmail.com
Using:
mhs_can_drv.c
© 2011 - 2023 by MHS-Elektronik GmbH & Co. KG, Germany
Klaus Demlehner, klaus@mhs-elektronik.de
@see www.mhs-elektronik.de
Based on Bionx data type descriptions from:
BigXionFlasher USB V 0.2.4 rev. 97
© 2011-2013 by Thomas Koenig <info@bigxionflasher.org>
@see www.bigxionflasher.org
Bionx Bike Info
© 2018 Thorsten Schmidt (tschmidt@ts-soft.de)
@see www.ts-soft.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@see https://github.com/bikemike/bionx-bikeinfo
***************************************************************************/
#include <QPropertyAnimation> #include <QPropertyAnimation>

View File

@@ -1,5 +1,37 @@
#ifndef BCDELIGHTPMWIDGET_H /***************************************************************************
#define BCDELIGHTPMWIDGET_H
BionxControl
© 2025 -2026 christoph holzheuer
christoph.holzheuer@gmail.com
Using:
mhs_can_drv.c
© 2011 - 2023 by MHS-Elektronik GmbH & Co. KG, Germany
Klaus Demlehner, klaus@mhs-elektronik.de
@see www.mhs-elektronik.de
Based on Bionx data type descriptions from:
BigXionFlasher USB V 0.2.4 rev. 97
© 2011-2013 by Thomas Koenig <info@bigxionflasher.org>
@see www.bigxionflasher.org
Bionx Bike Info
© 2018 Thorsten Schmidt (tschmidt@ts-soft.de)
@see www.ts-soft.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@see https://github.com/bikemike/bionx-bikeinfo
***************************************************************************/
#ifndef BC_DELIGHTPMWIDGET_H
#define BC_DELIGHTPMWIDGET_H
#include <QObject> #include <QObject>
@@ -30,4 +62,4 @@ protected:
QList<QWidget*> _flyingWidgets; QList<QWidget*> _flyingWidgets;
}; };
#endif // BCDELIGHTPMWIDGET_H #endif // BC_DELIGHTPMWIDGET_H

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCDEVICEVIEW_H #ifndef BC_DEVICEVIEW_H
#define BCDEVICEVIEW_H #define BC_DEVICEVIEW_H
#include <QTableView> #include <QTableView>
@@ -72,4 +72,4 @@ protected:
}; };
#endif // BCDEVICEVIEW_H #endif // BC_DEVICEVIEW_H

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCDRIVER_H #ifndef BC_DRIVER_H
#define BCDRIVER_H #define BC_DRIVER_H
#include <QObject> #include <QObject>
#include <expected> #include <expected>
@@ -119,4 +119,4 @@ public:
}; };
#endif // BCDRIVER_H #endif // BC_DRIVER_H

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCDRIVERSTATEWIDGET_H #ifndef B_CDRIVERSTATEWIDGET_H
#define BCDRIVERSTATEWIDGET_H #define BC_DRIVERSTATEWIDGET_H
/** /**
@@ -73,4 +73,4 @@ protected:
}; };
#endif // BCDRIVERSTATEWIDGET_H #endif // BC_DRIVERSTATEWIDGET_H

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCDRIVERTINYCAN_H #ifndef BC_DRIVERTINYCAN_H
#define BCDRIVERTINYCAN_H #define BC_DRIVERTINYCAN_H
#include <bcdriver.h> #include <bcdriver.h>
@@ -60,4 +60,4 @@ private:
}; };
#endif // BCDRIVERTINYCAN_H #endif // BC_DRIVERTINYCAN_H

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCMAINWINDOW_H #ifndef BC_MAINWINDOW_H
#define BCMAINWINDOW_H #define BC_MAINWINDOW_H
#include <QMainWindow> #include <QMainWindow>
#include <QThread> #include <QThread>
@@ -101,4 +101,4 @@ protected:
}; };
#endif // BCMAINWINDOW_H #endif // BC_MAINWINDOW_H

View File

@@ -1,5 +1,36 @@
#include <bcthemeswitchbutton.h> /***************************************************************************
BionxControl
© 2025 -2026 christoph holzheuer
christoph.holzheuer@gmail.com
Using:
mhs_can_drv.c
© 2011 - 2023 by MHS-Elektronik GmbH & Co. KG, Germany
Klaus Demlehner, klaus@mhs-elektronik.de
@see www.mhs-elektronik.de
Based on Bionx data type descriptions from:
BigXionFlasher USB V 0.2.4 rev. 97
© 2011-2013 by Thomas Koenig <info@bigxionflasher.org>
@see www.bigxionflasher.org
Bionx Bike Info
© 2018 Thorsten Schmidt (tschmidt@ts-soft.de)
@see www.ts-soft.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@see https://github.com/bikemike/bionx-bikeinfo
***************************************************************************/
#include <bcthemeswitchbutton.h>
BCThemeSwitchButton::BCThemeSwitchButton(QWidget *parent ) BCThemeSwitchButton::BCThemeSwitchButton(QWidget *parent )

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCTHEMESWITCHBUTTON_H #ifndef BC_THEMESWITCHBUTTON_H
#define BCTHEMESWITCHBUTTON_H #define BC_THEMESWITCHBUTTON_H
#include <QPushButton> #include <QPushButton>
@@ -69,4 +69,4 @@ private:
}; };
#endif // BCTHEMESWITCHBUTTON_H #endif // BC_THEMESWITCHBUTTON_H

View File

@@ -1,3 +1,34 @@
/***************************************************************************
BionxControl
© 2025 -2026 christoph holzheuer
christoph.holzheuer@gmail.com
Using:
mhs_can_drv.c
© 2011 - 2023 by MHS-Elektronik GmbH & Co. KG, Germany
Klaus Demlehner, klaus@mhs-elektronik.de
@see www.mhs-elektronik.de
Based on Bionx data type descriptions from:
BigXionFlasher USB V 0.2.4 rev. 97
© 2011-2013 by Thomas Koenig <info@bigxionflasher.org>
@see www.bigxionflasher.org
Bionx Bike Info
© 2018 Thorsten Schmidt (tschmidt@ts-soft.de)
@see www.ts-soft.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@see https://github.com/bikemike/bionx-bikeinfo
***************************************************************************/
#include "bctoggleswitch.h" #include "bctoggleswitch.h"

View File

@@ -1,5 +1,5 @@
#ifndef BCTOGGLESWITCH_H #ifndef BC_TOGGLESWITCH_H
#define BCTOGGLESWITCH_H #define BC_TOGGLESWITCH_H
#include <QAbstractButton> #include <QAbstractButton>
@@ -35,4 +35,4 @@ private:
QPropertyAnimation* m_animation; QPropertyAnimation* m_animation;
}; };
#endif // BCTOGGLESWITCH_H #endif // BC_TOGGLESWITCH_H

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCTRANSMITTER_H #ifndef BC_TRANSMITTER_H
#define BCTRANSMITTER_H #define BC_TRANSMITTER_H
#include <QObject> #include <QObject>
#include <QQueue> #include <QQueue>
@@ -86,4 +86,4 @@ private:
}; };
#endif // BCTRANSMITTER_H #endif // BC_TRANSMITTER_H

View File

@@ -30,15 +30,11 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCVALUEMEMBER_H #ifndef BC_VALUEMEMBER_H
#define BCVALUEMEMBER_H #define BC_VALUEMEMBER_H
#include <expected> #include <expected>
#include <QObject>
#include <QString>
#include <QList>
#include <QVariant>
#include <bc.h> #include <bc.h>

View File

@@ -44,8 +44,8 @@
#include <bcdeviceview.h> #include <bcdeviceview.h>
#include <bcvaluedelegate.h> #include <bcvaluedelegate.h>
#include <bcvalueeditor.h> #include <bcvalueslider.h>
#include <bcvaluesliderstyle.h>
BCValueDelegate::BCValueDelegate(const BCValueList& valueList, BCDeviceView* view) BCValueDelegate::BCValueDelegate(const BCValueList& valueList, BCDeviceView* view)
: QStyledItemDelegate{view}, _valueList{valueList}, _view{view} : QStyledItemDelegate{view}, _valueList{valueList}, _view{view}
@@ -69,18 +69,18 @@ QWidget* BCValueDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
qDebug() << " --- Create Editor: " << bcValue.label() << " value: " << params.value << " min: " << params.min << " max: " << params.max << " ratio:" << bcValue.calcMinMaxRatio()*100.0 << '%'; qDebug() << " --- Create Editor: " << bcValue.label() << " value: " << params.value << " min: " << params.min << " max: " << params.max << " ratio:" << bcValue.calcMinMaxRatio()*100.0 << '%';
auto* valueEditor = new BCValueEditor(parent); auto* valueEditor = new BCValueSlider(parent);
valueEditor->setValueAndRange( params ); valueEditor->setValueAndRange( params );
// Signal für sofortige Updates // Signal für sofortige Updates
connect(valueEditor, &BCValueEditor::valueChanged, this, [this, valueEditor]() connect(valueEditor, &BCValueSlider::valueChanged, this, [this, valueEditor]()
{ {
// Commit data sofort bei Änderung // Commit data sofort bei Änderung
emit const_cast<BCValueDelegate*>(this)->commitData(valueEditor); emit const_cast<BCValueDelegate*>(this)->commitData(valueEditor);
}); });
// Signal für sofortige Updates // Signal für sofortige Updates
connect(valueEditor, &BCValueEditor::valueCommited, this, [this, valueEditor](int newValue) connect(valueEditor, &BCValueSlider::valueCommited, this, [this, valueEditor](int newValue)
{ {
qDebug() << " --- value set:" << newValue; qDebug() << " --- value set:" << newValue;
// Commit data sofort bei Änderung // Commit data sofort bei Änderung
@@ -104,7 +104,7 @@ void BCValueDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, c
if( index.column() == 1) if( index.column() == 1)
{ {
// Daten vom Editor zurück ins Model speichern (Beim Schließen) // Daten vom Editor zurück ins Model speichern (Beim Schließen)
BCValueEditor* slider = qobject_cast<BCValueEditor*>(editor); BCValueSlider* slider = qobject_cast<BCValueSlider*>(editor);
if (slider) if (slider)
{ {
int value = slider->value(); int value = slider->value();
@@ -131,13 +131,11 @@ void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& optio
const BCValue& bcValue = *(_valueList[ index.row()].get()); const BCValue& bcValue = *(_valueList[ index.row()].get());
if( !bcValue.isReadOnly() ) if( !bcValue.isReadOnly() )
{ {
// Wir zeichnen boolean Values an toggle switches
if( bcValue.valueType() == BCValue::ValueType::Bool ) if( bcValue.valueType() == BCValue::ValueType::Bool )
paintButtonIndicator(painter, option, bcValue); paintToggleSwitch(painter, option, bcValue);
else else
{ paintSlider(painter, option.rect, bcValue.calcMinMaxRatio() );
BCValueEditor::paintSliderIndicator(painter, option.rect, bcValue.calcMinMaxRatio() );
}
} }
if(_rowOpacities.contains(row)) if(_rowOpacities.contains(row))
@@ -145,6 +143,11 @@ void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& optio
} }
void BCValueDelegate::paintSlider(QPainter* painter, const QRect& rect, double ratio )const
{
QRect sliderRect = BCValueSlider::updateEditorRect( rect );
BCValueSliderStyle::paintSliderIndicator2(painter, sliderRect, ratio );
}
void BCValueDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const void BCValueDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const
{ {
@@ -178,11 +181,11 @@ void BCValueDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionVi
{ {
Q_UNUSED(index) Q_UNUSED(index)
QRect sliderRect = BCValueEditor::updateEditorRect( option.rect ); QRect sliderRect = BCValueSlider::updateEditorRect( option.rect );
editor->setGeometry(sliderRect); // Slider nur über Progress Bar editor->setGeometry(sliderRect); // Slider nur über Progress Bar
} }
void BCValueDelegate::paintButtonIndicator(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const void BCValueDelegate::paintToggleSwitch(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const
{ {
} }
@@ -219,7 +222,9 @@ void BCValueDelegate::onHighlightRow(int row)
// Schnelles Fade-in (20%), langsames Fade-out (80%) // Schnelles Fade-in (20%), langsames Fade-out (80%)
if (progress < 0.2) { if (progress < 0.2) {
opacity = progress * 5.0; // 0->1 in 20% opacity = progress * 5.0; // 0->1 in 20%
} else { }
else
{
opacity = 1.0 - ((progress - 0.2) / 0.8); // 1->0 in 80% opacity = 1.0 - ((progress - 0.2) / 0.8); // 1->0 in 80%
} }
@@ -229,7 +234,7 @@ void BCValueDelegate::onHighlightRow(int row)
connect(anim, &QVariantAnimation::finished, this, [this, row, anim]() connect(anim, &QVariantAnimation::finished, this, [this, row, anim]()
{ {
_rowOpacities.remove(row); _rowOpacities.remove(row);
_rowAnimations.remove(row); _rowAnimations.remove(row);
updateRow(row); updateRow(row);
anim->deleteLater(); anim->deleteLater();
@@ -241,7 +246,7 @@ void BCValueDelegate::onHighlightRow(int row)
/** /**
* @brief Sopt alle gerade laufenden Animationen * @brief Stopt alle gerade laufenden Animationen
*/ */
void BCValueDelegate::clearAllHighlights() void BCValueDelegate::clearAllHighlights()
@@ -252,12 +257,11 @@ void BCValueDelegate::clearAllHighlights()
anim->deleteLater(); anim->deleteLater();
} }
_rowAnimations.clear(); _rowAnimations.clear();
_rowOpacities.clear(); _rowOpacities.clear();
if (_view) if (_view)
{
_view->viewport()->update(); _view->viewport()->update();
}
} }
@@ -272,9 +276,8 @@ void BCValueDelegate::updateRow(int row)
{ {
QModelIndex idx = _view->model()->index(row,1); QModelIndex idx = _view->model()->index(row,1);
QRect rect = _view->visualRect(idx); QRect rect = _view->visualRect(idx);
if (!rect.isEmpty()) { if (!rect.isEmpty())
_view->viewport()->update(rect); _view->viewport()->update(rect);
}
} }
} }

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCVALUEDELEGATE_H #ifndef BC_VALUEDELEGATE_H
#define BCVALUEDELEGATE_H #define BC_VALUEDELEGATE_H
#include <QStyledItemDelegate> #include <QStyledItemDelegate>
@@ -69,9 +69,8 @@ protected:
void updateRow(int row); void updateRow(int row);
void paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const; void paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const;
void paintSliderIndicator(QPainter* painter, const QRect &rect, double ratio) const; void paintToggleSwitch(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const;
void paintButtonIndicator(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const; void paintSlider(QPainter* painter, const QRect& rect, double ratio ) const;
// Das ist ein Quickhack, der Delegate sollte // Das ist ein Quickhack, der Delegate sollte
// nichts über die Originaldaten wissen. Die // nichts über die Originaldaten wissen. Die
// Datenbeschaffung ist alleine Sache des Models. // Datenbeschaffung ist alleine Sache des Models.
@@ -88,4 +87,4 @@ protected:
}; };
#endif // BCVALUEDELEGATE_H #endif // BC_VALUEDELEGATE_H

View File

@@ -30,8 +30,8 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCVALUEMODEL_H #ifndef BC_VALUEMODEL_H
#define BCVALUEMODEL_H #define BC_VALUEMODEL_H
#include <QAbstractTableModel> #include <QAbstractTableModel>
#include <bcvalue.h> #include <bcvalue.h>
@@ -77,4 +77,4 @@ protected:
}; };
#endif // BCVALUEMODEL_H #endif // BC_VALUEMODEL_H

View File

@@ -1,23 +1,54 @@
/***************************************************************************
#include <bcsliderstyle.h> BionxControl
#include <bcvalueeditor.h> © 2025 -2026 christoph holzheuer
christoph.holzheuer@gmail.com
Using:
mhs_can_drv.c
© 2011 - 2023 by MHS-Elektronik GmbH & Co. KG, Germany
Klaus Demlehner, klaus@mhs-elektronik.de
@see www.mhs-elektronik.de
Based on Bionx data type descriptions from:
BigXionFlasher USB V 0.2.4 rev. 97
© 2011-2013 by Thomas Koenig <info@bigxionflasher.org>
@see www.bigxionflasher.org
Bionx Bike Info
© 2018 Thorsten Schmidt (tschmidt@ts-soft.de)
@see www.ts-soft.de
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 3 of the License, or
(at your option) any later version.
@see https://github.com/bikemike/bionx-bikeinfo
***************************************************************************/
BCValueEditor::BCValueEditor( QWidget *parent ) #include <QPushButton>
#include <bcvaluesliderstyle.h>
#include <bcvalueslider.h>
BCValueSlider::BCValueSlider( QWidget *parent )
: QWidget(parent) : QWidget(parent)
{ {
setupUi(this); setupUi(this);
// wir wollen ja modern sein // wir wollen ja modern sein
_slider->setStyle(new BCSliderStyle()); _slider->setStyle(new BCValueSliderStyle());
setAutoFillBackground(true); setAutoFillBackground(true);
QSizePolicy sp = _commitButton->sizePolicy(); QSizePolicy sp = _commitButton->sizePolicy();
sp.setRetainSizeWhenHidden(true); // <--- Das ist der magische Schalter sp.setRetainSizeWhenHidden(true); // <--- Das ist der magische Schalter
_commitButton->setSizePolicy(sp); _commitButton->setSizePolicy(sp);
// Wenn Slider bewegt wird -> Signal nach außen senden // Wenn Slider bewegt wird -> Signal nach außen senden
connect(_slider, &QSlider::valueChanged, this, [this](int val) connect(_slider, &QSlider::valueChanged, this, [this](int val)
{ {
@@ -32,12 +63,12 @@ BCValueEditor::BCValueEditor( QWidget *parent )
} }
int BCValueEditor::value() const int BCValueSlider::value() const
{ {
return _slider->value(); return _slider->value();
} }
void BCValueEditor::setValueAndRange( const BCValue::ValueRange& params ) void BCValueSlider::setValueAndRange( const BCValue::ValueRange& params )
{ {
_slider->setRange( params.min, params.max); _slider->setRange( params.min, params.max);
// Block Signals verhindern Endlosschleifen, falls das Model // Block Signals verhindern Endlosschleifen, falls das Model
@@ -52,46 +83,13 @@ void BCValueEditor::setValueAndRange( const BCValue::ValueRange& params )
} }
/** QRect BCValueSlider::updateEditorRect( const QRect& rect)
* @brief Zeichnet eine passiven Slider, um den möglichen Wertebereich des übergebenen BCValue anzuzeigen.
*/
void BCValueEditor::paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio )
{ {
// Kleinen Slider-Indikator zeichnen return rect.adjusted
painter->save(); (
painter->setRenderHint(QPainter::Antialiasing);
qDebug() << " ---WTF in paint: " <<rect;
int adjX = rect.width() - cTextBlockOffset;
// Mini Progress Bar: der Gesamtbereich
QRect barRect = rect.adjusted( adjX, 12, -10-24, -12 );
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xE0E0E0));
painter->drawRoundedRect(barRect, 2, 2);
// Mini Progress Bar: der Wertebereich
barRect.setWidth( ratio * barRect.width() );
painter->setBrush(QColor(0x0078D4));
painter->drawRoundedRect(barRect, 2, 2);
if(rect.x() != 0 )
painter->setBrush(Qt::blue);
else
painter->setBrush(Qt::red);
painter->drawRoundedRect(rect, 2, 2);
painter->restore();
}
QRect BCValueEditor::updateEditorRect( const QRect& rect)
{
return rect.adjusted(
rect.width() - cTextBlockOffset, // Von rechts: cTextBlockOffset (==130) px (Breite der Progress Bar) rect.width() - cTextBlockOffset, // Von rechts: cTextBlockOffset (==130) px (Breite der Progress Bar)
0, // Oben: kein Offset 0, // Oben: kein Offset
-cPaddingRight, // Rechts: 8px Padding -cPaddingRight, // Rechts: 8px Padding
0 // Unten: kein Offset 0 // Unten: kein Offset
); );
} }

View File

@@ -1,31 +1,29 @@
#ifndef BCValueEditor_H #ifndef BC_VALUESLIDER_H
#define BCValueEditor_H #define BC_VALUESLIDER_H
#include <QWidget> #include <QWidget>
#include <bcvalue.h> #include <bcvalue.h>
#include <ui_bcvalueeditor.h> #include <ui_bcvalueslider.h>
class QSlider; class QSlider;
class QPushButton; class QPushButton;
class BCValue; class BCValue;
class BCValueEditor : public QWidget, private Ui::BCValueEditor class BCValueSlider : public QWidget, private Ui::BCValueSlider
{ {
Q_OBJECT Q_OBJECT
public: public:
explicit BCValueEditor(QWidget *parent = nullptr); explicit BCValueSlider(QWidget *parent = nullptr);
int value() const; int value() const;
void setValueAndRange( const BCValue::ValueRange& params ); void setValueAndRange( const BCValue::ValueRange& params );
// helper functions // helper functions
static QRect updateEditorRect( const QRect& rect); static QRect updateEditorRect( const QRect& rect);
static void paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio );
signals: signals:
@@ -40,4 +38,4 @@ protected:
}; };
#endif // BCValueEditor_H #endif // BC_VALUESLIDER_H

View File

@@ -1,7 +1,7 @@
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<ui version="4.0"> <ui version="4.0">
<class>BCValueEditor</class> <class>BCValueSlider</class>
<widget class="QWidget" name="BCValueEditor"> <widget class="QWidget" name="BCValueSlider">
<property name="geometry"> <property name="geometry">
<rect> <rect>
<x>0</x> <x>0</x>

View File

@@ -30,17 +30,17 @@
***************************************************************************/ ***************************************************************************/
#include <bcsliderstyle.h> #include <bcvaluesliderstyle.h>
#include <bcvalueeditor.h> #include <bcvalueslider.h>
BCSliderStyle::BCSliderStyle() BCValueSliderStyle::BCValueSliderStyle()
: QProxyStyle() : QProxyStyle()
{ {
} }
int BCSliderStyle::pixelMetric(PixelMetric metric, const QStyleOption* option, const QWidget* widget ) const int BCValueSliderStyle::pixelMetric(PixelMetric metric, const QStyleOption* option, const QWidget* widget ) const
{ {
switch (metric) switch (metric)
{ {
@@ -65,7 +65,7 @@ int BCSliderStyle::pixelMetric(PixelMetric metric, const QStyleOption* option, c
} }
} }
QRect BCSliderStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex* opt,SubControl sc, const QWidget* widget) const QRect BCValueSliderStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex* opt,SubControl sc, const QWidget* widget) const
{ {
if (cc == CC_Slider) { if (cc == CC_Slider) {
if (const QStyleOptionSlider* slider = qstyleoption_cast<const QStyleOptionSlider*>(opt)) if (const QStyleOptionSlider* slider = qstyleoption_cast<const QStyleOptionSlider*>(opt))
@@ -76,35 +76,21 @@ QRect BCSliderStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
if (sc == SC_SliderHandle) if (sc == SC_SliderHandle)
{ {
// Handle Position korrekt berechnen // Handle Position korrekt berechnen
if (slider->orientation == Qt::Horizontal) int range = slider->maximum - slider->minimum;
{ int pos = slider->sliderPosition - slider->minimum;
int range = slider->maximum - slider->minimum; int pixelRange = rect.width() - handleSize;
int pos = slider->sliderPosition - slider->minimum; int pixelPos = (range != 0) ? (pos * pixelRange) / range : 0;
int pixelRange = rect.width() - handleSize;
int pixelPos = (range != 0) ? (pos * pixelRange) / range : 0;
return QRect(rect.x() + pixelPos, return QRect(rect.x() + pixelPos,
rect.center().y() - handleSize / 2, rect.center().y() - handleSize / 2,
handleSize, handleSize); handleSize, handleSize);
}
else
{
int range = slider->maximum - slider->minimum;
int pos = slider->sliderPosition - slider->minimum;
int pixelRange = rect.height() - handleSize;
int pixelPos = (range != 0) ? (pos * pixelRange) / range : 0;
return QRect(rect.center().x() - handleSize / 2,
rect.bottom() - pixelPos - handleSize,
handleSize, handleSize);
}
} }
} }
} }
return QProxyStyle::subControlRect(cc, opt, sc, widget); return QProxyStyle::subControlRect(cc, opt, sc, widget);
} }
void BCSliderStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget) const void BCValueSliderStyle::drawComplexControl(ComplexControl control, const QStyleOptionComplex* option, QPainter* painter, const QWidget* widget) const
{ {
if (control == CC_Slider) if (control == CC_Slider)
{ {
@@ -113,12 +99,8 @@ void BCSliderStyle::drawComplexControl(ComplexControl control, const QStyleOptio
// Fluent Colors // Fluent Colors
QColor accentColor(0, 120, 212); // #0078D4 QColor accentColor(0, 120, 212); // #0078D4
QColor inactiveColor(138, 136, 134); // #8A8886
QColor bgColor(255, 255, 255); // White background QColor bgColor(255, 255, 255); // White background
//QColor disabledText = option.palette.color(QPalette::Disabled, QPalette::Text); drawHorizontalFluentSlider(painter, slider, accentColor, bgColor);
//painter->setBrush(disabledText);
//QColor bgColor = Qt::green;//option->palette.color(QPalette::Base);
drawHorizontalFluentSlider(painter, slider, accentColor, inactiveColor, bgColor);
return; return;
} }
} }
@@ -126,67 +108,56 @@ void BCSliderStyle::drawComplexControl(ComplexControl control, const QStyleOptio
} }
void BCSliderStyle::drawHorizontalFluentSlider(QPainter* painter, const QStyleOptionSlider* slider, void BCValueSliderStyle::drawHorizontalFluentSlider(QPainter* painter, const QStyleOptionSlider* slider,
const QColor& activeColor, const QColor& inactiveColor, const QColor& activeColor,
const QColor& bgColor) const const QColor& bgColor) const
{ {
QRect groove = slider->rect; QRect groove = slider->rect;
QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, nullptr);
qDebug() << " ---WTF: " << groove;
BCValueEditor::paintSliderIndicator(painter, groove, 0.5 ); QRect handleRect = subControlRect(CC_Slider, slider, SC_SliderHandle, nullptr);
/* // Das 'subControlRect' für den SC_SliderHandle ist _nicht_ mittig
int grooveHeight = 4; handleRect.setY( handleRect.y() + 2 );
// Track sollte im Widget-Zentrum sein, nicht im groove-Zentrum
int grooveY = groove.center().y() - grooveHeight / 2;
// Full background track
QRect fullTrack(groove.left(), grooveY, groove.width(), grooveHeight);
painter->setPen(Qt::NoPen);
painter->setBrush(inactiveColor.lighter(150));
painter->drawRoundedRect(fullTrack, grooveHeight / 2, grooveHeight / 2);
QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, nullptr);
// Active track (filled portion)
int activeWidth = handle.center().x() - groove.left();
QRect activeTrack(groove.left(), grooveY, activeWidth, grooveHeight);
painter->setBrush(activeColor);
painter->drawRoundedRect(activeTrack, grooveHeight / 2, grooveHeight / 2);
*/
qDebug() << " --- doPaint: drawHorizontalFluentSlider" << groove << " Handle: " << handleRect;
paintSliderIndicator2(painter, groove, 0.5 );
painter->setBrush(Qt::red);
painter->drawRect(handleRect);
return;
// Handle (Thumb) - Fluent style is more subtle // Handle (Thumb) - Fluent style is more subtle
int handleSize = 16; int handleSize = 14;
QRect thumbRect(handle.center().x() - handleSize / 2, QRect thumbRect(handleRect.center().x() - handleSize / 2,
handle.center().y() - handleSize / 2, handleRect.center().y() - handleSize / 2,
handleSize, handleSize); handleSize, handleSize);
/*
// Hover effect - subtle glow // Hover effect - subtle glow
if (slider->state & State_MouseOver) if (slider->state & State_MouseOver)
{ {
painter->setBrush(QColor(activeColor.red(), activeColor.green(), painter->setBrush(QColor(activeColor.red(), activeColor.green(),
activeColor.blue(), 30)); activeColor.blue(), 30));
int glowSize = 18; int glowSize = 16;
QRect glow(handle.center().x() - glowSize / 2, QRect glow(handle.center().x() - glowSize / 2,
handle.center().y() - glowSize / 2, handle.center().y() - glowSize / 2,
glowSize, glowSize); glowSize, glowSize);
painter->drawEllipse(glow); painter->drawEllipse(glow);
} }
*/
// Thumb // Thumb
painter->setBrush(bgColor); painter->setBrush(bgColor);
painter->setPen(QPen(activeColor, 2)); painter->setPen(QPen(activeColor, 2));
painter->drawEllipse(thumbRect); painter->drawEllipse(thumbRect);
/*
// Inner circle for pressed state // Inner circle for pressed state
if (slider->state & State_Sunken) { if (slider->state & State_Sunken)
{
int innerSize = 6; int innerSize = 6;
QRect inner(handle.center().x() - innerSize / 2, QRect inner(handle.center().x() - innerSize / 2,
handle.center().y() - innerSize / 2, handle.center().y() - innerSize / 2,
@@ -195,5 +166,70 @@ void BCSliderStyle::drawHorizontalFluentSlider(QPainter* painter, const QStyleOp
painter->setBrush(activeColor); painter->setBrush(activeColor);
painter->drawEllipse(inner); painter->drawEllipse(inner);
} }
*/
}
/**
* @brief Zeichnet eine passiven Slider, um den möglichen Wertebereich des übergebenen BCValue anzuzeigen.
*/
void BCValueSliderStyle::paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio )
{
return;
// Kleinen Slider-Indikator zeichnen
painter->save();
painter->setRenderHint(QPainter::Antialiasing);
int adjX = rect.width() - 130; //cTextBlockOffset;
// Mini Progress Bar: der Gesamtbereich
QRect barRect = rect.adjusted( adjX, 12, -10-24, -12 );
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xE0E0E0));
painter->drawRoundedRect(barRect, 2, 2);
qDebug() << " --- doPaint: in paintSliderIndicator1: " << rect;
qDebug() << " --- doPaint: in paintSliderIndicator2: " << barRect;
// Mini Progress Bar: der Wertebereich
barRect.setWidth( ratio * barRect.width() );
painter->setBrush(QColor(0x0078D4));
painter->drawRoundedRect(barRect, 2, 2);
painter->restore();
}
void BCValueSliderStyle::paintSliderIndicator2(QPainter* painter, const QRect& rect, double ratio )
{
// Kleinen Slider-Indikator zeichnen
painter->save();
painter->setRenderHint(QPainter::Antialiasing);
qDebug() << " --- doPaint: in paintSliderIndicator: " <<rect;
painter->setBrush(Qt::green);
QRect barRect = rect.adjusted( 0, 5, 0, -5 );
painter->drawRoundedRect(barRect, 2, 2);
/*
// Mini Progress Bar: der Gesamtbereich
//QRect barRect = rect.adjusted( 0, 12, -10-24, -12 );
QRect barRect = rect;//.adjusted( 0, 12, 0, -12 );
painter->setPen(Qt::NoPen);
painter->setBrush(QColor(0xE0E0E0));
painter->drawRoundedRect(barRect, 2, 2);
// Mini Progress Bar: der Wertebereich
barRect.setWidth( ratio * barRect.width() );
painter->setBrush(QColor(0x0078D4));
painter->drawRoundedRect(barRect, 2, 2);
*/
painter->restore();
} }

View File

@@ -30,41 +30,22 @@
***************************************************************************/ ***************************************************************************/
#ifndef BCSLIDERSTYLE_H #ifndef BC_VALUESLIDERSTYLE_H
#define BCSLIDERSTYLE_H #define BC_VALUESLIDERSTYLE_H
#include <QStyledItemDelegate>
#include <QApplication>
#include <QWidget>
#include <QTableView> #include <QTableView>
#include <QStandardItemModel>
#include <QVBoxLayout>
#include <QHeaderView>
#include <QSlider> #include <QSlider>
#include <QPainter> #include <QPainter>
#include <QApplication>
#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QSlider>
#include <QCheckBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QProxyStyle> #include <QProxyStyle>
#include <QPainter>
#include <QStyleOptionSlider>
#include <QGraphicsDropShadowEffect>
// Fluent Design Slider Style // Fluent Design Slider Style
class BCSliderStyle : public QProxyStyle class BCValueSliderStyle : public QProxyStyle
{ {
public: public:
BCSliderStyle(); BCValueSliderStyle();
int pixelMetric(PixelMetric metric, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const override; int pixelMetric(PixelMetric metric, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const override;
@@ -73,12 +54,12 @@ public:
void drawHorizontalFluentSlider(QPainter* painter, void drawHorizontalFluentSlider(QPainter* painter,
const QStyleOptionSlider* slider, const QStyleOptionSlider* slider,
const QColor& activeColor, const QColor& activeColor,
const QColor& inactiveColor,
const QColor& bgColor) const; const QColor& bgColor) const;
static void paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio ); static void paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio );
static void paintSliderIndicator2(QPainter* painter, const QRect& rect, double ratio );
}; };
#endif // BCSLIDERSTYLE_H #endif // BC_VALUESLIDERSTYLE_H

View File

@@ -11,6 +11,7 @@
/* www.mhs-elektronik.de */ /* www.mhs-elektronik.de */
/* Autor : Demlehner Klaus, info@mhs-elektronik.de */ /* Autor : Demlehner Klaus, info@mhs-elektronik.de */
/*******************************************************************************/ /*******************************************************************************/
#include "mhs_can_drv.c" #include "mhs_can_drv.c"