c++ - How to put osgEarth's ViewerWidget into an tabbed MdiArea? -


is there special putting osgearth's viewerviewer qmdiarea? created qmdiarea central widget (called setcentralwidget) instead of taking osgearth's viewer directly central widget.

qmdiarea *mdiarea = new qmdiarea(this);  setcentralwidget(mdiarea); // call qmainwindows method, snippet taken app's mainwindow  mdiarea->addsubwindow(viewerwidget); // doesn't work, globe not drawn 

everything tried didn't worked... except osgearth's viewerwidget set central widget of mainwindow. tried multiviewerwidget without success because need 1 view viewerwidget should ok, or not?

i had examples didn't succed use 1 of them starting point.

any hints? thank's in advance.

you can try this, form1 qdialog

in main.cpp

int main() {     qapplication a(argc, argv);     form1 w=new form1();//qdialog     .................//do initial map     w.loadwidget(viewerwidget);     w.show();//the order of loadwiget() , show() important!!!!!     a.exec();  } 

in form1.cpp

void form1::loadwidget(qwidget *qwidget) {     qwidget->setminimumsize( ui.mdiarea->width(),ui.mdiarea->height());     qmdisubwindow * subw=ui.mdiarea->addsubwindow(qwidget);     subw->setwindowflags(qt::subwindow | qt::framelesswindowhint);     subw->maximumsize(); } 

this works qt 4.8.4+osgearth 2.3


Comments

Popular posts from this blog

html5 - What is breaking my page when printing? -

c# - must be a non-abstract type with a public parameterless constructor in redis -

ajax - PHP/JSON Login script (Twitter style) not setting sessions -