Ejemplo n.º 1
0
/** void QWidget::hide()
 * bind/QWidget.h:32
 */
static int GLWidget_hide(lua_State *L) {
  try {
    GLWidget *self = *((GLWidget **)dub_checksdata(L, 1, "mimas.GLWidget"));
    self->hide();
    return 0;
  } catch (std::exception &e) {
    lua_pushfstring(L, "hide: %s", e.what());
  } catch (...) {
    lua_pushfstring(L, "hide: Unknown exception");
  }
  return dub_error(L);
}
Ejemplo n.º 2
0
viewSynForm::viewSynForm(std::vector<image>** ims, QGLWidget* widgetForContext/*, QMutex *imageMutex */):_imageSavingPath(".\\")//,_imageMutex(imageMutex)
{	
	 _ims = ims;
	
	ui.setupUi(this); 
	_fixedWidth = 240;	
	double aspectRatio = static_cast<double>( (**ims)[0]._image.rows)/static_cast<double>((**ims)[0]._image.cols);
	
	((QWidget*)(ui.gridLayout_Images->parent()))->setGeometry(0,0, _fixedWidth * 4.5, static_cast<int>(_fixedWidth * 2.5 * aspectRatio));
	
	this->setGeometry(((QWidget*)(ui.gridLayout_Images->parent()))->geometry());

	int numOfImages = (*ims)->size();		

	for(int i = 0; i < NUM_GLWIDGETS; i++){
		int j = (i>=numOfImages)? (numOfImages-1):i; 		
		GLWidget *glw = new GLWidget(&((**ims)[j]), i, widgetForContext);
		glw->setFixedHeight(_fixedWidth * aspectRatio);
		glw->setFixedWidth(_fixedWidth);
		if(j!=i)
			glw->hide();
		_glWidgets.append(glw);		
	}		
	for(int i = 0 ; i<NUM_GLWIDGETS; i++){
		int row = i/4;
		int col = i - row * 4;
		ui.gridLayout_Images->addWidget(_glWidgets[i], row, col);		
	}		
	for(int i = 0; i<NUM_GLWIDGETS; i++)
		for(int j = 0; j<NUM_GLWIDGETS; j++){
			if(i != j)
				QObject::connect(_glWidgets[i], SIGNAL(posChanged(int, int, image)),_glWidgets[j], SLOT(setPosValue(int, int, image)));
		}
	ui.button_Capture->setEnabled(false);
	QObject::connect(ui.button_Saving_Path, SIGNAL(clicked()), this, SLOT(getSavingPath()), Qt::QueuedConnection);
	QObject::connect(ui.button_Capture, SIGNAL(clicked()), this, SLOT(saveImage()));
}