I am a little lost as to how to use a layout manager with QCP. I understand how to add rows and columns in QCP but I need to add a QListView to list come text to the right of my QCP graph. Since QCP can't add QWT elements (at least not to my knowledge) I need to use a QWT layout manager. I would like to add a QVBoxLayout to this code with. Thanks.

(mainwindow.cpp)
Qt Code:
  1. MainWindow::MainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::MainWindow){
  4. ui->setupUi(this);
  5. MainWindow::makePlot();
  6. }
  7.  
  8. ...............
  9.  
  10.  
  11.  
  12. void MainWindow::makePlot(QString stock){
  13. // set the title
  14. ui->customPlot->plotLayout()->insertRow(0);
  15. QCPPlotTitle *plotTitle = new QCPPlotTitle(ui->customPlot);
  16. plotTitle->setMargins(QMargins(0,0,0,0));
  17. plotTitle->setTextColor(QColor(255,255,255));
  18. plotTitle->setFont(QFont(QFont().family(), 12));
  19. plotTitle->setText("hello world");
  20. ui->customPlot->plotLayout()->addElement(0, 0, plotTitle);
  21. ui->customPlot->setBackground(QBrush(QColor(70,70,70)));
  22.  
  23. QCPFinancial *candlesticks = new QCPFinancial(ui->customPlot->xAxis, ui->customPlot->yAxis);
  24. ...............................................
To copy to clipboard, switch view to plain text mode 
(main.cpp)
Qt Code:
  1. int main(int argc, char *argv[])
  2. {
  3. QApplication a(argc, argv);
  4. MainWindow w;
  5. w.show();
  6.  
  7. return a.exec();
  8. }
To copy to clipboard, switch view to plain text mode 
(mainwindow.h)
Qt Code:
  1. namespace Ui {
  2. class MainWindow;
  3. }
  4.  
  5.  
  6.  
  7. class MainWindow : public QMainWindow
  8. {
  9. Q_OBJECT
  10.  
  11. public:
  12. explicit MainWindow(QWidget *parent = 0);
  13. ~MainWindow();
  14.  
  15. private slots:
  16. void makePlot(QString stock);
  17.  
  18. private:
  19. Ui::MainWindow *ui;
  20. protected:
  21.  
  22. };
  23.  
  24.  
  25.  
  26.  
  27. #endif // MAINWINDOW_H
To copy to clipboard, switch view to plain text mode