Qt 的Widget提升为某个类,就会在ui...h产生一个对应的对象,例如,
projectView *widgetProject;
widgetProject为Qt定义的窗体名称
1.在主窗体,声明一个变量用于窗体间传值
QString globalStationCode;//点击的站点编码,传到子窗体
2.在子窗体,声明外部变量
extern QString globalStationCode;//接收从父窗体传过来的参数
3.并在要调用的函数中为其赋值
globalStationCode = value;//获取输入值赋值给全局变量
4.并在要调用的函数中使用其对象调用updateGL()函数
widgetProject.updateGL();