Playing with colors.

This commit is contained in:
2025-12-21 23:20:22 +01:00
parent c88c57ad32
commit 42525014f2
18 changed files with 125 additions and 49 deletions

View File

@@ -84,37 +84,8 @@ bool setApplicationStyleSheet( QAnyStringView path )
// 2. Datei öffnen und lesen
int main(int argc, char *argv[])
{
auto x = BC::ID::Motor_Status_Main;
enum class Color : uint8_t { Red, Green, Blue };
QMap<Color, QString> map;
map.insert(Color::Red, QStringLiteral("rot"));
map[Color::Green] = QStringLiteral("grün");
qDebug() << " --- sach bloss das geht: " << x << " ui: " << uint8_t(x) << " : " << map[Color::Red];
QApplication app(argc, argv);
//setApplicationStyleSheet( ":/BionxControl.qss"_L1 );
QMetaEnum metaEnum = QMetaEnum::fromType<BC::ID>();
bool ok = false;
QString inputString = "x3";
BC::ID yyy{};
// keyToValue parst den String ("x1") und liefert den int-Wert
int intVal = metaEnum.keyToValue(inputString.toLatin1().constData(), &ok);
if (ok)
yyy = static_cast<BC::ID>(intVal);
auto xxx = BC::ID::Battery_Config_Force_Done;
//QString result = fullString.section("::", -1);
qDebug() << " schön: " << xxx << " -- " << uint8_t(xxx) << " : " << yyy;
qDebug() << " nice: " << metaEnum.enumName() << " : " <<metaEnum.name() << ": " << metaEnum.enclosingMetaObject()->className();
setApplicationStyleSheet( ":/bionxcontrol.qss"_L1 );
BCMainWindow w;
w.show();