Added some more icons.
@@ -33,7 +33,11 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BCDataModel::BCDataModel(QObject *parent) : QAbstractListModel(parent) {}
|
BCDataModel::BCDataModel(QObject *parent)
|
||||||
|
: QAbstractTableModel(parent)
|
||||||
|
{
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
void BCDataModel::addValue(const BCDataValue& val)
|
void BCDataModel::addValue(const BCDataValue& val)
|
||||||
{
|
{
|
||||||
@@ -62,6 +66,28 @@ int BCDataModel::rowCount(const QModelIndex& parent) const
|
|||||||
return _valueList.size();
|
return _valueList.size();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
int BCDataModel::columnCount(const QModelIndex &parent) const
|
||||||
|
{
|
||||||
|
if (parent.isValid()) return 0;
|
||||||
|
return 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
QVariant BCDataModel::headerData(int section, Qt::Orientation orientation, int role) const
|
||||||
|
{
|
||||||
|
if (role != Qt::DisplayRole || orientation != Qt::Horizontal)
|
||||||
|
return QVariant();
|
||||||
|
|
||||||
|
switch (section)
|
||||||
|
{
|
||||||
|
case 0:
|
||||||
|
return QString("Bezeichnung");
|
||||||
|
case 1:
|
||||||
|
return QString("Wert");
|
||||||
|
default:
|
||||||
|
return QVariant();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
QVariant BCDataModel::data(const QModelIndex& index, int role) const
|
QVariant BCDataModel::data(const QModelIndex& index, int role) const
|
||||||
{
|
{
|
||||||
int row = index.row();
|
int row = index.row();
|
||||||
@@ -83,7 +109,7 @@ Qt::ItemFlags BCDataModel::flags(const QModelIndex& index) const
|
|||||||
if (!index.isValid())
|
if (!index.isValid())
|
||||||
return Qt::NoItemFlags;
|
return Qt::NoItemFlags;
|
||||||
|
|
||||||
return QAbstractListModel::flags(index) | Qt::ItemIsEditable;
|
return QAbstractTableModel::flags(index) | Qt::ItemIsEditable;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -36,7 +36,7 @@
|
|||||||
#include <bcdatavalue.h>
|
#include <bcdatavalue.h>
|
||||||
|
|
||||||
|
|
||||||
class BCDataModel : public QAbstractListModel
|
class BCDataModel : public QAbstractTableModel
|
||||||
{
|
{
|
||||||
Q_OBJECT
|
Q_OBJECT
|
||||||
|
|
||||||
@@ -48,8 +48,12 @@ public:
|
|||||||
void setValueList(const BCDataList& valueList);
|
void setValueList(const BCDataList& valueList);
|
||||||
BCDataList& getValueList();
|
BCDataList& getValueList();
|
||||||
|
|
||||||
int rowCount(const QModelIndex& parent = QModelIndex()) const override;
|
// Pure Virtual Functions von QAbstractTableModel
|
||||||
QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const override;
|
int rowCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
int columnCount(const QModelIndex &parent = QModelIndex()) const override;
|
||||||
|
|
||||||
|
QVariant headerData(int section, Qt::Orientation orientation, int role = Qt::DisplayRole) const override;
|
||||||
|
QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const override;
|
||||||
|
|
||||||
// Nötig für Editierbarkeit
|
// Nötig für Editierbarkeit
|
||||||
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
Qt::ItemFlags flags(const QModelIndex& index) const override;
|
||||||
|
|||||||
@@ -45,7 +45,7 @@ void BCDataValue::readRawValueX( const BCAbstractTransmitter& transmitter ) cons
|
|||||||
{
|
{
|
||||||
qDebug() << " --- READ X!";
|
qDebug() << " --- READ X!";
|
||||||
|
|
||||||
uint32_t devID = static_cast<uint32_t>(deviceID);
|
uint32_t devID = static_cast<uint32_t>(deviceID);
|
||||||
uint8_t regID = static_cast<uint8_t> (registerID);
|
uint8_t regID = static_cast<uint8_t> (registerID);
|
||||||
|
|
||||||
visibleValue = valueType->createStringValue( transmitter, devID, regID );
|
visibleValue = valueType->createStringValue( transmitter, devID, regID );
|
||||||
|
|||||||
@@ -5,7 +5,7 @@
|
|||||||
#include <QDebug>
|
#include <QDebug>
|
||||||
#include <QPainter>
|
#include <QPainter>
|
||||||
#include <QTimer>
|
#include <QTimer>
|
||||||
#include <QListView>
|
#include <QTableView>
|
||||||
|
|
||||||
#include <QVariantAnimation>
|
#include <QVariantAnimation>
|
||||||
#include <QPropertyAnimation>
|
#include <QPropertyAnimation>
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
|
|
||||||
|
|
||||||
BCItemDelegate::BCItemDelegate(QListView *view)
|
BCItemDelegate::BCItemDelegate(QTableView* view)
|
||||||
: QStyledItemDelegate(view), _view{view}
|
: QStyledItemDelegate(view), _view{view}
|
||||||
{
|
{
|
||||||
|
|
||||||
|
|||||||
@@ -1,4 +1,4 @@
|
|||||||
// BCItemDelegate.h
|
|
||||||
#ifndef BCITEMDELEGATE_H
|
#ifndef BCITEMDELEGATE_H
|
||||||
#define BCITEMDELEGATE_H
|
#define BCITEMDELEGATE_H
|
||||||
|
|
||||||
@@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
class QPropertyAnimation;
|
class QPropertyAnimation;
|
||||||
class QVariantAnimation;
|
class QVariantAnimation;
|
||||||
class QListView;
|
class QTableView;
|
||||||
|
|
||||||
class BCItemDelegate : public QStyledItemDelegate
|
class BCItemDelegate : public QStyledItemDelegate
|
||||||
{
|
{
|
||||||
@@ -15,7 +15,7 @@ class BCItemDelegate : public QStyledItemDelegate
|
|||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
explicit BCItemDelegate(QListView *view );
|
explicit BCItemDelegate(QTableView* view );
|
||||||
|
|
||||||
QString displayText(const QVariant& dataValue, const QLocale& locale) const override;
|
QString displayText(const QVariant& dataValue, const QLocale& locale) const override;
|
||||||
|
|
||||||
@@ -60,7 +60,7 @@ private:
|
|||||||
|
|
||||||
int _highlightedRow{-1};
|
int _highlightedRow{-1};
|
||||||
qreal _opacity{1.0};
|
qreal _opacity{1.0};
|
||||||
QListView* _view{};
|
QTableView* _view{};
|
||||||
QPropertyAnimation *_animation{};
|
QPropertyAnimation *_animation{};
|
||||||
|
|
||||||
private:
|
private:
|
||||||
|
|||||||
@@ -92,7 +92,7 @@
|
|||||||
</property>
|
</property>
|
||||||
</widget>
|
</widget>
|
||||||
</widget>
|
</widget>
|
||||||
<widget class="QListView" name="_valueView">
|
<widget class="QTableView" name="_valueView">
|
||||||
<property name="frameShape">
|
<property name="frameShape">
|
||||||
<enum>QFrame::Shape::NoFrame</enum>
|
<enum>QFrame::Shape::NoFrame</enum>
|
||||||
</property>
|
</property>
|
||||||
@@ -111,7 +111,7 @@
|
|||||||
<widget class="QToolBar" name="toolBar">
|
<widget class="QToolBar" name="toolBar">
|
||||||
<property name="minimumSize">
|
<property name="minimumSize">
|
||||||
<size>
|
<size>
|
||||||
<width>200</width>
|
<width>0</width>
|
||||||
<height>0</height>
|
<height>0</height>
|
||||||
</size>
|
</size>
|
||||||
</property>
|
</property>
|
||||||
|
|||||||
230
bcmainwindow.ui.autosave
Normal file
@@ -0,0 +1,230 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<ui version="4.0">
|
||||||
|
<class>BCMainWindow</class>
|
||||||
|
<widget class="QMainWindow" name="BCMainWindow">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>0</x>
|
||||||
|
<y>0</y>
|
||||||
|
<width>800</width>
|
||||||
|
<height>600</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>BCMainWindow</string>
|
||||||
|
</property>
|
||||||
|
<widget class="QWidget" name="_centralwidget">
|
||||||
|
<layout class="QHBoxLayout" name="horizontalLayout">
|
||||||
|
<item>
|
||||||
|
<widget class="QSplitter" name="splitter">
|
||||||
|
<property name="orientation">
|
||||||
|
<enum>Qt::Orientation::Horizontal</enum>
|
||||||
|
</property>
|
||||||
|
<widget class="QFrame" name="_controlFrame">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::Shape::StyledPanel</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Shadow::Raised</enum>
|
||||||
|
</property>
|
||||||
|
<widget class="QPushButton" name="_syncButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>30</x>
|
||||||
|
<y>50</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>51</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Sync</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QPushButton" name="_connectButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>10</x>
|
||||||
|
<y>180</y>
|
||||||
|
<width>171</width>
|
||||||
|
<height>51</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Connect</string>
|
||||||
|
</property>
|
||||||
|
<property name="checkable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QToolButton" name="_motorlButton">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>70</x>
|
||||||
|
<y>240</y>
|
||||||
|
<width>71</width>
|
||||||
|
<height>71</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="autoRaise">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
<widget class="QToolButton" name="toolButton_2">
|
||||||
|
<property name="geometry">
|
||||||
|
<rect>
|
||||||
|
<x>50</x>
|
||||||
|
<y>320</y>
|
||||||
|
<width>22</width>
|
||||||
|
<height>22</height>
|
||||||
|
</rect>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>...</string>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
<widget class="QTableView" name="_valueView">
|
||||||
|
<property name="frameShape">
|
||||||
|
<enum>QFrame::Shape::NoFrame</enum>
|
||||||
|
</property>
|
||||||
|
<property name="frameShadow">
|
||||||
|
<enum>QFrame::Shadow::Plain</enum>
|
||||||
|
</property>
|
||||||
|
<property name="alternatingRowColors">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
</widget>
|
||||||
|
</widget>
|
||||||
|
</item>
|
||||||
|
</layout>
|
||||||
|
</widget>
|
||||||
|
<widget class="QStatusBar" name="_statusbar"/>
|
||||||
|
<widget class="QToolBar" name="toolBar">
|
||||||
|
<property name="minimumSize">
|
||||||
|
<size>
|
||||||
|
<width>0</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="baseSize">
|
||||||
|
<size>
|
||||||
|
<width>200</width>
|
||||||
|
<height>0</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="windowTitle">
|
||||||
|
<string>toolBar</string>
|
||||||
|
</property>
|
||||||
|
<property name="movable">
|
||||||
|
<bool>false</bool>
|
||||||
|
</property>
|
||||||
|
<property name="iconSize">
|
||||||
|
<size>
|
||||||
|
<width>64</width>
|
||||||
|
<height>64</height>
|
||||||
|
</size>
|
||||||
|
</property>
|
||||||
|
<property name="floatable">
|
||||||
|
<bool>true</bool>
|
||||||
|
</property>
|
||||||
|
<attribute name="toolBarArea">
|
||||||
|
<enum>LeftToolBarArea</enum>
|
||||||
|
</attribute>
|
||||||
|
<attribute name="toolBarBreak">
|
||||||
|
<bool>false</bool>
|
||||||
|
</attribute>
|
||||||
|
<addaction name="_actionMotor"/>
|
||||||
|
<addaction name="_actionBattery"/>
|
||||||
|
<addaction name="_actionConsole"/>
|
||||||
|
<addaction name="_actionConnect"/>
|
||||||
|
</widget>
|
||||||
|
<action name="_actionPimp">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>:restart.png</normaloff>:restart.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>pimp</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Pimp my Ride</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="_actionMotor">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>:bionx_motor.png</normaloff>:bionx_motor.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>motor</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Show motor settings</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="_actionBattery">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>:bionx_akku.png</normaloff>:bionx_akku.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>battery</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Show battery settings</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="_actionConsole">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>:bionx_console.png</normaloff>:bionx_console.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>console</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Show console settings</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="_actionExit">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset>
|
||||||
|
<normaloff>:exit.png</normaloff>:exit.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>Exit</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>Exit</string>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
<action name="_actionConnect">
|
||||||
|
<property name="icon">
|
||||||
|
<iconset resource="bionxcontrol.qrc">
|
||||||
|
<normaloff>:/connected.png</normaloff>:/connected.png</iconset>
|
||||||
|
</property>
|
||||||
|
<property name="text">
|
||||||
|
<string>connect</string>
|
||||||
|
</property>
|
||||||
|
<property name="toolTip">
|
||||||
|
<string>connect to bike</string>
|
||||||
|
</property>
|
||||||
|
<property name="menuRole">
|
||||||
|
<enum>QAction::MenuRole::TextHeuristicRole</enum>
|
||||||
|
</property>
|
||||||
|
</action>
|
||||||
|
</widget>
|
||||||
|
<resources>
|
||||||
|
<include location="bionxcontrol.qrc"/>
|
||||||
|
</resources>
|
||||||
|
<connections/>
|
||||||
|
</ui>
|
||||||
@@ -45,9 +45,10 @@ public:
|
|||||||
model->setHorizontalHeaderLabels({"Name", "Wert"});
|
model->setHorizontalHeaderLabels({"Name", "Wert"});
|
||||||
|
|
||||||
// Daten einfügen
|
// Daten einfügen
|
||||||
for (int row = 0; row < 10; ++row) {
|
for (int row = 0; row < 10; ++row)
|
||||||
|
{
|
||||||
auto* nameItem = new QStandardItem(QString("Eintrag %1").arg(row + 1));
|
auto* nameItem = new QStandardItem(QString("Eintrag %1").arg(row + 1));
|
||||||
auto* valueItem = new QStandardItem();
|
auto* valueItem = new QStandardItem();
|
||||||
|
|
||||||
// Wert-Item editierbar machen
|
// Wert-Item editierbar machen
|
||||||
valueItem->setData(row * 10, Qt::EditRole); // Startwert 0-90
|
valueItem->setData(row * 10, Qt::EditRole); // Startwert 0-90
|
||||||
|
|||||||
BIN
resources/96/bottom.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
resources/96/browser-download.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
resources/96/cab_extract.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
resources/96/document-export.png
Normal file
|
After Width: | Height: | Size: 3.0 KiB |
BIN
resources/96/document-import.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
resources/96/document-revert.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/96/document-save-as.png
Normal file
|
After Width: | Height: | Size: 3.1 KiB |
BIN
resources/96/document-save.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
resources/96/go-jump.png
Normal file
|
After Width: | Height: | Size: 3.4 KiB |
BIN
resources/96/gtk-apply.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
resources/96/gtk-goto-first-ltr.png
Normal file
|
After Width: | Height: | Size: 2.7 KiB |
BIN
resources/96/gtk-goto-last-ltr.png
Normal file
|
After Width: | Height: | Size: 2.8 KiB |
BIN
resources/96/gtk-revert-to-saved-ltr.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/96/gtk-revert-to-saved-rtl.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/96/gtk-save.png
Normal file
|
After Width: | Height: | Size: 2.9 KiB |
BIN
resources/96/gtk-undo-ltr.png
Normal file
|
After Width: | Height: | Size: 3.3 KiB |
BIN
resources/96/object-rotate-left.png
Normal file
|
After Width: | Height: | Size: 4.7 KiB |
BIN
resources/96/object-rotate-right.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
resources/96/reload.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
resources/96/rotate.png
Normal file
|
After Width: | Height: | Size: 4.6 KiB |
BIN
resources/96/stock_bottom.png
Normal file
|
After Width: | Height: | Size: 2.6 KiB |
BIN
resources/96/stock_mail-send-receive.png
Normal file
|
After Width: | Height: | Size: 3.2 KiB |
BIN
resources/96/view-refresh96.png
Normal file
|
After Width: | Height: | Size: 4.2 KiB |
BIN
resources/document-import.png
Normal file
|
After Width: | Height: | Size: 2.0 KiB |
BIN
resources/document-revert.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
resources/document-save-as.png
Normal file
|
After Width: | Height: | Size: 2.3 KiB |
BIN
resources/document-save.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
resources/go-first.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |
BIN
resources/go-jump.png
Normal file
|
After Width: | Height: | Size: 2.2 KiB |
BIN
resources/go-last.png
Normal file
|
After Width: | Height: | Size: 1.9 KiB |