Qt Quick based coffee brewing control chart.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

ColorPicker.qml 1.0KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374
  1. import QtQuick 1.0
  2. Rectangle {
  3. id: colorpicker
  4. color: "red"
  5. Rectangle {
  6. id: pickControl
  7. x: 40
  8. y: 0
  9. z: 10
  10. width: 260
  11. height: 50
  12. color: "white"
  13. border.color: "black"
  14. border.width: 3
  15. radius: 5
  16. opacity: 0
  17. Behavior on opacity {
  18. PropertyAnimation {
  19. duration: 250
  20. }
  21. }
  22. Repeater {
  23. model: ListModel {
  24. ListElement {
  25. theColor: "red"
  26. }
  27. ListElement {
  28. theColor: "orange"
  29. }
  30. ListElement {
  31. theColor: "yellow"
  32. }
  33. ListElement {
  34. theColor: "green"
  35. }
  36. ListElement {
  37. theColor: "blue"
  38. }
  39. ListElement {
  40. theColor: "indigo"
  41. }
  42. ListElement {
  43. theColor: "violet"
  44. }
  45. }
  46. Rectangle {
  47. width: 30
  48. height: 30
  49. x: (35*index)+10
  50. y: 10
  51. color: theColor
  52. opacity: 1
  53. MouseArea {
  54. anchors.fill: parent
  55. onClicked: {
  56. pickControl.opacity = 0
  57. colorpicker.color = parent.color
  58. }
  59. }
  60. }
  61. }
  62. }
  63. MouseArea {
  64. anchors.fill: parent
  65. onClicked: {
  66. pickControl.opacity = 1
  67. }
  68. }
  69. }