Z
Z
ZzZero2014-04-08 00:11:12
Qt
ZzZero, 2014-04-08 00:11:12

QT Table Layout - it's not there, how to simulate it?

You need to get the following table:
e6bfa395ac4e49979b9f042744d66335.png
Each cell - QPushButton
There are Vertocal, Horizontal, Grid, Form layouts. I understand that Grid Layout should suit me, but I'm doing something wrong.

Answer the question

In order to leave comments, you need to log in

3 answer(s)
X
xseven, 2014-04-09
@ZzZero

You force the old samurai to take up the sword
Nakidal, here's a quick git
Mahjong and geishas can be added as desired.
The main idea is clear - a 4x4 field. The cell with value 0 is empty i.e. the one that can be moved
@dplsoft - I think you can look and questions about extensibility will disappear. By the way, I forgot that the game is called tag :)
@ZzZero - not a crutch at all. in 80% of cases, you should try to use MVC to display data, etc.
@tugo - You were right, an alternative QML approach for such purposes

D
Denis I., 2014-04-08
@dplsoft

correctly understand that you need a QGridLayout)
and if you do something wrong, then where is your code in which you don’t get what you need?

X
xseven, 2014-04-08
@xseven

In general a more advanced approach would be:
Use QTableView
Override
Modelku delegate
AND handle events etc.
But it is desirable to describe the problem in more detail
. In the general case

correctly understand that you need QGridLayout )

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question