KGLLib
extras/kgllib/widgetproxy.h
00001 /*
00002  * Copyright 2008  Rivo Laks <rivolaks@hot.ee>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this program.  If not, see <http://www.gnu.org/licenses/>.
00016  */
00017 
00018 #ifndef KGLLIB_WIDGETPROXY_H
00019 #define KGLLIB_WIDGETPROXY_H
00020 
00021 #include "kgllib.h"
00022 
00023 #include <QtGui/QGraphicsView>
00024 
00025 class QGraphicsProxyWidget;
00026 
00027 namespace KGLLib
00028 {
00029 class GLWidget;
00030 
00041 class KGLLIB_EXTRAS_EXPORT WidgetProxy : public QGraphicsView
00042 {
00043 public:
00044     WidgetProxy(GLWidget* w, QWidget* parent = 0);
00045 
00046     QGraphicsProxyWidget* addWidget(QWidget* w);
00047     QWidget* createWindow(const QString& title);
00048 
00049 protected:
00050     virtual void resizeEvent(QResizeEvent* event);
00051     virtual bool event(QEvent* event);
00052     virtual bool viewportEvent(QEvent* event);
00053 
00054     bool handleMouseEvent(QEvent* event, const QPoint& pos);
00055 
00056 private:
00057     class Scene;
00058 
00059     GLWidget* mGLWidget;
00060 };
00061 
00062 }
00063 
00064 #endif