Rework itemdelegate, part I.
This commit is contained in:
@@ -30,6 +30,8 @@
|
||||
***************************************************************************/
|
||||
|
||||
|
||||
//#include <QToolButton>
|
||||
|
||||
#include "qassert.h"
|
||||
#include <bcmainwindow.h>
|
||||
#include <bcdelegate.h>
|
||||
@@ -38,7 +40,7 @@
|
||||
|
||||
/**
|
||||
* @brief Das Mainwindow erzeugen
|
||||
* @param parent
|
||||
* @param parent Das Elternwidget
|
||||
*/
|
||||
|
||||
BCMainWindow::BCMainWindow(QWidget *parent)
|
||||
@@ -54,30 +56,24 @@ BCMainWindow::BCMainWindow(QWidget *parent)
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Destruktor. Räumt den Workthread auf.
|
||||
*/
|
||||
|
||||
BCMainWindow::~BCMainWindow()
|
||||
{
|
||||
_worker.quit(); // Event Loop stoppen
|
||||
_worker.wait(); // Warten bis Thread wirklich fertig ist
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* @brief Initialisiert alle Komponenten des MainWindows.
|
||||
*/
|
||||
|
||||
void BCMainWindow::initMainWindow()
|
||||
{
|
||||
// Die Daten und auch die Datenmodelle für die Views werden
|
||||
// vom DataManager verwaltet und an die Views weitergereicht.
|
||||
|
||||
/*
|
||||
auto setDeviceModel = [&]( BCDevice::ID deviceID, BCDevicePanel* panel )
|
||||
{
|
||||
auto model = _dataManager.getModel( deviceID );
|
||||
if( model)
|
||||
{
|
||||
QAbstractItemView* valueView = panel->getValueView();
|
||||
valueView->setModel( *model );
|
||||
//valueView->resizeColumnsToContents();
|
||||
//_valueView->horizontalHeader()->setSectionResizeMode(QHeaderView::ResizeToContents);
|
||||
}
|
||||
};
|
||||
*/
|
||||
|
||||
auto configureAction = [&]( QToolButton* button, QAction* action, BCDevice::ID deviceID, const QString& panelTitle="" )
|
||||
{
|
||||
@@ -145,8 +141,8 @@ void BCMainWindow::initMainWindow()
|
||||
// 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, this, &BCMainWindow::onSyncFromDevice );
|
||||
connect( _connectButton, &QToolButton::clicked, &_transmitter, &BCTransmitter::onToggleConnectionState );
|
||||
connect( _syncButton, &QToolButton::clicked, this, &BCMainWindow::onSyncFromDevice );
|
||||
|
||||
connect( &_transmitter, &BCTransmitter::valueUpdated, this, &BCMainWindow::onValueUpdated );
|
||||
|
||||
|
||||
Reference in New Issue
Block a user