Chanded to permanent editors.

This commit is contained in:
2026-01-11 01:12:28 +01:00
parent 7780657d82
commit d3c62335b1
7 changed files with 32 additions and 8 deletions

View File

@@ -59,6 +59,7 @@ SOURCES += \
bcvaluedelegate.cpp \ bcvaluedelegate.cpp \
bcvalueeditor.cpp \ bcvalueeditor.cpp \
bcvaluemodel.cpp \ bcvaluemodel.cpp \
bcvaluewidget.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 \
@@ -81,10 +82,12 @@ HEADERS += \
bcvaluedelegate.h \ bcvaluedelegate.h \
bcvalueeditor.h \ bcvalueeditor.h \
bcvaluemodel.h \ bcvaluemodel.h \
bcvaluewidget.h \
bcxmlloader.h bcxmlloader.h
FORMS += \ FORMS += \
bcmainwindow.ui bcmainwindow.ui \
bcvaluewidget.ui
# Default rules for deployment. # Default rules for deployment.
qnx: target.path = /tmp/$${TARGET}/bin qnx: target.path = /tmp/$${TARGET}/bin

View File

@@ -90,7 +90,21 @@ bool BCDeviceView::firstExpose()
void BCDeviceView::onValueListReady( BCDevice::ID deviceID, BCValueList valueList ) void BCDeviceView::onValueListReady( BCDevice::ID deviceID, BCValueList valueList )
{ {
if(_devideID == deviceID) if(_devideID == deviceID)
{
_valueModel.takeValueList( valueList ); _valueModel.takeValueList( valueList );
const BCValueList& list = _valueModel.getValueList();
int rows = _valueModel.rowCount();
for (int r = 0; r < rows; ++r)
{
BCValuePtr bcValue = list[r];
if( !bcValue->isReadOnly() )
{
QModelIndex index = _valueModel.index(r, 1);
openPersistentEditor(index);
}
}
} // if id
} }

View File

@@ -204,7 +204,7 @@ void BCMainWindow::initStatusBar()
_statusBar->showMessage("Bereit. (Dummy-Treiber eingestellt)"); _statusBar->showMessage("Bereit. (Dummy-Treiber eingestellt)");
setApplicationStyleSheet(cLightModeStyle); //setApplicationStyleSheet(cLightModeStyle);
} }

View File

@@ -44,7 +44,8 @@
#include <QPainter> #include <QPainter>
#include <bcvaluedelegate.h> #include <bcvaluedelegate.h>
#include <bcvalueeditor.h>
#include <bcvaluewidget.h>
BCValueDelegate::BCValueDelegate(const BCValueList& valueList, QTableView* view) BCValueDelegate::BCValueDelegate(const BCValueList& valueList, QTableView* view)
: QStyledItemDelegate{view}, _valueList{valueList}, _view{view} : QStyledItemDelegate{view}, _valueList{valueList}, _view{view}
@@ -58,13 +59,15 @@ QWidget* BCValueDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
{ {
const BCValue& bcValue = *(_valueList[ index.row()].get()); const BCValue& bcValue = *(_valueList[ index.row()].get());
qDebug() << " --- Create EDITOR: " << index.row();
Q_UNUSED(option) Q_UNUSED(option)
Q_UNUSED(index) Q_UNUSED(index)
auto* valueEditor = new BCValueEditor(bcValue, parent); auto* valueEditor = new BCValueWidget(bcValue, parent);
// Signal für sofortige Updates // Signal für sofortige Updates
connect(valueEditor, &BCValueEditor::valueChanged, this, [this, valueEditor]() connect(valueEditor, &BCValueWidget::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);
@@ -155,12 +158,14 @@ void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& optio
if( index.column() == 1 ) if( index.column() == 1 )
{ {
/*
if( row>-1 && row <= _valueList.size() ) if( row>-1 && row <= _valueList.size() )
{ {
const BCValue& bcValue = *(_valueList[ index.row()].get()); const BCValue& bcValue = *(_valueList[ index.row()].get());
if( !bcValue.isReadOnly()) if( !bcValue.isReadOnly())
paintSliderIndicator(painter,option,bcValue); paintSliderIndicator(painter,option,bcValue);
} }
*/
if(_rowOpacities.contains(row)) if(_rowOpacities.contains(row))
paintHighlightRow(painter,option,index.row()); paintHighlightRow(painter,option,index.row());

View File

@@ -29,5 +29,6 @@
<file>resources/smile/face-smile-big.png</file> <file>resources/smile/face-smile-big.png</file>
<file>resources/smile/face-smirk.png</file> <file>resources/smile/face-smirk.png</file>
<file>resources/smile/face-surprise.png</file> <file>resources/smile/face-surprise.png</file>
<file alias="update.png">resources/update.png</file>
</qresource> </qresource>
</RCC> </RCC>

1
resources/update.svg Normal file
View File

@@ -0,0 +1 @@
<svg width="24" height="24" fill="none" viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg"><path d="M6.747 4h3.464a.75.75 0 0 1 .102 1.493l-.102.007H6.747a2.25 2.25 0 0 0-2.245 2.096l-.005.154v9.5a2.25 2.25 0 0 0 2.096 2.245l.154.005h9.5a2.25 2.25 0 0 0 2.245-2.096l.005-.154v-.498a.75.75 0 0 1 1.494-.101l.006.101v.498a3.75 3.75 0 0 1-3.55 3.745l-.2.005h-9.5a3.75 3.75 0 0 1-3.745-3.55l-.005-.2v-9.5a3.75 3.75 0 0 1 3.55-3.745l.2-.005h3.464-3.464ZM14.5 6.544V3.75a.75.75 0 0 1 1.187-.61l.082.069 5.994 5.75c.28.268.306.7.077.997l-.077.085-5.994 5.752a.75.75 0 0 1-1.262-.434l-.007-.107V12.45l-.321-.006c-2.658-.008-4.93 1.083-6.865 3.301-.496.568-1.425.132-1.306-.612.827-5.14 3.6-8.045 8.19-8.559l.302-.03V3.75v2.794Z" fill="#888888"/></svg>

After

Width:  |  Height:  |  Size: 747 B