Hello forum,
I am trying to insert the elastic node example inside the window structure as follows:
ElasticMainWindow
::ElasticMainWindow(QWidget *parent
) : ui(new Ui::ElasticMainWindow),
m_graph(0),
m_mdiArea(0),
m_subWindow(0)
{
ui->setupUi(this);
//create a mdi area
m_mdiArea = new QMdiArea(this);
m_mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation,false);
createToolWindows();
//!set the mdi area as the central widget
//!and this is how it is used in the main window
setCentralWidget(m_mdiArea);
}
void ElasticMainWindow::createToolWindows()
{
m_graph = new GraphWidget();
m_graph->setWindowTitle(tr("Elastic Graph"));
m_subWindow = new QMdiSubWindow(m_graph,Qt::FramelessWindowHint);
m_mdiArea->addSubWindow(m_subWindow)->setWindowState(Qt::WindowMaximized);
}
ElasticMainWindow::~ElasticMainWindow()
{
delete ui;
}
ElasticMainWindow::ElasticMainWindow(QWidget *parent) :
QMainWindow(parent),
ui(new Ui::ElasticMainWindow),
m_graph(0),
m_mdiArea(0),
m_subWindow(0)
{
ui->setupUi(this);
//create a mdi area
m_mdiArea = new QMdiArea(this);
m_mdiArea->setOption(QMdiArea::DontMaximizeSubWindowOnActivation,false);
createToolWindows();
//!set the mdi area as the central widget
//!and this is how it is used in the main window
setCentralWidget(m_mdiArea);
}
void ElasticMainWindow::createToolWindows()
{
m_graph = new GraphWidget();
m_graph->setWindowTitle(tr("Elastic Graph"));
m_subWindow = new QMdiSubWindow(m_graph,Qt::FramelessWindowHint);
m_mdiArea->addSubWindow(m_subWindow)->setWindowState(Qt::WindowMaximized);
}
ElasticMainWindow::~ElasticMainWindow()
{
delete ui;
}
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
Bookmarks