Important: Please read the Qt Code of Conduct -

QtCamera example do you get that kind of QMainWindow?

  • We notice that the Camera example has a very different QMainWindow based main window in the QtCreator. It contains layout control information and automatically re-laysout the widgets put into it. This is very useful for cross platform.
    However, if you create a new app using QMainWindow, you dont get the same behavior, nor any of the layout options (properties I guess they are). How does one change to this kind of QMainWindow?

  • Lifetime Qt Champion


    The example uses a designer built ui, have a look at the camera.ui file so you can see how it was done.

    Hope it helps

  • I said I did that. Now I want to know how you use the QtCreator (design) system to create that kind of QMainWindow. it does not appear that they are really the same class and it does not appear possible to actually make a new main window like that anymore.

  • Lifetime Qt Champion

    It's not really the QMainWindow that contains all the layouts and related stuff. It is the central widget of the QMainWindow which is generally a QWidget (and it is in the case of the camera ui).

    So basically you set a QWidget as the central widget and do everything in this one like you would if you did the designer stuff for a normal QWidget.

Log in to reply