Reputation: 775
I've recently started lerning Qt and I'm facing the following problem:
I want to create sth like a chessboard (empty, doesn't have to do anything for now) - I've drawn a simple interface, but in the middle I need to make a chessboard itself (let's say it will be made out of small QTextBrowsers).
The problem is that the size of chessboard must be specified by user. So, drawing 16 fields and giving them unique objectNames is easy, but I have no idea how to:
Thans in advance,
Upvotes: 0
Views: 333
Reputation: 12491
So what I think you want is a two-dimensional array of fields. That way you can reference the correct field without knowing the name.
More specifically Qt provides QLayoutGrid which, although not a two dimensional array, will give you grid access to widgets by using the itemAtPosition
method
Upvotes: 2