|
本帖最后由 yang 于 2015-6-11 11:09 编辑
QLabel* label = new QLabel;
#include "myviewerwidget.h"
int main(int argc, char *argv[])
{
QApplication a(argc, argv);
// MainWindow w;
// w.show();
QLabel* label = new QLabel;
label->setText("123456");
//
osgViewer::ViewerBase::ThreadingModel threadingModel = osgViewer::ViewerBase::CullDrawThreadPerContext;
MyViewerWidget* viewWidget = new MyViewerWidget(0,threadingModel);
viewWidget->setGeometry(10,10,10,10);
// 布局
QGridLayout layout;
layout.addWidget(viewWidget,0,0,1,1);
label->setLayout(&layout);
label->show();
return a.exec();
}
运行结果 如图所示
|
-
QLabel运行结果
|