MainPage.qml 2.7 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. /**
  2. * Copyright (c) 2012 Nokia Corporation.
  3. */
  4. import QtQuick 1.1
  5. import com.nokia.symbian 1.1
  6. import "../Constants.js" as Constants
  7. Page {
  8. id: mainPage
  9. property string infoText: Constants.TABS_INFOTEXT
  10. tools: toolBarBackAndInfo
  11. Model{
  12. id: dataModel
  13. }
  14. Component {
  15. id: delegate
  16. ListItem {
  17. id: listItem
  18. platformInverted: window.platformInverted
  19. subItemIndicator: true
  20. ListItemText {
  21. id: itemText
  22. anchors.verticalCenter: parent.verticalCenter
  23. anchors.left: parent.left
  24. anchors.leftMargin: 10
  25. platformInverted: window.platformInverted
  26. mode: listItem.mode
  27. role: "Title"
  28. text: title
  29. width: parent.width
  30. }
  31. onClicked: {
  32. window.pageStack.push(Qt.resolvedUrl("SubListPage.qml"), { modelListContainer: subListContainer,
  33. parentListName: itemText.text});
  34. }
  35. }
  36. }
  37. TabBarLayout {
  38. id: tabBar
  39. z: 1
  40. anchors { left: parent.left; right: parent.right; top: parent.top }
  41. TabButton { tab: listView1; platformInverted: window.platformInverted; text: "View A" }
  42. TabButton { tab: listView2; platformInverted: window.platformInverted; text: "View B" }
  43. TabButton { tab: listView3; platformInverted: window.platformInverted; text: "View C" }
  44. TabButton { tab: listView4; platformInverted: window.platformInverted; text: "View D" }
  45. }
  46. TabGroup {
  47. id: tabGroup
  48. anchors { left: parent.left; right: parent.right; top: tabBar.bottom; bottom: parent.bottom }
  49. // define the content for tab 1
  50. ListView {
  51. id: listView1
  52. anchors.fill: parent
  53. model: dataModel.tab1ListModel
  54. delegate: delegate
  55. }
  56. // define the content for tab 2
  57. ListView {
  58. id: listView2
  59. anchors.fill: parent
  60. model: dataModel.tab2ListModel
  61. delegate: delegate
  62. }
  63. // define content for tab 3
  64. ListView {
  65. id: listView3
  66. anchors.fill: parent
  67. model: dataModel.tab3ListModel
  68. delegate: delegate
  69. }
  70. // define content for tab 4
  71. ListView {
  72. id: listView4
  73. anchors.fill: parent
  74. model: dataModel.tab4ListModel
  75. delegate: delegate
  76. }
  77. }
  78. }