Reworking value editro, part I
This commit is contained in:
@@ -59,7 +59,6 @@ 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 \
|
||||||
@@ -82,12 +81,11 @@ 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
|
bcvalueeditor.ui
|
||||||
|
|
||||||
# Default rules for deployment.
|
# Default rules for deployment.
|
||||||
qnx: target.path = /tmp/$${TARGET}/bin
|
qnx: target.path = /tmp/$${TARGET}/bin
|
||||||
|
|||||||
@@ -92,6 +92,7 @@ void BCDeviceView::onValueListReady( BCDevice::ID deviceID, BCValueList valueLis
|
|||||||
if(_devideID == deviceID)
|
if(_devideID == deviceID)
|
||||||
{
|
{
|
||||||
_valueModel.takeValueList( valueList );
|
_valueModel.takeValueList( valueList );
|
||||||
|
/*
|
||||||
const BCValueList& list = _valueModel.getValueList();
|
const BCValueList& list = _valueModel.getValueList();
|
||||||
int rows = _valueModel.rowCount();
|
int rows = _valueModel.rowCount();
|
||||||
for (int r = 0; r < rows; ++r)
|
for (int r = 0; r < rows; ++r)
|
||||||
@@ -103,6 +104,7 @@ void BCDeviceView::onValueListReady( BCDevice::ID deviceID, BCValueList valueLis
|
|||||||
openPersistentEditor(index);
|
openPersistentEditor(index);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
*/
|
||||||
} // if id
|
} // if id
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -255,7 +255,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::EditTrigger::AnyKeyPressed|QAbstractItemView::EditTrigger::DoubleClicked|QAbstractItemView::EditTrigger::EditKeyPressed|QAbstractItemView::EditTrigger::SelectedClicked</set>
|
<set>QAbstractItemView::EditTrigger::DoubleClicked</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="showGrid">
|
<property name="showGrid">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@@ -287,7 +287,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::EditTrigger::AnyKeyPressed|QAbstractItemView::EditTrigger::DoubleClicked|QAbstractItemView::EditTrigger::EditKeyPressed|QAbstractItemView::EditTrigger::SelectedClicked</set>
|
<set>QAbstractItemView::EditTrigger::DoubleClicked</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="showGrid">
|
<property name="showGrid">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
@@ -319,7 +319,7 @@
|
|||||||
<number>0</number>
|
<number>0</number>
|
||||||
</property>
|
</property>
|
||||||
<property name="editTriggers">
|
<property name="editTriggers">
|
||||||
<set>QAbstractItemView::EditTrigger::AnyKeyPressed|QAbstractItemView::EditTrigger::DoubleClicked|QAbstractItemView::EditTrigger::EditKeyPressed|QAbstractItemView::EditTrigger::SelectedClicked</set>
|
<set>QAbstractItemView::EditTrigger::DoubleClicked</set>
|
||||||
</property>
|
</property>
|
||||||
<property name="showGrid">
|
<property name="showGrid">
|
||||||
<bool>false</bool>
|
<bool>false</bool>
|
||||||
|
|||||||
@@ -45,7 +45,7 @@
|
|||||||
|
|
||||||
#include <bcvaluedelegate.h>
|
#include <bcvaluedelegate.h>
|
||||||
|
|
||||||
#include <bcvaluewidget.h>
|
#include <bcvalueeditor.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}
|
||||||
@@ -64,11 +64,12 @@ QWidget* BCValueDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
|
|||||||
Q_UNUSED(option)
|
Q_UNUSED(option)
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
|
|
||||||
auto* valueEditor = new BCValueWidget(bcValue, parent);
|
auto* valueEditor = new BCValueEditor(bcValue, parent);
|
||||||
|
|
||||||
// Signal für sofortige Updates
|
// Signal für sofortige Updates
|
||||||
connect(valueEditor, &BCValueWidget::valueChanged, this, [this, valueEditor]()
|
connect(valueEditor, &BCValueEditor::valueChanged, this, [this, valueEditor](int newValue)
|
||||||
{
|
{
|
||||||
|
qDebug() << "---val changed: " << newValue;
|
||||||
// Commit data sofort bei Änderung
|
// Commit data sofort bei Änderung
|
||||||
emit const_cast<BCValueDelegate*>(this)->commitData(valueEditor);
|
emit const_cast<BCValueDelegate*>(this)->commitData(valueEditor);
|
||||||
});
|
});
|
||||||
@@ -78,6 +79,7 @@ QWidget* BCValueDelegate::createEditor(QWidget *parent, const QStyleOptionViewIt
|
|||||||
|
|
||||||
void BCValueDelegate::setEditorData(QWidget *editor, const QModelIndex& index) const
|
void BCValueDelegate::setEditorData(QWidget *editor, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
|
qDebug() << " setEditorData, warum?";
|
||||||
/*
|
/*
|
||||||
// Daten vom Model in den Editor laden
|
// Daten vom Model in den Editor laden
|
||||||
const BCValue& bc = *index.data(Qt::EditRole).value<BCValue*>();
|
const BCValue& bc = *index.data(Qt::EditRole).value<BCValue*>();
|
||||||
@@ -97,33 +99,33 @@ void BCValueDelegate::setEditorData(QWidget *editor, const QModelIndex& index) c
|
|||||||
QStyledItemDelegate::setEditorData(editor, index);
|
QStyledItemDelegate::setEditorData(editor, index);
|
||||||
}
|
}
|
||||||
*/
|
*/
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCValueDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex& index) const
|
void BCValueDelegate::setModelData(QWidget *editor, QAbstractItemModel *model, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
|
qDebug() << " hier 2!";
|
||||||
|
if( index.column() == 1)
|
||||||
|
{
|
||||||
// Daten vom Editor zurück ins Model speichern (Beim Schließen)
|
// Daten vom Editor zurück ins Model speichern (Beim Schließen)
|
||||||
QSlider *slider = editor->findChild<QSlider*>("slider");
|
BCValueEditor* slider = qobject_cast<BCValueEditor*>(editor);
|
||||||
if (slider)
|
if (slider)
|
||||||
{
|
{
|
||||||
int value = slider->value();
|
qDebug() << " --- ok";
|
||||||
|
int value = slider->getValue();
|
||||||
model->setData(index, value, Qt::EditRole);
|
model->setData(index, value, Qt::EditRole);
|
||||||
}
|
}
|
||||||
else
|
return;
|
||||||
{
|
|
||||||
QStyledItemDelegate::setModelData(editor, model, index);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
QStyledItemDelegate::setModelData(editor, model, index);
|
||||||
}
|
}
|
||||||
|
|
||||||
void BCValueDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex& index) const
|
void BCValueDelegate::updateEditorGeometry(QWidget *editor, const QStyleOptionViewItem &option, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
|
|
||||||
Q_UNUSED(index)
|
Q_UNUSED(index)
|
||||||
/*
|
|
||||||
QRect barRect = option.rect.adjusted(option.rect.width() - 55,
|
|
||||||
option.rect.height() / 2 - 2,
|
|
||||||
-8,
|
|
||||||
-option.rect.height() / 2 + 2);
|
|
||||||
*/
|
|
||||||
QRect sliderRect = option.rect.adjusted(
|
QRect sliderRect = option.rect.adjusted(
|
||||||
option.rect.width() - 125, // Von rechts: 115px (Breite der Progress Bar)
|
option.rect.width() - 125, // Von rechts: 115px (Breite der Progress Bar)
|
||||||
0, // Oben: kein Offset
|
0, // Oben: kein Offset
|
||||||
@@ -150,6 +152,7 @@ QSize BCValueDelegate::sizeHint(const QStyleOptionViewItem &option, const QModel
|
|||||||
|
|
||||||
void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
void BCValueDelegate::paint(QPainter *painter, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
|
qDebug() << " ---paint:" << index.row();
|
||||||
|
|
||||||
// Standard-Zeichnen (Text, Hintergrund, Selection) durchführen
|
// Standard-Zeichnen (Text, Hintergrund, Selection) durchführen
|
||||||
QStyledItemDelegate::paint(painter, option, index);
|
QStyledItemDelegate::paint(painter, option, index);
|
||||||
@@ -158,14 +161,12 @@ 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());
|
||||||
@@ -182,8 +183,9 @@ void BCValueDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionVie
|
|||||||
painter->setRenderHint(QPainter::Antialiasing);
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
qreal opacity =_rowOpacities.value(row);
|
qreal opacity =_rowOpacities.value(row);
|
||||||
painter->setOpacity(opacity);
|
painter->setOpacity(opacity);
|
||||||
// Margin von 4px
|
// Margin von 2px
|
||||||
QRect itemRect = option.rect.adjusted(3, 3, -3, -3);
|
const int m = 3;
|
||||||
|
QRect itemRect = option.rect.adjusted(m,m,-m,-m);
|
||||||
|
|
||||||
// Border (2px solid #2196F3)
|
// Border (2px solid #2196F3)
|
||||||
// oranger rahmen
|
// oranger rahmen
|
||||||
@@ -205,23 +207,13 @@ void BCValueDelegate::paintHighlightRow(QPainter* painter, const QStyleOptionVie
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* @brief Zeichnet eine passiven Slider, um den Wertebereich des übergebenen BCValue anzuzeigen.
|
* @brief Zeichnet eine passiven Slider, um den Wertebereich des übergebenen BCValue anzuzeigen.
|
||||||
* @param painter
|
|
||||||
* @param option
|
|
||||||
* @param bcValue
|
|
||||||
*/
|
*/
|
||||||
|
|
||||||
void BCValueDelegate::paintSliderIndicator(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const
|
void BCValueDelegate::paintSliderIndicator(QPainter* painter, const QStyleOptionViewItem& option, const BCValue& bcValue) const
|
||||||
{
|
{
|
||||||
|
|
||||||
// Text und kleiner Slider-Indikator zeichnen
|
// Text und kleiner Slider-Indikator zeichnen
|
||||||
painter->save();
|
painter->save();
|
||||||
|
|
||||||
painter->setRenderHint(QPainter::Antialiasing);
|
painter->setRenderHint(QPainter::Antialiasing);
|
||||||
/*
|
|
||||||
QRect barRect = option.rect.adjusted(option.rect.width() - 130,
|
|
||||||
option.rect.height() / 2 - 2,
|
|
||||||
-8,
|
|
||||||
-option.rect.height() / 2 + 2);
|
|
||||||
*/
|
|
||||||
|
|
||||||
QRect barRect = option.rect.adjusted(option.rect.width() - 130,
|
QRect barRect = option.rect.adjusted(option.rect.width() - 130,
|
||||||
option.rect.height() / 2 + 1,
|
option.rect.height() / 2 + 1,
|
||||||
|
|||||||
@@ -1,19 +1,21 @@
|
|||||||
|
|
||||||
//#include <QApplication>
|
|
||||||
#include <QVBoxLayout>
|
|
||||||
//#include <QStyledItemDelegate>
|
|
||||||
#include <QSlider>
|
|
||||||
#include <QPushButton>
|
|
||||||
|
|
||||||
#include <bcvalueeditor.h>
|
|
||||||
#include <bcsliderstyle.h>
|
#include <bcsliderstyle.h>
|
||||||
|
#include <bcvalueeditor.h>
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BCValueEditor::BCValueEditor(const BCValue& bcValue, QWidget *parent )
|
BCValueEditor::BCValueEditor(const BCValue& bcValue, QWidget *parent )
|
||||||
: QWidget(parent), _bcValue{bcValue}
|
: QWidget(parent), _bcValue{bcValue}
|
||||||
{
|
{
|
||||||
|
setupUi(this);
|
||||||
|
|
||||||
|
_slider->setStyle(new BCSliderStyle());
|
||||||
setAutoFillBackground(true);
|
setAutoFillBackground(true);
|
||||||
|
QSizePolicy sp = _commitButton->sizePolicy();
|
||||||
|
sp.setRetainSizeWhenHidden(true); // <--- Das ist der magische Schalter
|
||||||
|
_commitButton->setSizePolicy(sp);
|
||||||
|
|
||||||
|
/*
|
||||||
_slider = new QSlider(Qt::Horizontal, this);
|
_slider = new QSlider(Qt::Horizontal, this);
|
||||||
_slider->setRange(0, 100);
|
_slider->setRange(0, 100);
|
||||||
_slider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
_slider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
||||||
@@ -34,7 +36,7 @@ BCValueEditor::BCValueEditor(const BCValue& bcValue, QWidget *parent )
|
|||||||
layout->addWidget(_slider);
|
layout->addWidget(_slider);
|
||||||
layout->addWidget(_commitButton);
|
layout->addWidget(_commitButton);
|
||||||
setLayout(layout);
|
setLayout(layout);
|
||||||
|
*/
|
||||||
// Wenn Slider bewegt wird -> Signal nach außen senden
|
// Wenn Slider bewegt wird -> Signal nach außen senden
|
||||||
connect(_slider, &QSlider::valueChanged, this, [this](int val)
|
connect(_slider, &QSlider::valueChanged, this, [this](int val)
|
||||||
{
|
{
|
||||||
@@ -42,13 +44,16 @@ BCValueEditor::BCValueEditor(const BCValue& bcValue, QWidget *parent )
|
|||||||
});
|
});
|
||||||
|
|
||||||
// Wenn Reset gedrückt wird -> Slider auf 0 (löst auch valueChanged aus)
|
// Wenn Reset gedrückt wird -> Slider auf 0 (löst auch valueChanged aus)
|
||||||
connect(_commitButton, &QPushButton::clicked, this, [this](){
|
connect(_commitButton, &QPushButton::clicked, this, [this]()
|
||||||
|
{
|
||||||
_slider->setValue(0);
|
_slider->setValue(0);
|
||||||
});
|
});
|
||||||
|
//_commitButton->setVisible( false);
|
||||||
}
|
}
|
||||||
|
|
||||||
int BCValueEditor::getValue() const
|
int BCValueEditor::getValue() const
|
||||||
{
|
{
|
||||||
|
qDebug() << " -- jajaja: "<< size();
|
||||||
return _slider->value();
|
return _slider->value();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,13 +1,15 @@
|
|||||||
#ifndef BCVALUEEDITOR_H
|
#ifndef BCValueEditor_H
|
||||||
#define BCVALUEEDITOR_H
|
#define BCValueEditor_H
|
||||||
|
|
||||||
|
|
||||||
#include <QWidget>
|
#include <QWidget>
|
||||||
|
#include <ui_bcvalueeditor.h>
|
||||||
|
|
||||||
class QSlider;
|
class QSlider;
|
||||||
class QPushButton;
|
class QPushButton;
|
||||||
class BCValue;
|
class BCValue;
|
||||||
|
|
||||||
class BCValueEditor : public QWidget
|
class BCValueEditor : public QWidget, private Ui::BCValueEditor
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -25,9 +27,6 @@ signals:
|
|||||||
private:
|
private:
|
||||||
|
|
||||||
const BCValue& _bcValue;
|
const BCValue& _bcValue;
|
||||||
QSlider* _slider;
|
|
||||||
QPushButton* _commitButton;
|
|
||||||
|
|
||||||
};
|
};
|
||||||
|
#endif // BCValueEditor_H
|
||||||
#endif // BCVALUEEDITOR_H
|
|
||||||
|
|||||||
@@ -1,7 +1,7 @@
|
|||||||
<?xml version="1.0" encoding="UTF-8"?>
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
<ui version="4.0">
|
<ui version="4.0">
|
||||||
<class>BCValueWidget</class>
|
<class>BCValueEditor</class>
|
||||||
<widget class="QWidget" name="BCValueWidget">
|
<widget class="QWidget" name="BCValueEditor">
|
||||||
<property name="geometry">
|
<property name="geometry">
|
||||||
<rect>
|
<rect>
|
||||||
<x>0</x>
|
<x>0</x>
|
||||||
@@ -181,7 +181,6 @@ Qt::ItemFlags BCValueModel::flags(const QModelIndex& index) const
|
|||||||
|
|
||||||
bool BCValueModel::setData(const QModelIndex& index, const QVariant& variant, int role)
|
bool BCValueModel::setData(const QModelIndex& index, const QVariant& variant, int role)
|
||||||
{
|
{
|
||||||
|
|
||||||
if (index.isValid() && role == Qt::EditRole)
|
if (index.isValid() && role == Qt::EditRole)
|
||||||
{
|
{
|
||||||
BCValuePtr value = _valueList[index.row()];
|
BCValuePtr value = _valueList[index.row()];
|
||||||
|
|||||||
@@ -1,67 +0,0 @@
|
|||||||
|
|
||||||
#include <bcsliderstyle.h>
|
|
||||||
#include <bcvaluewidget.h>
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
BCValueWidget::BCValueWidget(const BCValue& bcValue, QWidget *parent )
|
|
||||||
: QWidget(parent), _bcValue{bcValue}
|
|
||||||
{
|
|
||||||
setupUi(this);
|
|
||||||
|
|
||||||
_slider->setStyle(new BCSliderStyle());
|
|
||||||
setAutoFillBackground(true);
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
|
||||||
_slider = new QSlider(Qt::Horizontal, this);
|
|
||||||
_slider->setRange(0, 100);
|
|
||||||
_slider->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Preferred);
|
|
||||||
|
|
||||||
_slider->setSingleStep(1);
|
|
||||||
_slider->setPageStep(10);
|
|
||||||
_slider->setStyle(new BCSliderStyle());
|
|
||||||
|
|
||||||
_commitButton = new QPushButton(this);
|
|
||||||
_commitButton->setIcon(style()->standardIcon(QStyle::SP_DialogResetButton));
|
|
||||||
_commitButton->setFixedSize(32, 32);
|
|
||||||
|
|
||||||
auto *layout = new QHBoxLayout(this);
|
|
||||||
// Deine gewünschten Margins für 36px Zeilenhöhe
|
|
||||||
layout->setContentsMargins(2, 2, 2, 2);
|
|
||||||
layout->setSpacing(4);
|
|
||||||
|
|
||||||
layout->addWidget(_slider);
|
|
||||||
layout->addWidget(_commitButton);
|
|
||||||
setLayout(layout);
|
|
||||||
*/
|
|
||||||
// Wenn Slider bewegt wird -> Signal nach außen senden
|
|
||||||
connect(_slider, &QSlider::valueChanged, this, [this](int val)
|
|
||||||
{
|
|
||||||
emit valueChanged(val);
|
|
||||||
});
|
|
||||||
|
|
||||||
// Wenn Reset gedrückt wird -> Slider auf 0 (löst auch valueChanged aus)
|
|
||||||
connect(_commitButton, &QPushButton::clicked, this, [this](){
|
|
||||||
_slider->setValue(0);
|
|
||||||
});
|
|
||||||
_commitButton->setVisible( false);
|
|
||||||
}
|
|
||||||
|
|
||||||
int BCValueWidget::getValue() const
|
|
||||||
{
|
|
||||||
return _slider->value();
|
|
||||||
}
|
|
||||||
|
|
||||||
void BCValueWidget::setValue(int val)
|
|
||||||
{
|
|
||||||
// WICHTIG: Block Signals verhindern Endlosschleifen, falls das Model
|
|
||||||
// das Widget während des Updates neu setzt (passiert manchmal bei Live-Updates).
|
|
||||||
if (val != _slider->value())
|
|
||||||
{
|
|
||||||
bool blocked = _slider->blockSignals(true);
|
|
||||||
_slider->setValue(val);
|
|
||||||
_slider->blockSignals(blocked);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
@@ -1,32 +0,0 @@
|
|||||||
#ifndef BCVALUEWIDGET_H
|
|
||||||
#define BCVALUEWIDGET_H
|
|
||||||
|
|
||||||
|
|
||||||
#include <QWidget>
|
|
||||||
#include <ui_bcvaluewidget.h>
|
|
||||||
|
|
||||||
class QSlider;
|
|
||||||
class QPushButton;
|
|
||||||
class BCValue;
|
|
||||||
|
|
||||||
class BCValueWidget : public QWidget, private Ui::BCValueWidget
|
|
||||||
{
|
|
||||||
Q_OBJECT
|
|
||||||
|
|
||||||
public:
|
|
||||||
|
|
||||||
explicit BCValueWidget(const BCValue& bcValue, QWidget *parent = nullptr);
|
|
||||||
|
|
||||||
int getValue() const;
|
|
||||||
void setValue(int val);
|
|
||||||
|
|
||||||
signals:
|
|
||||||
|
|
||||||
void valueChanged(int value);
|
|
||||||
|
|
||||||
private:
|
|
||||||
|
|
||||||
const BCValue& _bcValue;
|
|
||||||
|
|
||||||
};
|
|
||||||
#endif // BCVALUEWIDGET_H
|
|
||||||
Reference in New Issue
Block a user