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.6KB

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