How to add a border to layout?

How do I add a drop down menu to a border layout in Qt

  • I have created a border layout, and I have created a menu layout following these two tutorials: http://doc.qt.nokia.com/latest/mainwindows-menus.html http://doc.qt.nokia.com/latest/layouts-borderlayout.html I am missing something fundamental when I try to put them together. My result is an application window with nothing in it. The border layout worked fine on its own as well as the menu (pulled straight from the reference). What's the best way to add a drop down menu to the border layout?

  • Answer:

    Start with the menu example as a basis. Use the Window class from the other example instead of widget in the MainWindow constructor, so MainWindow::MainWindow() { QWidget *widget = new QWidget; setCentralWidget(widget); becomes MainWindow::MainWindow() { Window *widget = new Window; setCentralWidget(widget);

MaxRunFast at Stack Overflow Visit the source

Was this solution helpful to you?

Related Q & A:

Just Added Q & A:

Find solution

For every problem there is a solution! Proved by Solucija.

  • Got an issue and looking for advice?

  • Ask Solucija to search every corner of the Web for help.

  • Get workable solutions and helpful tips in a moment.

Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.