This commit is contained in:
2025-09-12 00:39:51 +02:00
parent cc441d094c
commit fd94b2d354
5 changed files with 25 additions and 68 deletions

View File

@@ -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)
// }
}
}

View File

@@ -30,14 +30,30 @@ TreeView
implicitHeight: 20
border.color: "#cccccc"
//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
text: display
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 {}

View File

@@ -67,6 +67,11 @@ void XQChildModel::addModelData( const XQNodePtr& contentRoot )
// _hinter_ der letzen zeile einfügen
insertRow( newRow+1, list);
if( contentEntry->has_children() )
{
}
} // for
}

View File

@@ -254,6 +254,8 @@ QSize XQItemDelegate::sizeHint(const QStyleOptionViewItem& option, const QModelI
QWidget* XQItemDelegate::createEditor(QWidget* parent, const QStyleOptionViewItem& option, const QModelIndex& index) const
{
Q_UNUSED(option);
XQItem& item = xqItemFromIndex(index);
XQItem::EditorType edType = item.editorType();
if( edType == XQItem::NoEditorType )

View File

@@ -4,7 +4,6 @@
<file alias="modeldata2.xtr">../xml/modeldata2.xtr</file>
<file alias="modeldata3.xtr">../xml/modeldata3.xtr</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>
</qresource>
</RCC>