How to arrange the items in QGridLayout as shown?

后端 未结 2 1393
青春惊慌失措
青春惊慌失措 2021-02-12 14:43
------------  ------
|          |  | 2  |
|          |  |    |
|     1    |  ------
|          |  ------  
|          |  |  3 |
------------  ------

Ho

2条回答
  •  伪装坚强ぢ
    2021-02-12 15:07

    Is it somehow mandatory for you to use QGridLayout for some reason? For simple layouts like this, I find it easier to use a combination of one QHBoxLayout and one QVBoxLayout.

    QVBoxLayout* vlayout = new QVBoxLayout();
    vlayout->addWidget(objTwo);
    vlayout->addWidget(objThree);
    
    QHBoxLayout* hlayout = new QHBoxLayout();
    hlayout->addWidget(objOne);
    hlayout->addLayout(vlayout);
    

提交回复
热议问题