I guess you want to show the resolution of the camera selected in self.cameras combobox. In that case you can do something like this:
Code: Select all def changeWH(self):
scene = Cmaxwell(mwcallback);
# the following line can be really slow on large scenes. one solution is to save the resolution list in a member variable of the class when you read the
# scene in "camerasList(self)", or also you can avoid reading the scene objects calling readMXS this way:
# scen.readMXS(scenePath,SKIP_OBJECTS)
ok = scene.readMXS(self.edit_input_file.text().toAscii().data());
cameraName = self.cameras.currentText()
if ok:
camera = scene.getCamera(cameraName)
x,y = camera.getResolution()
self.edit_width.setValue(x)
self.edit_height.setValue(y)
also you can use the signal "activated" (void QComboBox::activated(const QString & text)) of self.cameras to capture when the combobox current text has changed. If you use Qt I strongly reccomend you to get used to its signal/slot system
Anyway, I am not sure why do you need the comboboxes for the resolution, and then the editors for the current resolution. Can you avoid the resolution's comboboxes and just show the current camera resolution in the edit_width/edit_height widgets?