Objekte anlegen
This commit is contained in:
@@ -11,22 +11,6 @@ GridLayout
|
||||
Layout.fillHeight: true
|
||||
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
|
||||
|
||||
Label
|
||||
@@ -160,7 +144,7 @@ GridLayout
|
||||
id: mezzanin
|
||||
Layout.fillWidth: true
|
||||
editable: false
|
||||
model: [qsTr("Jööö"), qsTr("Nöööööööööööööööööööööööööö")]
|
||||
model: [qsTr("Ja"), qsTr("Nein")]
|
||||
}
|
||||
|
||||
Label
|
||||
@@ -175,7 +159,7 @@ GridLayout
|
||||
id: lift
|
||||
Layout.fillWidth: true
|
||||
editable: false
|
||||
model: [qsTr("Jööö"), qsTr("Nöööööööööööööööööööööööööö")]
|
||||
model: [qsTr("Ja"), qsTr("Nein")]
|
||||
}
|
||||
|
||||
//New grid row
|
||||
@@ -190,6 +174,8 @@ GridLayout
|
||||
id: objectno
|
||||
Layout.fillWidth: true
|
||||
Layout.alignment: Qt.AlignVCenter
|
||||
placeholderText: qsTr("0 oder leer um eine Nummer automatisch zu generieren")
|
||||
placeholderTextColor: "pink"
|
||||
}
|
||||
|
||||
|
||||
@@ -232,11 +218,10 @@ GridLayout
|
||||
|
||||
function checkObjectField()
|
||||
{
|
||||
return ((business.editText.trim() || business.currentText.trim()) &&
|
||||
street.text.trim() && houseno.text.trim() &&
|
||||
return street.text.trim() && houseno.text.trim() &&
|
||||
(postcode.editText.trim() || postcode.currentText.trim()) &&
|
||||
(city.editText.trim() || city.currentText.trim()) &&
|
||||
cleaningproducts.text.trim())
|
||||
cleaningproducts.text.trim()
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -71,19 +71,20 @@ ColumnLayout
|
||||
enabled: false
|
||||
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)
|
||||
{
|
||||
var list = []
|
||||
new_object = JsLib.parseForm(newObject)
|
||||
object_model.addObject(new_object, list)
|
||||
object_model.addObject(new_object, list, false)
|
||||
|
||||
|
||||
}
|
||||
else
|
||||
{
|
||||
new_object = JsLib.parseForm(newObject)
|
||||
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()
|
||||
|
||||
@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_objcontact)
|
||||
|
||||
Reference in New Issue
Block a user