InfoViewItem.qml 670 B

1234567891011121314151617181920212223242526272829
  1. import QtQuick 2.0
  2. Item {
  3. id: root
  4. property alias text: textItem.text
  5. property alias image: imageItem.source
  6. // Switch image & text positions
  7. property bool switchedLayout: false
  8. width: parent.width
  9. height: Math.max(imageItem.height, textItem.paintedHeight)
  10. Image {
  11. id: imageItem
  12. x: root.switchedLayout ? 16 : parent.width - width - 10
  13. y: 8
  14. }
  15. Text {
  16. id: textItem
  17. width: parent.width - imageItem.width - 40
  18. x: root.switchedLayout ? parent.width - width - 16 : 16
  19. y: 8
  20. color: "#ffffff"
  21. font.pixelSize: settings.fontS
  22. wrapMode: Text.WordWrap
  23. }
  24. }