我是这样做的
int winpos_x=p_viewer->getCamera()->getGraphicsContext()->getTraits()->x;
int winpos_y=p_viewer->getCamera()->getGraphicsContext()->getTraits()->y;
int winwidth=p_viewer->getCamera()->getGraphicsContext()->getTraits()->width;
int winheight=p_viewer->getCamera()->getGraphicsContext()->getTraits()->height;