Compare commits
1 Commits
d07ef3fbf9
...
experiment
| Author | SHA1 | Date | |
|---|---|---|---|
| fd94b2d354 |
@@ -1,65 +0,0 @@
|
|||||||
import QtQuick
|
|
||||||
import QtQuick.Controls
|
|
||||||
import QtQuick.Layouts
|
|
||||||
|
|
||||||
Window
|
|
||||||
{
|
|
||||||
width: 640
|
|
||||||
height: 480
|
|
||||||
visible: true
|
|
||||||
title: qsTr("StringListModel")
|
|
||||||
|
|
||||||
TableView
|
|
||||||
{
|
|
||||||
id: childTableView
|
|
||||||
anchors.fill: parent
|
|
||||||
|
|
||||||
model: myChildModel // z. B. QStandardItemModel mit 9 Spalten
|
|
||||||
|
|
||||||
delegate: Rectangle
|
|
||||||
{
|
|
||||||
required property string display
|
|
||||||
|
|
||||||
//height: 5
|
|
||||||
//width: childTableView.width
|
|
||||||
color : "blue"
|
|
||||||
border.color: "#ccc"
|
|
||||||
width: childTableView.width;
|
|
||||||
|
|
||||||
RowLayout
|
|
||||||
{
|
|
||||||
anchors.fill: parent
|
|
||||||
anchors.margins: 2
|
|
||||||
|
|
||||||
TextField
|
|
||||||
{
|
|
||||||
text : display
|
|
||||||
font.pixelSize: 10
|
|
||||||
Layout.fillWidth: true
|
|
||||||
|
|
||||||
background: Rectangle
|
|
||||||
{
|
|
||||||
color : "white"
|
|
||||||
}
|
|
||||||
|
|
||||||
onEditingFinished:
|
|
||||||
{
|
|
||||||
console.log("Editing finished, new text is :"+ text + " at index :" + index)
|
|
||||||
model.names = text //The roles here are defined in model class
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
|
|
||||||
ScrollBar.horizontal: ScrollBar {}
|
|
||||||
ScrollBar.vertical: ScrollBar {}
|
|
||||||
|
|
||||||
// // Optional: Spaltenbreiten setzen
|
|
||||||
// onModelChanged: {
|
|
||||||
// for (let i = 0; i < model.columns; ++i)
|
|
||||||
// table.setColumnWidth(i, 100)
|
|
||||||
// }
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -30,14 +30,30 @@ TreeView
|
|||||||
implicitHeight: 20
|
implicitHeight: 20
|
||||||
border.color: "#cccccc"
|
border.color: "#cccccc"
|
||||||
//color: index % 2 === 0 ? "#f9f9f9" : "#e0e0e0"
|
//color: index % 2 === 0 ? "#f9f9f9" : "#e0e0e0"
|
||||||
color: TreeView.isSelected ? "#d0eaff" : (row % 2 === 0 ? "#f9f9f9" : "#ffffff")
|
//color: TreeView.isSelected ? "#d0eaff" : (row % 2 === 0 ? "#f9f9f9" : "#ffffff")
|
||||||
|
//color: TreeView.isSelected ? "#d0eaff" : (row % 2 === 0 ? "#f9f9f9" : "#ffffff")
|
||||||
|
|
||||||
Text
|
TextField
|
||||||
{
|
{
|
||||||
|
id: entry
|
||||||
anchors.centerIn: parent
|
anchors.centerIn: parent
|
||||||
text: display
|
text: display
|
||||||
font.pixelSize: 12
|
font.pixelSize: 12
|
||||||
|
|
||||||
|
background: Rectangle
|
||||||
|
{
|
||||||
|
//color: entry.enabled ? "transparent" : "#353637"
|
||||||
|
//border.color: entry.enabled ? "#21be2b" : "transparent"
|
||||||
|
border.color: "transparent"
|
||||||
|
}
|
||||||
|
|
||||||
|
onEditingFinished:
|
||||||
|
{
|
||||||
|
console.log("Editing finished, new text is :"+ text + " at index :" + index)
|
||||||
|
model.display = text //The roles here are defined in model class
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ScrollBar.horizontal: ScrollBar {}
|
ScrollBar.horizontal: ScrollBar {}
|
||||||
|
|||||||
@@ -49,7 +49,6 @@ void XQChildModel::addModelData( const XQNodePtr& contentRoot )
|
|||||||
// Das ist hier der Typ des Eintrags: Panel, Battery ...
|
// Das ist hier der Typ des Eintrags: Panel, Battery ...
|
||||||
QString key = contentEntry->tag_name();
|
QString key = contentEntry->tag_name();
|
||||||
|
|
||||||
|
|
||||||
// 'silent failure' hier der Datenbaum kann auch Knoten enthalten
|
// 'silent failure' hier der Datenbaum kann auch Knoten enthalten
|
||||||
// die nicht für uns gedacht sind.
|
// die nicht für uns gedacht sind.
|
||||||
if (!_sections.hasValidSection(key))
|
if (!_sections.hasValidSection(key))
|
||||||
@@ -68,12 +67,9 @@ void XQChildModel::addModelData( const XQNodePtr& contentRoot )
|
|||||||
// _hinter_ der letzen zeile einfügen
|
// _hinter_ der letzen zeile einfügen
|
||||||
insertRow( newRow+1, list);
|
insertRow( newRow+1, list);
|
||||||
|
|
||||||
if( contentEntry->has_children())
|
if( contentEntry->has_children() )
|
||||||
{
|
{
|
||||||
qDebug() << " --- AddModelData: CHILD Found for: :" << contentEntry->tag_name() << " sheet parent: " << sheetNode->tag_name();
|
|
||||||
if( !sheetNode->has_children() )
|
|
||||||
qDebug() << " --- AUA";
|
|
||||||
//else
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} // for
|
} // for
|
||||||
|
|||||||
@@ -112,7 +112,7 @@ void XQMainWindow::initMainWindow()
|
|||||||
|
|
||||||
// #2. load demo data
|
// #2. load demo data
|
||||||
loadDocument( c_DocumentFileName1 );
|
loadDocument( c_DocumentFileName1 );
|
||||||
//loadDocumentQML( c_DocumentFileName2 );
|
loadDocumentQML( c_DocumentFileName2 );
|
||||||
//loadDocument( c_DocumentFileName2 );
|
//loadDocument( c_DocumentFileName2 );
|
||||||
//loadDocument( c_DocumentFileName3 );
|
//loadDocument( c_DocumentFileName3 );
|
||||||
|
|
||||||
|
|||||||
@@ -254,6 +254,8 @@ QSize XQItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelI
|
|||||||
|
|
||||||
QWidget* XQItemDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
QWidget* XQItemDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
|
||||||
{
|
{
|
||||||
|
Q_UNUSED(option);
|
||||||
|
|
||||||
XQItem& item = xqItemFromIndex(index);
|
XQItem& item = xqItemFromIndex(index);
|
||||||
XQItem::EditorType edType = item.editorType();
|
XQItem::EditorType edType = item.editorType();
|
||||||
if( edType == XQItem::NoEditorType )
|
if( edType == XQItem::NoEditorType )
|
||||||
|
|||||||
@@ -136,6 +136,54 @@ void XQItemFactory::setItemTypeDataFromString( XQItem& item, const QString& role
|
|||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
///
|
||||||
|
/// ------------------------------------------------
|
||||||
|
///
|
||||||
|
|
||||||
|
/*
|
||||||
|
XQItemList XQItemFactory::makeEmptyRow( const XQNodePtr& contentNode, const XQNodePtr& sheetNode )
|
||||||
|
{
|
||||||
|
Q_UNUSED(contentNode)
|
||||||
|
|
||||||
|
XQItemList list;
|
||||||
|
|
||||||
|
// create a data node for each sheet entry
|
||||||
|
size_t max = sheetNode->children().size();
|
||||||
|
for( size_t i=0; i<max; ++i )
|
||||||
|
{
|
||||||
|
// __fix
|
||||||
|
//list.append( new XQItem( "", XQItemType::EmptyStyle ) );
|
||||||
|
}
|
||||||
|
|
||||||
|
return list;
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
/*
|
||||||
|
XQItemList XQItemFactory::createGenericRow( const XQNodePtr& contentNode, const XQNodePtr& sheetNode )
|
||||||
|
{
|
||||||
|
|
||||||
|
// we have a new empty contentNode, so we add attributes first.
|
||||||
|
for( const auto& sheetEntry : sheetNode->children() )
|
||||||
|
{
|
||||||
|
QString value = "[" + sheetEntry->tag_name() + "]";
|
||||||
|
if( sheetEntry->has_attribute("Unit") )
|
||||||
|
value = "0";
|
||||||
|
contentNode->set_attribute( sheetEntry->tag_name(), value );
|
||||||
|
}
|
||||||
|
|
||||||
|
if( sheetNode->has_attribute( c_FriendlyName ) )
|
||||||
|
contentNode->set_attribute( c_FriendlyName, sheetNode->friendly_name() );
|
||||||
|
|
||||||
|
// now, we can create a normal entry row
|
||||||
|
return makeContentRow(contentNode, sheetNode );
|
||||||
|
|
||||||
|
}
|
||||||
|
*/
|
||||||
|
|
||||||
|
|
||||||
//! erzeugt eine item-row.
|
//! erzeugt eine item-row.
|
||||||
|
|
||||||
XQItemList XQItemFactory::makeRow(const XQNodePtr& sheetNode, const XQNodePtr& contentNode )
|
XQItemList XQItemFactory::makeRow(const XQNodePtr& sheetNode, const XQNodePtr& contentNode )
|
||||||
@@ -165,14 +213,6 @@ XQItemList XQItemFactory::makeRow(const XQNodePtr& sheetNode, const XQNodePtr& c
|
|||||||
return list;
|
return list;
|
||||||
}
|
}
|
||||||
|
|
||||||
XQItemList XQItemFactory::makeChildRow( XQItem* parent, const XQNodePtr& sheetNode, const XQNodePtr& contentNode )
|
|
||||||
{
|
|
||||||
Q_UNUSED(parent);
|
|
||||||
Q_UNUSED(sheetNode);
|
|
||||||
Q_UNUSED(contentNode);
|
|
||||||
|
|
||||||
return XQItemList();
|
|
||||||
}
|
|
||||||
|
|
||||||
//! Erzeugt ein XQItem aus einer typ-beschreibung ('sheetNode') und einem daten-knoten ('contentNode').
|
//! Erzeugt ein XQItem aus einer typ-beschreibung ('sheetNode') und einem daten-knoten ('contentNode').
|
||||||
//! Wenn der content node nicht gesetzt ist, wird stattdess das attribut 'Caption' aus der typ-beschreibung
|
//! Wenn der content node nicht gesetzt ist, wird stattdess das attribut 'Caption' aus der typ-beschreibung
|
||||||
|
|||||||
@@ -33,7 +33,6 @@ public:
|
|||||||
XQNodePtr findModelSheet( const QString& modelName ) const;
|
XQNodePtr findModelSheet( const QString& modelName ) const;
|
||||||
|
|
||||||
XQItemList makeRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode );
|
XQItemList makeRow( const XQNodePtr& sheetNode, const XQNodePtr& contentNode );
|
||||||
XQItemList makeChildRow( XQItem* parent, const XQNodePtr& sheetNode, const XQNodePtr& contentNode );
|
|
||||||
XQItem* makeSingleItem( const XQNodePtr& sheetNode, const QString& caption );
|
XQItem* makeSingleItem( const XQNodePtr& sheetNode, const QString& caption );
|
||||||
|
|
||||||
void setItemTypeDataFromString( XQItem& item, const QString& roleKey, const QString& source ) const;
|
void setItemTypeDataFromString( XQItem& item, const QString& roleKey, const QString& source ) const;
|
||||||
|
|||||||
@@ -4,7 +4,6 @@
|
|||||||
<file alias="modeldata2.xtr">../xml/modeldata2.xtr</file>
|
<file alias="modeldata2.xtr">../xml/modeldata2.xtr</file>
|
||||||
<file alias="modeldata3.xtr">../xml/modeldata3.xtr</file>
|
<file alias="modeldata3.xtr">../xml/modeldata3.xtr</file>
|
||||||
<file alias="modelsheet.xml">../xml/modelsheets.xml</file>
|
<file alias="modelsheet.xml">../xml/modelsheets.xml</file>
|
||||||
<file alias="xqtableview.qml">../qml/xqtableview.qml</file>
|
|
||||||
<file alias="xqtreeview.qml">../qml/xqtreeview.qml</file>
|
<file alias="xqtreeview.qml">../qml/xqtreeview.qml</file>
|
||||||
</qresource>
|
</qresource>
|
||||||
</RCC>
|
</RCC>
|
||||||
|
|||||||
@@ -15,9 +15,9 @@
|
|||||||
<Inverter InverterID="#3 HM1600 03" FriendlyName="@InverterName" InverterName="03 HM1600 S4 TMax" Manufacturer="HoyMiles" MaxPowerInput="9000,00" MaxPowerInputChoice="6000;8000;10000" MaxPowerOutput="1600" NumStrings="4" Weight="32"/>
|
<Inverter InverterID="#3 HM1600 03" FriendlyName="@InverterName" InverterName="03 HM1600 S4 TMax" Manufacturer="HoyMiles" MaxPowerInput="9000,00" MaxPowerInputChoice="6000;8000;10000" MaxPowerOutput="1600" NumStrings="4" Weight="32"/>
|
||||||
<Inverter InverterID="#4 D12K 04" FriendlyName="@InverterName" InverterName="04 HM600 S2 TMax" Manufacturer="Deye" MaxPowerInput="8000" MaxPowerInputChoice="6000;8000;12000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
|
<Inverter InverterID="#4 D12K 04" FriendlyName="@InverterName" InverterName="04 HM600 S2 TMax" Manufacturer="Deye" MaxPowerInput="8000" MaxPowerInputChoice="6000;8000;12000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
|
||||||
<Battery BatteryID="#1 BYD 01" FriendlyName="@BatteryName" BatteryName="01 BYD T01 Stackable" Manufacturer="BYD" Capacity="4500" Yield="90" MaxCurrent="120" MaxVolt="48">
|
<Battery BatteryID="#1 BYD 01" FriendlyName="@BatteryName" BatteryName="01 BYD T01 Stackable" Manufacturer="BYD" Capacity="4500" Yield="90" MaxCurrent="120" MaxVolt="48">
|
||||||
<Image DataItem="Image" DataValue="image.png"/>
|
<AdditionalData DataItem="Image" DataValue="image.png"/>
|
||||||
<Manual DataItem="Manual" DataValue="manual.docx"/>
|
<AdditionalData DataItem="Manual" DataValue="manual.docx"/>
|
||||||
<Certificate DataItem="Certificate" DataValue="certificate.pdf"/>
|
<AdditionalData DataItem="Certificate" DataValue="certificate.pdf"/>
|
||||||
</Battery>
|
</Battery>
|
||||||
<Battery BatteryID="#2 BYD 02" FriendlyName="@BatteryName" BatteryName="02 BYD T02 Stackable" Manufacturer="BYD" Capacity="9000" Yield="94" MaxCurrent="120" MaxVolt="48"/>
|
<Battery BatteryID="#2 BYD 02" FriendlyName="@BatteryName" BatteryName="02 BYD T02 Stackable" Manufacturer="BYD" Capacity="9000" Yield="94" MaxCurrent="120" MaxVolt="48"/>
|
||||||
<Battery BatteryID="#3 BYD 03" FriendlyName="@BatteryName" BatteryName="03 BYD T01 Stackable" Manufacturer="BYD" Capacity="4500" Yield="86" MaxCurrent="120" MaxVolt="48"/>
|
<Battery BatteryID="#3 BYD 03" FriendlyName="@BatteryName" BatteryName="03 BYD T01 Stackable" Manufacturer="BYD" Capacity="4500" Yield="86" MaxCurrent="120" MaxVolt="48"/>
|
||||||
|
|||||||
@@ -124,13 +124,8 @@
|
|||||||
<Manufacturer ItemType="PlainType" />
|
<Manufacturer ItemType="PlainType" />
|
||||||
<Capacity ItemType="ValueType" UnitType="Wh"/>
|
<Capacity ItemType="ValueType" UnitType="Wh"/>
|
||||||
<Yield ItemType="PercentageType" UnitType="%"/>
|
<Yield ItemType="PercentageType" UnitType="%"/>
|
||||||
<MaxCurrent ItemType="ValueType" UnitType="A">
|
<MaxCurrent ItemType="ValueType" UnitType="A"/>
|
||||||
<SubType ItemType="PlainType"/>
|
|
||||||
</MaxCurrent>
|
|
||||||
<MaxVolt ItemType="ValueType" UnitType="V"/>
|
<MaxVolt ItemType="ValueType" UnitType="V"/>
|
||||||
|
|
||||||
<firz ItemType="PlainType"/>
|
|
||||||
|
|
||||||
</ModelSheet>
|
</ModelSheet>
|
||||||
</Section>
|
</Section>
|
||||||
|
|
||||||
|
|||||||
@@ -6,10 +6,10 @@
|
|||||||
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 4" MaxAmpere="11" MaxVolt="42" PanelID="#4 JA 04" PanelName="JA 04 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 4" MaxAmpere="11" MaxVolt="42" PanelID="#4 JA 04" PanelName="JA 04 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
||||||
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 5" MaxAmpere="11" MaxVolt="42" PanelID="#5 JA 05" PanelName="JA 05 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 5" MaxAmpere="11" MaxVolt="42" PanelID="#5 JA 05" PanelName="JA 05 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
||||||
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 6" MaxAmpere="11" MaxVolt="42" PanelID="#6 JA 06" PanelName="JA 06 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
<Panel FriendlyName="@PanelName" Height="1,70" Manufacturer="JA Solar 6" MaxAmpere="11" MaxVolt="42" PanelID="#6 JA 06" PanelName="JA 06 Solar X58C" WattPeak="440" Weight="12" Width="1,10"/>
|
||||||
<Inverter FriendlyName="@InverterName" InverterID="#1 HM600 01" InverterName="01 HM600 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="8000,00" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
|
<Inverter FriendlyName="@InverterName" InverterID="#1 HM600 01" InverterName="01 HM600 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="3000,00" MaxPowerInputChoice="2000;4000;6000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
|
||||||
<Inverter FriendlyName="@InverterName" InverterID="#2 HM800 02" InverterName="02 HM800 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="4000,00" MaxPowerInputChoice="4000;6000;8000" MaxPowerOutput="800" NumStrings="2" Weight="29"/>
|
<Inverter FriendlyName="@InverterName" InverterID="#2 HM800 02" InverterName="02 HM800 S2 TMax" Manufacturer="HoyMiles" MaxPowerInput="4000" MaxPowerInputChoice="4000;6000;8000" MaxPowerOutput="800" NumStrings="7" Weight="29"/>
|
||||||
<Inverter FriendlyName="@InverterName" InverterID="#3 HM1600 03" InverterName="03 HM1600 S4 TMax" Manufacturer="HoyMiles" MaxPowerInput="9000,00" MaxPowerInputChoice="6000;8000;10000" MaxPowerOutput="1600" NumStrings="4" Weight="32"/>
|
<Inverter FriendlyName="@InverterName" InverterID="#3 HM1600 03" InverterName="03 HM1600 S4 TMax" Manufacturer="HoyMiles" MaxPowerInput="9000,00" MaxPowerInputChoice="6000;8000;10000" MaxPowerOutput="1600" NumStrings="4" Weight="32"/>
|
||||||
<Inverter FriendlyName="@InverterName" InverterID="#4 D12K 04" InverterName="04 HM600 S2 TMax" Manufacturer="Deye" MaxPowerInput="8000,00" MaxPowerInputChoice="6000;8000;12000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
|
<Inverter FriendlyName="@InverterName" InverterID="#4 D12K 04" InverterName="04 HM600 S2 TMax" Manufacturer="Deye" MaxPowerInput="8000" MaxPowerInputChoice="6000;8000;12000" MaxPowerOutput="600" NumStrings="2" Weight="28"/>
|
||||||
<Battery BatteryID="#1 BYD 01" BatteryName="01 BYD T01 Stackable" Capacity="4500" FriendlyName="@BatteryName" Manufacturer="BYD" MaxCurrent="120" MaxVolt="48" Yield="90">
|
<Battery BatteryID="#1 BYD 01" BatteryName="01 BYD T01 Stackable" Capacity="4500" FriendlyName="@BatteryName" Manufacturer="BYD" MaxCurrent="120" MaxVolt="48" Yield="90">
|
||||||
<AdditionalData DataItem="Image" DataValue="image.png"/>
|
<AdditionalData DataItem="Image" DataValue="image.png"/>
|
||||||
<AdditionalData DataItem="Manual" DataValue="manual.docx"/>
|
<AdditionalData DataItem="Manual" DataValue="manual.docx"/>
|
||||||
|
|||||||
Reference in New Issue
Block a user