GUI Object
This commit is contained in:
116
Gui/AddObject.qml
Normal file
116
Gui/AddObject.qml
Normal file
@@ -0,0 +1,116 @@
|
||||
import QtQuick
|
||||
import QtQuick.Layouts
|
||||
import QtQuick.Controls
|
||||
import QtQuick.Controls.Fusion
|
||||
import QtQuick.Dialogs
|
||||
import "../js/qmldict.js" as JsLib
|
||||
|
||||
ColumnLayout
|
||||
{
|
||||
property var new_object: null
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: 15
|
||||
Label
|
||||
{
|
||||
text: qsTr("Objekt anlegen")
|
||||
horizontalAlignment: Text.AlignHCenter
|
||||
Layout.fillWidth: true
|
||||
font.pixelSize: 35
|
||||
}
|
||||
CheckBox
|
||||
{
|
||||
id: checkAddObject
|
||||
text: qsTr("Mitarbeiter/Ansprechpartner hinzufügen")
|
||||
Layout.alignment: Qt.AlignRight
|
||||
checked: false
|
||||
onCheckStateChanged:
|
||||
{
|
||||
addObjectLayout.visible = checked
|
||||
//checkFields()
|
||||
}
|
||||
}
|
||||
|
||||
RowLayout
|
||||
{
|
||||
id: addobject
|
||||
Layout.fillWidth: true
|
||||
Layout.fillHeight: true
|
||||
spacing: 45
|
||||
|
||||
ObjectView
|
||||
{
|
||||
id: objectView
|
||||
}
|
||||
|
||||
ObjectAddOns
|
||||
{
|
||||
id: addObjectLayout
|
||||
}
|
||||
}
|
||||
RowLayout
|
||||
{
|
||||
Layout.fillHeight: true
|
||||
Layout.alignment: Qt.AlignRight
|
||||
Button
|
||||
{
|
||||
text: qsTr("Abbrechen")
|
||||
onClicked: appLoader.source = "ObjectTable.qml"
|
||||
}
|
||||
Button
|
||||
{
|
||||
id: saveBtn
|
||||
text: qsTr("Speichern")
|
||||
enabled: false
|
||||
onClicked:
|
||||
{
|
||||
if (!checkAddObject.checked)
|
||||
{
|
||||
new_object = JsLib.addObject(objectView)
|
||||
object_model.addObject(new_object, 0)
|
||||
appLoader.source = "ObjectTable.qml"
|
||||
}
|
||||
else
|
||||
{
|
||||
new_object = JsLib.addObject(objectView)
|
||||
var new_objecto = JsLib.addObject(addObjectLayout)
|
||||
objecto_model.addObject(new_objecto)
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
Item
|
||||
{
|
||||
id: spacer3
|
||||
Layout.fillHeight: true
|
||||
}
|
||||
|
||||
|
||||
|
||||
// Connections
|
||||
// {
|
||||
// target: spacer3
|
||||
|
||||
// function onObjectIdReady()
|
||||
// {
|
||||
// var obj_id = arguments[0]
|
||||
// object_model.addObject(new_object, obj_id)
|
||||
// appLoader.source = "ObjectTable.qml"
|
||||
// }
|
||||
// }
|
||||
|
||||
// function checkFields()
|
||||
// {
|
||||
// if(checkAddObject.checked)
|
||||
// {
|
||||
// if(!objectView.checkObjectField() || !addObjectLayout.checkObjectField())
|
||||
// saveBtn.enabled = false
|
||||
// else
|
||||
// saveBtn.enabled = true
|
||||
// }
|
||||
// else if (!objectView.checkObjectField())
|
||||
// saveBtn.enabled = false
|
||||
// else
|
||||
// saveBtn.enabled = true
|
||||
// }
|
||||
}
|
||||
Reference in New Issue
Block a user