title: Adding Widgets Underneath The Main Widget (Console) QT
body: <p>5 with a Macos and right now I have a central widget as a console screen. This shows output coming from my serial port functions. </p>
  
  <p>Underneath, I want to add some other widgets that do other things, such as a button, slider, or lcd. I was wondering how one can do this.</p>
  
  <p>The code that I currently have:</p>
  
  <pre><code>MainWindow::MainWindow(QWidget *parent) :
      QMainWindow(parent),
      ui(new Ui::MainWindow)
  {
      //******* Set up
      ui-&gt;setupUi(this);
  
      console = new Console;
      console-&gt;setEnabled(false);
      setCentralWidget(console);
  
      //create serialport object
      serial = new QSerialPort(this);
  
      //create settings object
      settings = new SettingsDialog;
  
      ui-&gt;actionConnect-&gt;setEnabled(true);
      ui-&gt;actionDisconnect-&gt;setEnabled(false);
      ui-&gt;actionQuit-&gt;setEnabled(true);
      ui-&gt;actionConfigure-&gt;setEnabled(true);
  
      initActionsConnections();
  
      /************** Connection Events ***********************/
      connect(serial, SIGNAL(error(QSerialPort::SerialPortError)), this,
              SLOT(handleError(QSerialPort::SerialPortError)));
  
      connect(serial, SIGNAL(readyRead()), this, SLOT(readData()));
  
      connect(console, SIGNAL(getData(QByteArray)), this, SLOT(writeData(QByteArray)));
  }
  </code></pre>
  
  <p>However, I want these widgets separate from the console screen, which is showing some output on its own. So I want to add the following widgets:</p>
  
  <pre><code>/************** Adding Widgets *********************/
  //creation and attribution of slider
  slider = new QSlider();
  slider-&gt;resize(255, 20);
  slider-&gt;setOrientation(Qt::Horizontal);
  slider-&gt;setRange(0, 255); //0-255 is range we can read
  
  //creation and attribution of the lcd
  lcd = new QLCDNumber();
  lcd-&gt;setSegmentStyle(QLCDNumber::Flat);
  lcd-&gt;resize(255, 50);
  
  //layout with slider and lcd
  main_layout = new QVBoxLayout();
  main_layout-&gt;addWidget(slider);
  main_layout-&gt;addWidget(lcd);
  
  //***********some way add this main_layout underneath the console **********/
  </code></pre>