Fixed dummy progress bar.

This commit is contained in:
2026-01-06 16:21:59 +01:00
parent 1a2d815634
commit a57b45e21a
4 changed files with 53 additions and 37 deletions

View File

@@ -230,14 +230,19 @@ void BCAnimatedDelegate::paintSliderIndicator(QPainter* painter, const QStyleOpt
{ {
const BCValue& valueX = *(_valueList[ index.row()].get()); const BCValue& valueX = *(_valueList[ index.row()].get());
int value = index.model()->data(index, Qt::DisplayRole).toInt(); int value = 50;index.model()->data(index, Qt::DisplayRole).toInt();
// Hintergrund // Hintergrund
if (option.state & QStyle::State_Selected) { if (option.state & QStyle::State_Selected)
{
painter->fillRect(option.rect, option.palette.highlight()); painter->fillRect(option.rect, option.palette.highlight());
} else if (index.row() % 2 == 1) { }
else if (index.row() % 2 == 1)
{
painter->fillRect(option.rect, QColor(0xFAFAFA)); painter->fillRect(option.rect, QColor(0xFAFAFA));
} else { }
else
{
painter->fillRect(option.rect, Qt::white); painter->fillRect(option.rect, Qt::white);
} }
@@ -245,17 +250,21 @@ void BCAnimatedDelegate::paintSliderIndicator(QPainter* painter, const QStyleOpt
painter->save(); painter->save();
painter->setRenderHint(QPainter::Antialiasing); painter->setRenderHint(QPainter::Antialiasing);
QRect textRect = option.rect.adjusted(8, 0, -120, 0); //QRect textRect = option.rect.adjusted(8, 0, -120, 0);
QRect barRect = option.rect.adjusted(option.rect.width() - 115,
QRect barRect = option.rect.adjusted
(
8,
option.rect.height() / 2 - 2, option.rect.height() / 2 - 2,
-8, -8,
-option.rect.height() / 2 + 2); -option.rect.height() / 2 + 2
);
//QRect barRect = option.rect;
// Text // Text
painter->setPen(option.state & QStyle::State_Selected ? //painter->setPen(option.state & QStyle::State_Selected ? option.palette.highlightedText().color() : Qt::black);
option.palette.highlightedText().color() : Qt::black); //painter->drawText(textRect, Qt::AlignVCenter | Qt::AlignLeft,
painter->drawText(textRect, Qt::AlignVCenter | Qt::AlignLeft, // QString::number(value));
QString::number(value));
// Mini Progress Bar // Mini Progress Bar
painter->setPen(Qt::NoPen); painter->setPen(Qt::NoPen);

View File

@@ -157,9 +157,15 @@ void BCMainWindow::initMainWindow()
// die Daten des eBikes laden // die Daten des eBikes laden
_dataManager.loadXmlBikeData(":/bikeinfo.xml"_L1); _dataManager.loadXmlBikeData(":/bikeinfo.xml"_L1);
//_consoleAction->trigger(); _consoleAction->trigger();
_batteryAction->trigger(); //_batteryAction->trigger();
// Dummy sync beim starten
QTimer::singleShot(1000, this, [this]()
{
onSyncDeviceView();
});
} }
/* /*
@@ -199,7 +205,7 @@ void BCMainWindow::initStatusBar()
statBar->showMessage("Ready"); statBar->showMessage("Ready");
setApplicationStyleSheet(":bionxcontrol.qss"_L1); setApplicationStyleSheet(":bionxcontrol.qss"_L1);
//setApplicationStyleSheet(":alt.qss"_L1);
} }
/* /*

View File

@@ -183,7 +183,7 @@ void BCTransmitter::onUpdateValue( BCValuePtrConst valuePtr)
// __fix // __fix
//bc::processEventsFor(150); //bc::processEventsFor(150);
bc::delay_millis(150); bc::delay_millis(50);
} }

View File

@@ -191,7 +191,8 @@ Das Model Gibt hier, unabhängig von der DataRole, immer das
Qt::ItemFlags BCValueModel::flags(const QModelIndex& index) const Qt::ItemFlags BCValueModel::flags(const QModelIndex& index) const
{ {
if (!index.isValid()) // die label spalte lässt sich nicht editieren
if (!index.isValid() || index.column() == 0 )
return Qt::NoItemFlags; return Qt::NoItemFlags;
return QAbstractTableModel::flags(index) | Qt::ItemIsEditable; return QAbstractTableModel::flags(index) | Qt::ItemIsEditable;