AddContactView.qml 1.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import QtQuick 2.0
  2. import QtQuick.Controls 2.4
  3. import qtprotobuf.examples 1.0
  4. StackItem {
  5. id: root
  6. Flickable {
  7. anchors.fill: parent
  8. Column {
  9. width: root.width
  10. TextInputRow {
  11. id: firstNameField
  12. width: root.width
  13. label: qsTr("First name")
  14. }
  15. TextInputRow {
  16. id: middleNameField
  17. width: root.width
  18. label: qsTr("Middle name")
  19. }
  20. TextInputRow {
  21. id: lastNameField
  22. width: root.width
  23. label: qsTr("Last name")
  24. }
  25. }
  26. }
  27. property Contact newContact: Contact {
  28. firstName: firstNameField.text
  29. middleName: middleNameField.text
  30. lastName: lastNameField.text
  31. }
  32. FloatingRoundButton {
  33. id: addContactButton
  34. enabled: firstNameField.text.length > 0
  35. anchors.right: parent.right
  36. anchors.bottom: parent.bottom
  37. anchors.margins: 10
  38. icon: "qrc:/images/check.png"
  39. onClicked: {
  40. abEngine.addContact(newContact)
  41. stack.pop()
  42. }
  43. }
  44. }