Hi,
Seems that delegate can't be found with findChild()...
I solved problem as I use model. I fully removed direct interacting with
Cells on Board...
Thank you guys for your suggestions and help.
On 11.04.2016 18:49, Igor Mironchik wrote:
Hi,
I have chess board defined in QML as:
Grid {
id: grid
rows: 8
columns: 8
x: offset
y: top.y + top.height
objectName: "grid"
Repeater {
model: chessBoard
delegate: Cell {
cellColor: model.CurrentPieceColor
chessX: index % 8
chessY: index / 8
onClicked: board.clicked( x, y )
onHovered: board.hovered( x, y )
objectName: "c"+ chessX + chessY
width: cellWidth
height: cellHeight
source: model.CellImageSource
}
}
}
So cell's objectName is something like c00, c01...
In C++ I have
QObject * cell = m_grid->findChild< QObject* > ( "c00" );
But it always return 0 with any cell's name. m_grid is the "grid"
object...
Am I doing something wrong or this is a bug?
Thank you.
_______________________________________________
Interest mailing list
Interest@qt-project.org
http://lists.qt-project.org/mailman/listinfo/interest