Qt4: Placing QMainWindow instance inside other QWidget/QMainWindow

后端 未结 3 1875
感情败类
感情败类 2021-01-05 07:11

I\'d like to place QMainWindow instance inside another QWidget (for example centralWidget of another QMainWindow).

I\'m wondering why it doesn\'t work ? QMainWindow

3条回答
  •  萌比男神i
    2021-01-05 07:40

    QMainWindow provides predefined stuff like toolbars and status bars and menu bars in a platform agnostic way (it "does the right thing", without manual intervention). If all you need is a bunch of buttons in a layout, use QWidget.

    You need to make sure each QMainWindow has centralQWidget`, other than that, you should be fine.

提交回复
热议问题