Qt World Summit: Submit your Presentation

Adding a QX11EmbedContainer widget to a MainWindow

  • I am trying to display a QX11EmbedContainer in a MainWindow in my project, however, it only displays when I use setCentralWidget.... when I create a Layout add it it doesn't show.

    Any help would be very welcome. Thanks!

  • Lifetime Qt Champion


    It's normal, QMainWindow are not designed to have their layout changed (you should even get a warning on the console about that)

    If you want to have several widget with each other on the QMainWindow, you can create a container widget where you set the layout and all the widgets you want, then set that container widget as central widget on your QMainWindow.

    Hope it helps

  • Thanks,
    That is what I am trying to do, I am also trying with just a widget with a layout instead of using the QMainWindow class, both cases don't work for displaying the QX11EmbedContainer

  • Lifetime Qt Champion

    Did you try with QX11EmbedWidget ?

Log in to reply