Hi,

I have a GridView
Qt Code:
  1. GridItemView
  2. {
  3. id: grid
  4. width: 500
  5. height: 200
  6.  
  7. cellWidth: 200
  8. cellHeight: 80
  9.  
  10. anchors.verticalCenter: parent.verticalCenter;
  11. anchors.horizontalCenter: parent.horizontalCenter;
  12.  
  13. model: myModel
  14. delegate: MyDelegate{}
  15. }
To copy to clipboard, switch view to plain text mode 

and MyDelegate is a simple rectagle with parent size:

Qt Code:
  1. Rectangle
  2. {
  3. property int margin: 20;
  4. width: GridView.view.cellWidth - margin
  5. height: GridView.view.cellHeight - margin
  6.  
  7. Text
  8. {
  9. id: textValue
  10. text: modelVal
  11. horizontalAlignment: Text.AlignVCenter
  12. font.pixelSize: 30
  13. anchors.horizontalCenter: parent.horizontalCenter
  14. anchors.verticalCenter: parent.verticalCenter
  15. }
  16. }
To copy to clipboard, switch view to plain text mode 

The delegates have correct size but elements is aligned on the top-left of the cell grid.

I've tried to add
Qt Code:
  1. anchors.centerIn: parent.Center
To copy to clipboard, switch view to plain text mode 
in MyDelegate but don't works:all elements is placed at the center of GridView.

I've tried also to add margins but don't works.

How I can center the delegate element into the cell?