diff --git a/bcdelegate.h b/bcdelegate.h index c4bd2f3..2646000 100644 --- a/bcdelegate.h +++ b/bcdelegate.h @@ -68,10 +68,10 @@ public: { _opacity = opacity; //qDebug() << " --- opa: " << opacity; + // __fix! unsinn! emit viewUpdateNeeded(); } - void clearAllHighlights(); public slots: diff --git a/bcdevicepanel.cpp b/bcdevicepanel.cpp index 63a15d2..9e35a73 100644 --- a/bcdevicepanel.cpp +++ b/bcdevicepanel.cpp @@ -30,14 +30,17 @@ ***************************************************************************/ -#include <_mingw_mac.h> #include +#include BCDevicePanel::BCDevicePanel(QWidget *parent) : QWidget(parent) { setupUi(this); _valueView->setModel( &_valueModel ); + //_valueView->resizeColumnsToContents(); + _valueView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); + _valueView->setItemDelegate( new BCDelegate( _valueView) ); } @@ -56,6 +59,7 @@ void BCDevicePanel::setDeviceID( BCDevice::ID deviceID ) { _devideID = deviceID; } + BCDevice::ID BCDevicePanel::getDeviceID() const { return _devideID; @@ -64,24 +68,7 @@ BCDevice::ID BCDevicePanel::getDeviceID() const QTableView* BCDevicePanel::getValueView() { - //valueModel; return _valueView; - - // Die Daten und auch die Datenmodelle für die Views werden - // vom DataManager verwaltet und an die Views weitergereicht. - - //auto model = _dataManager.getModel( BCDevice::ID::Console ); - //_consolePanel->getValueView()->setModel( model.v ); - - /* - if( model) - { - _valueView->setModel( *model ); - _valueView->resizeColumnsToContents(); - //_valueView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents); - } - */ - } const BCValueList& BCDevicePanel::getValueListX() @@ -104,10 +91,3 @@ void BCDevicePanel::onValueListReady( BCDevice::ID deviceID, BCValueList valueLi -/* -QTableView* BCDevicePanel::setValueView() -{ - return _valueView; -} -*/ - diff --git a/bcdevicepanel.ui b/bcdevicepanel.ui index cbbaa16..3e1baca 100644 --- a/bcdevicepanel.ui +++ b/bcdevicepanel.ui @@ -13,6 +13,9 @@ Form + + background-color:green; + Fitze! @@ -32,6 +35,12 @@ + + false + + + background-color:#0000ff + QFrame::Shape::NoFrame @@ -53,9 +62,15 @@ false + + Qt::PenStyle::NoPen + true + + true + diff --git a/bcmainwindow.cpp b/bcmainwindow.cpp index 0379519..759c12b 100644 --- a/bcmainwindow.cpp +++ b/bcmainwindow.cpp @@ -137,11 +137,8 @@ void BCMainWindow::initMainWindow() //_delegate->onHighlightRow(2); // 2 Sekunden Fade BCTransmitter* transmitter = _dataManager.getTransmitter(); - // besser: model::emit dataChanged - // also: emit dataChanged(index, index, {Qt::DisplayRole, Qt::EditRole, ValueRole}); - connect( &_dataManager, &BCMainWindow::valueTouched, _delegate, &BCDelegate::onHighlightRow ); - connect( _connectButton, &QPushButton::clicked, transmitter, &BCTransmitter::onToggleConnectionState ); - connect( _syncButton, &QPushButton::clicked, &_dataManager, &BCMainWindow::onSyncFromDevice ); + + */ //_delegate->onHighlightRow(2); // 2 Sekunden Fade @@ -150,6 +147,7 @@ void BCMainWindow::initMainWindow() //connect( &_dataManager, &BCMainWindow::valueTouched, _delegate, &BCDelegate::onHighlightRow ); connect( _connectButton, &QPushButton::clicked, &_transmitter, &BCTransmitter::onToggleConnectionState ); connect( _syncButton, &QPushButton::clicked, this, &BCMainWindow::onSyncFromDevice ); + connect( &_transmitter, &BCTransmitter::valueUpdated, this, &BCMainWindow::onValueUpdated ); // die Daten des eBikes laden @@ -241,7 +239,7 @@ void BCMainWindow::onRunnerMessage(const QString &msg) -// __fix move this to devicePanel +// __fix move this to devicePanel?? void BCMainWindow::onSyncFromDevice() { @@ -262,14 +260,11 @@ void BCMainWindow::onSyncFromDevice() //_transmitter.enqueueValueCommand( value ); emit sendValueCommand( BC::OpID::ReadValue, &value); - emit valueTouched( value.indexRow ); bc::processEventsFor(500); - //QApplication::processEvents(); - // Thread schlafen lassen (Simulation einer blockierenden Operation) - //QThread::msleep(500); + } diff --git a/bcmainwindow.ui b/bcmainwindow.ui index a6cb7ad..eedd493 100644 --- a/bcmainwindow.ui +++ b/bcmainwindow.ui @@ -138,8 +138,14 @@ 0 + + background-color: hotpink; + + + 0 + - 2 + 0