Hello forum,

I am trying to insert the elastic node example inside the window structure as follows:

Qt Code:
  1. ElasticMainWindow::ElasticMainWindow(QWidget *parent) :
  2. QMainWindow(parent),
  3. ui(new Ui::ElasticMainWindow),
  4. m_graph(0),
  5. m_mdiArea(0),
  6. m_subWindow(0)
  7. {
  8. ui->setupUi(this);
  9.  
  10. //create a mdi area
  11. m_mdiArea = new QMdiArea(this);
  12. m_mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation,false);
  13.  
  14. createToolWindows();
  15.  
  16. //!set the mdi area as the central widget
  17. //!and this is how it is used in the main window
  18. setCentralWidget(m_mdiArea);
  19.  
  20. }
  21.  
  22.  
  23. void ElasticMainWindow::createToolWindows()
  24. {
  25.  
  26.  
  27. m_graph = new GraphWidget();
  28. m_graph->setWindowTitle(tr("Elastic Graph"));
  29.  
  30.  
  31. m_subWindow = new QMdiSubWindow(m_graph,Qt::FramelessWindowHint);
  32.  
  33.  
  34. m_mdiArea->addSubWindow(m_subWindow)->setWindowState(Qt::WindowMaximized);
  35.  
  36.  
  37.  
  38. }
  39.  
  40. ElasticMainWindow::~ElasticMainWindow()
  41. {
  42. delete ui;
  43. }
To copy to clipboard, switch view to plain text mode 


But i do see anything when the program launches. It should be showing the nodes and edges connected to each other as in the main example.


Please point out if i miss anything.


Regards
Sajjad