Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

QGLSignalWidget.h

Go to the documentation of this file.
00001 /* 00002 * QGLSignalWidget.h 00003 * $Id: QGLSignalWidget.h,v 1.5 2001/11/15 16:54:52 guenth Exp $ 00004 * 00005 * Copyright (C) 1999, 2000 Markus Janich 00006 * 00007 * This program is free software; you can redistribute it and/or modify 00008 * it under the terms of the GNU General Public License as published by 00009 * the Free Software Foundation; either version 2 of the License, or 00010 * (at your option) any later version. 00011 * 00012 * This program is distributed in the hope that it will be useful, 00013 * but WITHOUT ANY WARRANTY; without even the implied warranty of 00014 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00015 * GNU General Public License for more details. 00016 * 00017 * You should have received a copy of the GNU General Public License 00018 * along with this program; if not, write to the Free Software 00019 * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA 00020 * 00021 * As a special exception to the GPL, the QGLViewer authors (Markus 00022 * Janich, Michael Meissner, Richard Guenther, Alexander Buck and Thomas 00023 * Woerner) give permission to link this program with Qt (non-)commercial 00024 * edition, and distribute the resulting executable, without including 00025 * the source code for the Qt (non-)commercial edition in the source 00026 * distribution. 00027 * 00028 */ 00029 00030 // Description : Class QGLSignalWidget 00031 // Purpose : Provides a OpenGL render area 00032 00033 00034 #ifndef _QGLSIGNALWIDGET_H_ 00035 #define _QGLSIGNALWIDGET_H_ 00036 00037 00038 // Qt 00040 #include <qgl.h> 00041 #include <qevent.h> 00042 #include <qdragobject.h> 00043 00044 00045 // System 00047 00048 00049 // Own 00051 00052 00053 00054 00065 class QGLSignalWidget: public QGLWidget { 00066 Q_OBJECT 00067 00068 public: 00069 00071 QGLSignalWidget(QWidget * parent=0, const char * name=0, 00072 const QGLWidget * shareWidget = 0, WFlags f=0) 00073 : QGLWidget(parent, name, shareWidget, f) 00074 { 00075 //setFocusPolicy(NoFocus); 00076 setAcceptDrops(true); 00077 }; 00078 00080 QGLSignalWidget(const QGLFormat & format, QWidget * parent=0, 00081 const char * name=0, const QGLWidget * shareWidget = 0, 00082 WFlags f=0) 00083 : QGLWidget(format, parent, name, shareWidget, f) 00084 { 00085 //setFocusPolicy(NoFocus); 00086 setAcceptDrops(true); 00087 }; 00088 00089 00090 signals: 00091 00094 void sigInitGL(); 00095 00097 void sigRedrawGL(); 00098 00101 void sigResizeGL(int nWidth, int nHeight); 00102 00105 void sigMouseRelease(QMouseEvent *pqEvent); 00106 00109 void sigMousePress(QMouseEvent *pqEvent); 00110 00113 void sigMouseMove(QMouseEvent *pqEvent); 00114 00115 void sigDragEnter(QDragEnterEvent *pqEvent); 00116 void sigDragLeave(QDragLeaveEvent *pqEvent); 00117 void sigDrop(QDropEvent *pqEvent); 00118 00119 protected: 00120 00122 virtual void initializeGL() { 00123 emit( sigInitGL() ); 00124 }; 00125 00127 virtual void paintGL() { 00128 emit( sigRedrawGL() ); 00129 }; 00130 00132 virtual void resizeGL(int nWidth, int nHeight) { 00133 emit( sigResizeGL(nWidth, nHeight) ); 00134 }; 00135 00137 virtual void mouseReleaseEvent (QMouseEvent *event) { 00138 emit(sigMouseRelease(event)); 00139 }; 00140 00142 virtual void mousePressEvent (QMouseEvent *event) { 00143 emit(sigMousePress(event)); 00144 }; 00145 00147 virtual void mouseMoveEvent (QMouseEvent *event) { 00148 emit(sigMouseMove(event)); 00149 }; 00150 00152 void dragEnterEvent(QDragEnterEvent *qEvent) { 00153 emit(sigDragEnter(qEvent)); 00154 }; 00155 00157 void dragLeaveEvent(QDragLeaveEvent *qEvent) { 00158 emit(sigDragLeave(qEvent)); 00159 }; 00160 00162 void dropEvent(QDropEvent *qEvent) { 00163 emit(sigDrop(qEvent)); 00164 }; 00165 }; 00166 00167 #endif // __QGLSIGNALWIDGET_H_

Generated on Fri Aug 13 17:43:12 2004 for QGLViewer by doxygen 1.3.7