Objekte anlegen
This commit is contained in:
@@ -11,22 +11,6 @@ GridLayout
|
|||||||
Layout.fillHeight: true
|
Layout.fillHeight: true
|
||||||
rowSpacing: 9
|
rowSpacing: 9
|
||||||
|
|
||||||
Label
|
|
||||||
{
|
|
||||||
text: qsTr("Firma")
|
|
||||||
Layout.alignment: Qt.AlignRight | Qt.AlignVCenter
|
|
||||||
}
|
|
||||||
ComboBox
|
|
||||||
{
|
|
||||||
property string name: "business"
|
|
||||||
id: business
|
|
||||||
editable: true
|
|
||||||
Layout.fillWidth: true
|
|
||||||
Layout.columnSpan: 3
|
|
||||||
onEditTextChanged: checkFields()
|
|
||||||
onCurrentTextChanged: checkFields()
|
|
||||||
}
|
|
||||||
|
|
||||||
//// New grid row
|
//// New grid row
|
||||||
|
|
||||||
Label
|
Label
|
||||||
@@ -160,7 +144,7 @@ GridLayout
|
|||||||
id: mezzanin
|
id: mezzanin
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: false
|
editable: false
|
||||||
model: [qsTr("Jööö"), qsTr("Nöööööööööööööööööööööööööö")]
|
model: [qsTr("Ja"), qsTr("Nein")]
|
||||||
}
|
}
|
||||||
|
|
||||||
Label
|
Label
|
||||||
@@ -175,7 +159,7 @@ GridLayout
|
|||||||
id: lift
|
id: lift
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
editable: false
|
editable: false
|
||||||
model: [qsTr("Jööö"), qsTr("Nöööööööööööööööööööööööööö")]
|
model: [qsTr("Ja"), qsTr("Nein")]
|
||||||
}
|
}
|
||||||
|
|
||||||
//New grid row
|
//New grid row
|
||||||
@@ -190,6 +174,8 @@ GridLayout
|
|||||||
id: objectno
|
id: objectno
|
||||||
Layout.fillWidth: true
|
Layout.fillWidth: true
|
||||||
Layout.alignment: Qt.AlignVCenter
|
Layout.alignment: Qt.AlignVCenter
|
||||||
|
placeholderText: qsTr("0 oder leer um eine Nummer automatisch zu generieren")
|
||||||
|
placeholderTextColor: "pink"
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
@@ -232,11 +218,10 @@ GridLayout
|
|||||||
|
|
||||||
function checkObjectField()
|
function checkObjectField()
|
||||||
{
|
{
|
||||||
return ((business.editText.trim() || business.currentText.trim()) &&
|
return street.text.trim() && houseno.text.trim() &&
|
||||||
street.text.trim() && houseno.text.trim() &&
|
|
||||||
(postcode.editText.trim() || postcode.currentText.trim()) &&
|
(postcode.editText.trim() || postcode.currentText.trim()) &&
|
||||||
(city.editText.trim() || city.currentText.trim()) &&
|
(city.editText.trim() || city.currentText.trim()) &&
|
||||||
cleaningproducts.text.trim())
|
cleaningproducts.text.trim()
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -71,19 +71,20 @@ ColumnLayout
|
|||||||
enabled: false
|
enabled: false
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
|
new_object = JsLib.parseForm(newObject)
|
||||||
|
new_object['lift'] = new_object['lift'] === 'Ja' ? 1 : 0
|
||||||
|
new_object['mezzanin'] = new_object['mezzanin'] === 'Ja' ? 1 : 0
|
||||||
if (!checkAddContact.checked)
|
if (!checkAddContact.checked)
|
||||||
{
|
{
|
||||||
var list = []
|
var list = []
|
||||||
new_object = JsLib.parseForm(newObject)
|
object_model.addObject(new_object, list, false)
|
||||||
object_model.addObject(new_object, list)
|
|
||||||
|
|
||||||
|
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
new_object = JsLib.parseForm(newObject)
|
|
||||||
var new_objecto = addObjectLayout.getForm()
|
var new_objecto = addObjectLayout.getForm()
|
||||||
object_model.addObject(new_object, new_objecto)
|
object_model.addObject(new_object, new_objecto, true)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -25,7 +25,7 @@ class ObjectModel(QAbstractTableModel):
|
|||||||
#self.__getData()
|
#self.__getData()
|
||||||
|
|
||||||
@Slot(dict, list, bool)
|
@Slot(dict, list, bool)
|
||||||
def addObject(self, new_object, new_objcontact):
|
def addObject(self, new_object, new_objcontact = None, new_contact = False):
|
||||||
print(new_object)
|
print(new_object)
|
||||||
|
|
||||||
print(new_objcontact)
|
print(new_objcontact)
|
||||||
|
|||||||
Reference in New Issue
Block a user