main.qml 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  1. import QtQuick 2.7
  2. import QtQuick.Controls 2.0
  3. import QtQuick.Layouts 1.0
  4. import "api" as API
  5. import "models" as Models
  6. import "views" as Views
  7. import "helpers" as Helpers
  8. ApplicationWindow {
  9. id: app
  10. visible: true
  11. width: 640
  12. height: 480
  13. title: qsTr("IP-телефония НИЯУ МИФИ")
  14. property alias unitsTree: searchPage.unitsTree
  15. API.Voip {id: voipAPI}
  16. Models.Unit {
  17. id: unitModel
  18. onLoadingStatusChanged: {
  19. unitsTree.considerLoadingStatusChanged(loadingStatus)
  20. }
  21. onSelectionChanged: {
  22. }
  23. }
  24. Models.Subscriber {
  25. id: subscriberModel
  26. }
  27. Helpers.MyPopup {
  28. id: popup
  29. }
  30. SwipeView {
  31. id: swipeView
  32. anchors.fill: parent
  33. currentIndex: tabBar.currentIndex
  34. Search {
  35. id: searchPage
  36. unitsTree.itemModel: unitModel
  37. onUnitSelected: {
  38. dataPage.showUnit.unitIndex = unitsTree.currentIndex
  39. swipeView.setCurrentIndex(1)
  40. }
  41. }
  42. Data {
  43. id: dataPage
  44. showUnit.unitModel: unitModel
  45. onReturnToSearch: {
  46. swipeView.setCurrentIndex(0)
  47. }
  48. }
  49. Settings {
  50. id: settingsPage
  51. }
  52. VirtualPhone {
  53. id: virtualPhonePage
  54. }
  55. AddressBook {
  56. id: addressBookPage
  57. }
  58. /*Chat {
  59. id: chatPage
  60. }*/
  61. }
  62. footer: TabBar {
  63. id: tabBar
  64. currentIndex: swipeView.currentIndex
  65. TabButton {
  66. id: searchPageButton
  67. text: qsTr("Поиск")
  68. }
  69. TabButton {
  70. id: dataPageButton
  71. text: qsTr("Данные")
  72. }
  73. TabButton {
  74. text: qsTr("Настройки")
  75. }
  76. TabButton {
  77. text: qsTr("Вирт. телефон")
  78. }
  79. TabButton {
  80. text: qsTr("Адресная книга")
  81. }
  82. /*TabButton {
  83. text: qsTr("Чат")
  84. }*/
  85. }
  86. }