bubbledlg.qml 1.8 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283
  1. import Qt 4.7
  2. Rectangle {
  3. id: container
  4. smooth: true
  5. radius: 8
  6. color: "khaki"
  7. border.color: "black"
  8. border.width: 2
  9. property int selected: -1
  10. signal bubblesSelected
  11. width: dialogText.width
  12. height: dialogText.height + op1.height + op2.height + op3.height + 10 + 3*5
  13. opacity: 0
  14. function show(text) {
  15. container.opacity = 1;
  16. }
  17. function hide() {
  18. container.opacity = 0;
  19. }
  20. MouseArea {
  21. anchors.fill: parent
  22. onClicked: hide();
  23. }
  24. Column {
  25. id: optionsColumn1
  26. spacing: 10
  27. Text {
  28. id: dialogText
  29. font.pointSize: 12
  30. text: " How many bubbles? "
  31. }
  32. Column {
  33. id: optionsColumn
  34. anchors.horizontalCenter: parent.horizontalCenter
  35. spacing: 5
  36. Button {
  37. id: op1
  38. text: "Deserted"
  39. textPointSize: 10
  40. width: dialogText.width - 10
  41. radius: 3
  42. onClicked: {
  43. selected = 0;
  44. bubblesSelected();
  45. }
  46. }
  47. Button {
  48. id: op2
  49. text: "Many"
  50. textPointSize: 10
  51. width: dialogText.width - 10
  52. radius: 3
  53. onClicked: {
  54. selected = 1;
  55. bubblesSelected();
  56. }
  57. }
  58. Button {
  59. id: op3
  60. text: "Crowded"
  61. textPointSize: 10
  62. width: dialogText.width - 10
  63. radius: 3
  64. onClicked: {
  65. selected = 2;
  66. bubblesSelected();
  67. }
  68. }
  69. }
  70. }
  71. }