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

File diff suppressed because one or more lines are too long

View File

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

View File

@@ -11,16 +11,14 @@
</ProjectConfiguration>
</ItemGroup>
<PropertyGroup Label="Globals">
<ProjectGuid>{4294DAEF-A666-3D4C-A433-ACE7FB2B0C2F}</ProjectGuid>
<ProjectGuid>{84C4D2DA-BE54-3C31-BEF9-6BCCDD5C3277}</ProjectGuid>
<RootNamespace>BionxControl</RootNamespace>
<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>
</PropertyGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
<PlatformToolset>v145</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<OutputDirectory>release\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
@@ -29,7 +27,7 @@
<PrimaryOutput>BionxControl</PrimaryOutput>
</PropertyGroup>
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
<PlatformToolset>v145</PlatformToolset>
<PlatformToolset>v143</PlatformToolset>
<OutputDirectory>debug\</OutputDirectory>
<ATLMinimizesCRunTimeLibraryUsage>false</ATLMinimizesCRunTimeLibraryUsage>
<CharacterSet>NotSet</CharacterSet>
@@ -40,11 +38,11 @@
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.props" />
<Import Project="$(QtMsBuild)\qt_defaults.props" Condition="Exists('$(QtMsBuild)\qt_defaults.props')" />
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<QtInstall>6.10.1_msvc2022_64</QtInstall>
<QtInstall>msvc2022x64Qt6</QtInstall>
<QtModules>core;gui;widgets;svg</QtModules>
</PropertyGroup>
<PropertyGroup Label="QtSettings" Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<QtInstall>6.10.1_msvc2022_64</QtInstall>
<QtInstall>msvc2022x64Qt6</QtInstall>
<QtModules>core;gui;widgets;svg</QtModules>
</PropertyGroup>
<Target Name="QtMsBuildNotFound" BeforeTargets="CustomBuild;ClCompile" Condition="!Exists('$(QtMsBuild)\qt.targets') OR !Exists('$(QtMsBuild)\Qt.props')">
@@ -73,7 +71,7 @@
</PropertyGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
<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>
<AssemblerListingLocation>release\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
@@ -85,8 +83,7 @@
<Optimization>MaxSpeed</Optimization>
<PreprocessorDefinitions>_WINDOWS;UNICODE;_UNICODE;WIN32;_ENABLE_EXTENDED_ALIGNED_STORAGE;WIN64;NDEBUG;QT_NO_DEBUG;%(PreprocessorDefinitions)</PreprocessorDefinitions>
<PreprocessToFile>false</PreprocessToFile>
<ProgramDataBaseFileName>
</ProgramDataBaseFileName>
<ProgramDataBaseFileName></ProgramDataBaseFileName>
<RuntimeLibrary>MultiThreadedDLL</RuntimeLibrary>
<SuppressStartupBanner>true</SuppressStartupBanner>
<TreatWChar_tAsBuiltInType>true</TreatWChar_tAsBuiltInType>
@@ -95,8 +92,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<AdditionalDependencies>$(QTDIR)\lib\Qt6EntryPoint.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>C:\Qt\6.10.1\msvc2022_64\lib\Qt6EntryPoint.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<EnableCOMDATFolding>true</EnableCOMDATFolding>
@@ -119,7 +115,7 @@
</ResourceCompile>
<QtMoc>
<CompilerFlavor>msvc</CompilerFlavor>
<Include>./$(Configuration)/moc_predefs.h</Include>
<Include>C:/projects/BionxControl/$(Configuration)/moc_predefs.h</Include>
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
<DynamicSource>output</DynamicSource>
<QtMocDir>$(Configuration)</QtMocDir>
@@ -141,7 +137,7 @@
</ItemDefinitionGroup>
<ItemDefinitionGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
<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>
<AssemblerListingLocation>debug\</AssemblerListingLocation>
<BrowseInformation>false</BrowseInformation>
@@ -161,8 +157,7 @@
<MultiProcessorCompilation>true</MultiProcessorCompilation>
</ClCompile>
<Link>
<AdditionalDependencies>$(QTDIR)\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalLibraryDirectories>%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>C:\Qt\6.10.1\msvc2022_64\lib\Qt6EntryPointd.lib;shell32.lib;%(AdditionalDependencies)</AdditionalDependencies>
<AdditionalOptions>"/MANIFESTDEPENDENCY:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' publicKeyToken='6595b64144ccf1df' language='*' processorArchitecture='*'" %(AdditionalOptions)</AdditionalOptions>
<DataExecutionPrevention>true</DataExecutionPrevention>
<GenerateDebugInformation>true</GenerateDebugInformation>
@@ -182,7 +177,7 @@
</ResourceCompile>
<QtMoc>
<CompilerFlavor>msvc</CompilerFlavor>
<Include>./$(Configuration)/moc_predefs.h</Include>
<Include>C:/projects/BionxControl/$(Configuration)/moc_predefs.h</Include>
<ExecutionDescription>Moc'ing %(Identity)...</ExecutionDescription>
<DynamicSource>output</DynamicSource>
<QtMocDir>$(Configuration)</QtMocDir>
@@ -210,19 +205,20 @@
<ClCompile Include="bcdriverstatewidget.cpp" />
<ClCompile Include="bcdrivertinycan.cpp" />
<ClCompile Include="bcmainwindow.cpp" />
<ClCompile Include="bcsliderstyle.cpp" />
<ClCompile Include="bcthemeswitchbutton.cpp" />
<ClCompile Include="bctoggleswitch.cpp" />
<ClCompile Include="bctransmitter.cpp" />
<ClCompile Include="bcvalue.cpp" />
<ClCompile Include="bcvaluedelegate.cpp" />
<ClCompile Include="bcvalueeditor.cpp" />
<ClCompile Include="bcvaluemodel.cpp" />
<ClCompile Include="bcvalueslider.cpp" />
<ClCompile Include="bcvaluesliderstyle.cpp" />
<ClCompile Include="bcxmlloader.cpp" />
<ClCompile Include="libwin\can_drv_win.c" />
<ClCompile Include="main.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="bcvaluesliderstyle.h" />
<QtMoc Include="bc.h" />
<QtMoc Include="bcdelightpmwidget.h" />
<QtMoc Include="bcdeviceview.h" />
@@ -230,35 +226,34 @@
<QtMoc Include="bcdriverstatewidget.h" />
<ClInclude Include="bcdrivertinycan.h" />
<QtMoc Include="bcmainwindow.h" />
<ClInclude Include="bcsliderstyle.h" />
<QtMoc Include="bcthemeswitchbutton.h" />
<QtMoc Include="bctoggleswitch.h" />
<QtMoc Include="bctransmitter.h" />
<QtMoc Include="bcvalue.h" />
<QtMoc Include="bcvaluedelegate.h" />
<QtMoc Include="bcvalueeditor.h" />
<QtMoc Include="bcvaluemodel.h" />
<QtMoc Include="bcvalueslider.h" />
<QtMoc Include="bcxmlloader.h" />
</ItemGroup>
<ItemGroup>
<CustomBuild Include="debug\moc_predefs.h.cbt">
<FileType>Document</FileType>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(QTDIR)\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>
<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 -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>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild>
<CustomBuild Include="release\moc_predefs.h.cbt">
<FileType>Document</FileType>
<AdditionalInputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(QTDIR)\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>
<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 -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>
<Outputs Condition="'$(Configuration)|$(Platform)'=='Release|x64'">$(IntDir)\moc_predefs.h;%(Outputs)</Outputs>
</CustomBuild>
</ItemGroup>
<ItemGroup>
<QtUic Include="bcmainwindow.ui" />
<QtUic Include="bcvalueeditor.ui" />
<QtUic Include="bcvalueslider.ui" />
</ItemGroup>
<ItemGroup>
<None Include="resources\bc_dark.qss" />

View File

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

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>
@@ -30,4 +62,4 @@ protected:
QList<QWidget*> _flyingWidgets;
};
#endif // BCDELIGHTPMWIDGET_H
#endif // BC_DELIGHTPMWIDGET_H

View File

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

View File

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

View File

@@ -30,8 +30,8 @@
***************************************************************************/
#ifndef BCDRIVERSTATEWIDGET_H
#define BCDRIVERSTATEWIDGET_H
#ifndef B_CDRIVERSTATEWIDGET_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
#define BCDRIVERTINYCAN_H
#ifndef BC_DRIVERTINYCAN_H
#define BC_DRIVERTINYCAN_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
#define BCMAINWINDOW_H
#ifndef BC_MAINWINDOW_H
#define BC_MAINWINDOW_H
#include <QMainWindow>
#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 )

View File

@@ -30,8 +30,8 @@
***************************************************************************/
#ifndef BCTHEMESWITCHBUTTON_H
#define BCTHEMESWITCHBUTTON_H
#ifndef BC_THEMESWITCHBUTTON_H
#define BC_THEMESWITCHBUTTON_H
#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"

View File

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

View File

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

View File

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

View File

@@ -44,8 +44,8 @@
#include <bcdeviceview.h>
#include <bcvaluedelegate.h>
#include <bcvalueeditor.h>
#include <bcvalueslider.h>
#include <bcvaluesliderstyle.h>
BCValueDelegate::BCValueDelegate(const BCValueList& valueList, BCDeviceView* 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 << '%';
auto* valueEditor = new BCValueEditor(parent);
auto* valueEditor = new BCValueSlider(parent);
valueEditor->setValueAndRange( params );
// Signal für sofortige Updates
connect(valueEditor, &BCValueEditor::valueChanged, this, [this, valueEditor]()
connect(valueEditor, &BCValueSlider::valueChanged, this, [this, valueEditor]()
{
// Commit data sofort bei Änderung
emit const_cast<BCValueDelegate*>(this)->commitData(valueEditor);
});
// 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;
// Commit data sofort bei Änderung
@@ -104,7 +104,7 @@ void BCValueDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, c
if( index.column() == 1)
{
// 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)
{
int value = slider->value();
@@ -131,13 +131,11 @@ void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& optio
const BCValue& bcValue = *(_valueList[ index.row()].get());
if( !bcValue.isReadOnly() )
{
// Wir zeichnen boolean Values an toggle switches
if( bcValue.valueType() == BCValue::ValueType::Bool )
paintButtonIndicator(painter, option, bcValue);
paintToggleSwitch(painter, option, bcValue);
else
{
BCValueEditor::paintSliderIndicator(painter, option.rect, bcValue.calcMinMaxRatio() );
}
paintSlider(painter, option.rect, bcValue.calcMinMaxRatio() );
}
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
{
@@ -178,11 +181,11 @@ void BCValueDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionVi
{
Q_UNUSED(index)
QRect sliderRect = BCValueEditor::updateEditorRect( option.rect );
QRect sliderRect = BCValueSlider::updateEditorRect( option.rect );
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%)
if (progress < 0.2) {
opacity = progress * 5.0; // 0->1 in 20%
} else {
}
else
{
opacity = 1.0 - ((progress - 0.2) / 0.8); // 1->0 in 80%
}
@@ -241,7 +246,7 @@ void BCValueDelegate::onHighlightRow(int row)
/**
* @brief Sopt alle gerade laufenden Animationen
* @brief Stopt alle gerade laufenden Animationen
*/
void BCValueDelegate::clearAllHighlights()
@@ -255,9 +260,8 @@ void BCValueDelegate::clearAllHighlights()
_rowOpacities.clear();
if (_view)
{
_view->viewport()->update();
}
}
@@ -272,9 +276,8 @@ void BCValueDelegate::updateRow(int row)
{
QModelIndex idx = _view->model()->index(row,1);
QRect rect = _view->visualRect(idx);
if (!rect.isEmpty()) {
if (!rect.isEmpty())
_view->viewport()->update(rect);
}
}
}

View File

@@ -30,8 +30,8 @@
***************************************************************************/
#ifndef BCVALUEDELEGATE_H
#define BCVALUEDELEGATE_H
#ifndef BC_VALUEDELEGATE_H
#define BC_VALUEDELEGATE_H
#include <QStyledItemDelegate>
@@ -69,9 +69,8 @@ protected:
void updateRow(int row);
void paintHighlightRow(QPainter* painter, const QStyleOptionViewItem& option, int row) const;
void paintSliderIndicator(QPainter* painter, const QRect &rect, double ratio) const;
void paintButtonIndicator(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const;
void paintToggleSwitch(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
// nichts über die Originaldaten wissen. Die
// 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
#define BCVALUEMODEL_H
#ifndef BC_VALUEMODEL_H
#define BC_VALUEMODEL_H
#include <QAbstractTableModel>
#include <bcvalue.h>
@@ -77,4 +77,4 @@ protected:
};
#endif // BCVALUEMODEL_H
#endif // BC_VALUEMODEL_H

View File

@@ -1,23 +1,54 @@
/***************************************************************************
#include <bcsliderstyle.h>
#include <bcvalueeditor.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
***************************************************************************/
BCValueEditor::BCValueEditor( QWidget *parent )
#include <QPushButton>
#include <bcvaluesliderstyle.h>
#include <bcvalueslider.h>
BCValueSlider::BCValueSlider( QWidget *parent )
: QWidget(parent)
{
setupUi(this);
// wir wollen ja modern sein
_slider->setStyle(new BCSliderStyle());
_slider->setStyle(new BCValueSliderStyle());
setAutoFillBackground(true);
QSizePolicy sp = _commitButton->sizePolicy();
sp.setRetainSizeWhenHidden(true); // <--- Das ist der magische Schalter
_commitButton->setSizePolicy(sp);
// Wenn Slider bewegt wird -> Signal nach außen senden
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();
}
void BCValueEditor::setValueAndRange( const BCValue::ValueRange& params )
void BCValueSlider::setValueAndRange( const BCValue::ValueRange& params )
{
_slider->setRange( params.min, params.max);
// Block Signals verhindern Endlosschleifen, falls das Model
@@ -52,43 +83,10 @@ void BCValueEditor::setValueAndRange( const BCValue::ValueRange& params )
}
/**
* @brief Zeichnet eine passiven Slider, um den möglichen Wertebereich des übergebenen BCValue anzuzeigen.
*/
void BCValueEditor::paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio )
QRect BCValueSlider::updateEditorRect( const QRect& rect)
{
// Kleinen Slider-Indikator zeichnen
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(
return rect.adjusted
(
rect.width() - cTextBlockOffset, // Von rechts: cTextBlockOffset (==130) px (Breite der Progress Bar)
0, // Oben: kein Offset
-cPaddingRight, // Rechts: 8px Padding

View File

@@ -1,31 +1,29 @@
#ifndef BCValueEditor_H
#define BCValueEditor_H
#ifndef BC_VALUESLIDER_H
#define BC_VALUESLIDER_H
#include <QWidget>
#include <bcvalue.h>
#include <ui_bcvalueeditor.h>
#include <ui_bcvalueslider.h>
class QSlider;
class QPushButton;
class BCValue;
class BCValueEditor : public QWidget, private Ui::BCValueEditor
class BCValueSlider : public QWidget, private Ui::BCValueSlider
{
Q_OBJECT
public:
explicit BCValueEditor(QWidget *parent = nullptr);
explicit BCValueSlider(QWidget *parent = nullptr);
int value() const;
void setValueAndRange( const BCValue::ValueRange& params );
// helper functions
static QRect updateEditorRect( const QRect& rect);
static void paintSliderIndicator(QPainter* painter, const QRect& rect, double ratio );
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"?>
<ui version="4.0">
<class>BCValueEditor</class>
<widget class="QWidget" name="BCValueEditor">
<class>BCValueSlider</class>
<widget class="QWidget" name="BCValueSlider">
<property name="geometry">
<rect>
<x>0</x>

View File

@@ -30,17 +30,17 @@
***************************************************************************/
#include <bcsliderstyle.h>
#include <bcvalueeditor.h>
#include <bcvaluesliderstyle.h>
#include <bcvalueslider.h>
BCSliderStyle::BCSliderStyle()
BCValueSliderStyle::BCValueSliderStyle()
: 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)
{
@@ -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 (const QStyleOptionSlider* slider = qstyleoption_cast<const QStyleOptionSlider*>(opt))
@@ -76,8 +76,6 @@ QRect BCSliderStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
if (sc == SC_SliderHandle)
{
// Handle Position korrekt berechnen
if (slider->orientation == Qt::Horizontal)
{
int range = slider->maximum - slider->minimum;
int pos = slider->sliderPosition - slider->minimum;
int pixelRange = rect.width() - handleSize;
@@ -87,24 +85,12 @@ QRect BCSliderStyle::subControlRect(ComplexControl cc, const QStyleOptionComplex
rect.center().y() - handleSize / 2,
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);
}
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)
{
@@ -113,12 +99,8 @@ void BCSliderStyle::drawComplexControl(ComplexControl control, const QStyleOptio
// Fluent Colors
QColor accentColor(0, 120, 212); // #0078D4
QColor inactiveColor(138, 136, 134); // #8A8886
QColor bgColor(255, 255, 255); // White background
//QColor disabledText = option.palette.color(QPalette::Disabled, QPalette::Text);
//painter->setBrush(disabledText);
//QColor bgColor = Qt::green;//option->palette.color(QPalette::Base);
drawHorizontalFluentSlider(painter, slider, accentColor, inactiveColor, bgColor);
drawHorizontalFluentSlider(painter, slider, accentColor, bgColor);
return;
}
}
@@ -126,67 +108,56 @@ void BCSliderStyle::drawComplexControl(ComplexControl control, const QStyleOptio
}
void BCSliderStyle::drawHorizontalFluentSlider(QPainter* painter, const QStyleOptionSlider* slider,
const QColor& activeColor, const QColor& inactiveColor,
void BCValueSliderStyle::drawHorizontalFluentSlider(QPainter* painter, const QStyleOptionSlider* slider,
const QColor& activeColor,
const QColor& bgColor) const
{
QRect groove = slider->rect;
QRect handle = subControlRect(CC_Slider, slider, SC_SliderHandle, nullptr);
qDebug() << " ---WTF: " << groove;
BCValueEditor::paintSliderIndicator(painter, groove, 0.5 );
/*
int grooveHeight = 4;
// 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);
*/
QRect handleRect = subControlRect(CC_Slider, slider, SC_SliderHandle, nullptr);
// Das 'subControlRect' für den SC_SliderHandle ist _nicht_ mittig
handleRect.setY( handleRect.y() + 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
int handleSize = 16;
QRect thumbRect(handle.center().x() - handleSize / 2,
handle.center().y() - handleSize / 2,
int handleSize = 14;
QRect thumbRect(handleRect.center().x() - handleSize / 2,
handleRect.center().y() - handleSize / 2,
handleSize, handleSize);
/*
// Hover effect - subtle glow
if (slider->state & State_MouseOver)
{
painter->setBrush(QColor(activeColor.red(), activeColor.green(),
activeColor.blue(), 30));
int glowSize = 18;
int glowSize = 16;
QRect glow(handle.center().x() - glowSize / 2,
handle.center().y() - glowSize / 2,
glowSize, glowSize);
painter->drawEllipse(glow);
}
*/
// Thumb
painter->setBrush(bgColor);
painter->setPen(QPen(activeColor, 2));
painter->drawEllipse(thumbRect);
/*
// Inner circle for pressed state
if (slider->state & State_Sunken) {
if (slider->state & State_Sunken)
{
int innerSize = 6;
QRect inner(handle.center().x() - innerSize / 2,
handle.center().y() - innerSize / 2,
@@ -195,5 +166,70 @@ void BCSliderStyle::drawHorizontalFluentSlider(QPainter* painter, const QStyleOp
painter->setBrush(activeColor);
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
#define BCSLIDERSTYLE_H
#ifndef BC_VALUESLIDERSTYLE_H
#define BC_VALUESLIDERSTYLE_H
#include <QStyledItemDelegate>
#include <QApplication>
#include <QWidget>
#include <QTableView>
#include <QStandardItemModel>
#include <QVBoxLayout>
#include <QHeaderView>
#include <QSlider>
#include <QPainter>
#include <QApplication>
#include <QWidget>
#include <QPushButton>
#include <QLineEdit>
#include <QSlider>
#include <QCheckBox>
#include <QVBoxLayout>
#include <QHBoxLayout>
#include <QLabel>
#include <QProxyStyle>
#include <QPainter>
#include <QStyleOptionSlider>
#include <QGraphicsDropShadowEffect>
// Fluent Design Slider Style
class BCSliderStyle : public QProxyStyle
class BCValueSliderStyle : public QProxyStyle
{
public:
BCSliderStyle();
BCValueSliderStyle();
int pixelMetric(PixelMetric metric, const QStyleOption* option = nullptr, const QWidget* widget = nullptr) const override;
@@ -73,12 +54,12 @@ public:
void drawHorizontalFluentSlider(QPainter* painter,
const QStyleOptionSlider* slider,
const QColor& activeColor,
const QColor& inactiveColor,
const QColor& bgColor) const;
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 */
/* Autor : Demlehner Klaus, info@mhs-elektronik.de */
/*******************************************************************************/
#include "mhs_can_drv.c"