Mini Milestone: Driver loads and connects.

This commit is contained in:
2025-12-18 16:26:51 +01:00
parent b5ed3ff733
commit 2acf280c55
20 changed files with 5407 additions and 59 deletions

View File

@@ -8,15 +8,20 @@
#include "bcvalue.h"
BCValueDelegate::BCValueDelegate(QObject *parent) : QStyledItemDelegate(parent) {}
BCValueDelegate::BCValueDelegate(QObject *parent)
: QStyledItemDelegate(parent)
{
// --- TEIL 1: DIE NORMALE ANZEIGE ---
QString BCValueDelegate::displayText(const QVariant &value, const QLocale &locale) const
}
QString BCValueDelegate::displayText(const QVariant& dataValue, const QLocale& locale) const
{
// Wir prüfen, ob im Variant unser Struct steckt
if (value.canConvert<BCValue>()) {
BCValue bc = value.value<BCValue>();
if (dataValue.canConvert<BCValue>())
{
BCValue bc = dataValue.value<BCValue>();
//qDebug() << " --- YES: " << bc.label;
// Hier bauen wir den String zusammen, den man sieht,
// wenn KEIN Editor offen ist.
// Format: "Label: Wert Einheit"
@@ -24,10 +29,10 @@ QString BCValueDelegate::displayText(const QVariant &value, const QLocale &local
}
// Fallback für normale Strings/Zahlen
return QStyledItemDelegate::displayText(value, locale);
return QStyledItemDelegate::displayText(dataValue, locale);
}
// --- TEIL 2: DER EDITOR (SLIDER) ---
QWidget *BCValueDelegate::createEditor(QWidget *parent, const QStyleOptionViewItem &option, const QModelIndex &index) const
{
QVariant rawData = index.data(Qt::EditRole);