Création d'un compte pour un collaborateur extérieur au laboratoire depuis l'intranet ICube : https://intranet.icube.unistra.fr/fr/labs/member/profile

Commit b94d49d1 authored by Sylvain Thery's avatar Sylvain Thery
Browse files

Add popup Qt Window to show any kind of widget

BUG FIX on exit is call on SimpleQt out not on GLWidget
parent 612640e0
......@@ -148,6 +148,7 @@ public:
* if false : mouseMove events are only generated when a button is pressed
*/
void setGLWidgetMouseTracking(bool b);
protected:
GLWidget* m_glWidget;
......@@ -189,7 +190,7 @@ protected:
void keyPressEvent(QKeyEvent *event);
void keyReleaseEvent(QKeyEvent *e);
public:
/**
* set width and pos center of object to draw
......
......@@ -127,8 +127,6 @@ public:
void mouseMoveEvent(QMouseEvent* event);
void closeEvent(QCloseEvent *event);
void keyPressEvent(QKeyEvent* event);
void keyReleaseEvent(QKeyEvent* event);
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#ifndef __QT_POP_UP__
#define __QT_POP_UP__
#include <QGridLayout>
#include <QDialog>
namespace CGoGN
{
namespace Utils
{
namespace QT
{
/**
* Easy popup window creation
* Can contain one a more widgets in a grid
* Use show/hide to show/hide !
*/
class QtPopUp : public QDialog
{
Q_OBJECT
QGridLayout* m_layout;
public:
/**
* create an empty popup
*/
QtPopUp();
/**
* create a popup with one widget
*/
QtPopUp(QWidget* wid);
/**
* add a widget in the grid layout
* @param wid the widget to use
* @param row the row in which to insert
* @param col the column in which to insert
*/
void addWidget(QWidget* wid, int row, int col);
protected:
/// overload keypress event to avoid ESC out
virtual void keyPressEvent ( QKeyEvent * e );
};
}
}
}
#endif
......@@ -275,6 +275,7 @@ void SimpleQT::closeEvent(QCloseEvent *event)
{
m_glWidget->closeEvent(event) ;
QWidget::closeEvent(event) ;
cb_exit();
}
void SimpleQT::keyPressEvent(QKeyEvent *e)
......
......@@ -322,11 +322,6 @@ void GLWidget::wheelEvent(QWheelEvent* event)
m_cbs->cb_wheelEvent(event->delta(), event->x(), getHeight() - event->y());
}
void GLWidget::closeEvent(QCloseEvent *event)
{
if (m_cbs)
m_cbs->cb_exit() ;
}
void GLWidget::keyPressEvent(QKeyEvent* event)
{
......
/*******************************************************************************
* CGoGN: Combinatorial and Geometric modeling with Generic N-dimensional Maps *
* version 0.1 *
* Copyright (C) 2009-2012, IGG Team, LSIIT, University of Strasbourg *
* *
* This library is free software; you can redistribute it and/or modify it *
* under the terms of the GNU Lesser General Public License as published by the *
* Free Software Foundation; either version 2.1 of the License, or (at your *
* option) any later version. *
* *
* This library is distributed in the hope that it will be useful, but WITHOUT *
* ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or *
* FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License *
* for more details. *
* *
* You should have received a copy of the GNU Lesser General Public License *
* along with this library; if not, write to the Free Software Foundation, *
* Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. *
* *
* Web site: http://cgogn.unistra.fr/ *
* Contact information: cgogn@unistra.fr *
* *
*******************************************************************************/
#include "Utils/Qt/qtpopup.h"
namespace CGoGN
{
namespace Utils
{
namespace QT
{
QtPopUp::QtPopUp()
{
m_layout = new QGridLayout(this);
setLayout(m_layout);
}
QtPopUp::QtPopUp(QWidget* wid)
{
m_layout = new QGridLayout(this);
m_layout->addWidget(wid);
setLayout(m_layout);
}
void QtPopUp::addWidget(QWidget* wid, int col, int row)
{
m_layout->addWidget(wid,col,row);
}
void QtPopUp::keyPressEvent ( QKeyEvent * e )
{}
}
}
}
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment