This adds the missing headers

CredentialsView.ui.qml

Qt Code:
  1. import QtQuick 2.9
  2. import QtQuick.Controls 2.2
  3. import QtQuick.Layouts 1.3
  4.  
  5. import credentials 1.0
  6.  
  7. Page {
  8. id: page_Credentials
  9. header: Label {
  10. text: qsTr("Credentials")
  11. font.pixelSize: Qt.application.font.pixelSize
  12. padding: 10
  13. }
  14.  
  15. ColumnLayout{
  16. RowLayout{
  17. Rectangle{
  18. color: "lightgray"
  19.  
  20. implicitWidth: page_Credentials.width/2
  21. implicitHeight: lbl_cell_user.implicitHeight
  22. Label{
  23. id: lbl_cell_user
  24. text: "user"
  25. anchors.centerIn: parent
  26. }
  27. }
  28. Rectangle{
  29. color: "lightgray"
  30.  
  31. implicitWidth: page_Credentials.width/2
  32. implicitHeight: lbl_cell_password.height
  33. Label{
  34. id: lbl_cell_password
  35. text: "pass"
  36. anchors.centerIn: parent
  37. }
  38. }
  39. }
  40. RowLayout{
  41. CredentialsTableView{
  42. model: SqlCredentialsModel{}
  43.  
  44. implicitWidth: page_Credentials.width
  45. implicitHeight: page_Credentials.height
  46. }
  47. }
  48. }
  49. }
To copy to clipboard, switch view to plain text mode 

CredentialsTableView.ui.qml

Qt Code:
  1. import QtQuick 2.12
  2. import QtQuick.Controls 2.12
  3.  
  4. import credentials 1.0
  5.  
  6. TableView {
  7. id: dbTableView
  8. columnSpacing: 5
  9. rowSpacing: 1
  10. clip: true
  11.  
  12. delegate: Rectangle{
  13. implicitWidth: dbTableView.width/2;
  14. implicitHeight: lb_cell.height;
  15. color: "lightblue"
  16. Label {
  17. id: lb_cell
  18. text: display
  19. anchors.centerIn: parent
  20. }
  21. }
  22. }
To copy to clipboard, switch view to plain text mode 


main.qml

Qt Code:
  1. import QtQuick 2.12
  2. import QtQuick.Controls 2.5
  3.  
  4. ApplicationWindow {
  5. visible: true
  6. width: 100
  7. height: 120
  8. title: qsTr("Credentials")
  9.  
  10. SwipeView {
  11. id: swipeView
  12.  
  13. CredentialsView{
  14. id: credentialsView
  15. }
  16. }
  17. }
To copy to clipboard, switch view to plain text mode 

Code is available in https://github.com/hstig/qt/tree/add...iteCredentials

How to get rid of following binding loops?
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitWidth"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitWidth"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitHeight"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitWidth"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitWidth"
qrc:/main.qml:13:9: QML Page: Binding loop detected for property "implicitHeight"