Back to index

texmacs  1.0.7.15
QTMWindow.hpp
Go to the documentation of this file.
00001 
00002 /******************************************************************************
00003 * MODULE     : QTMWindow.hpp
00004 * DESCRIPTION: QT Texmacs window class
00005 * COPYRIGHT  : (C) 2009 Massimiliano Gubinelli
00006 *******************************************************************************
00007 * This software falls under the GNU general public license version 3 or later.
00008 * It comes WITHOUT ANY WARRANTY WHATSOEVER. For details, see the file LICENSE
00009 * in the root directory or <http://www.gnu.org/licenses/gpl-3.0.html>.
00010 ******************************************************************************/
00011 
00012 #ifndef QTMWINDOW_HPP
00013 #define QTMWINDOW_HPP
00014 
00015 #include "qt_tm_widget.hpp"
00016 #include <QVariant>
00017 #include <QMainWindow>
00018 #include <QScrollArea>
00019 
00020 class QTMWindow: public QMainWindow {
00021   Q_OBJECT
00022 
00023 public:
00024   inline QTMWindow(qt_tm_widget_rep *_wid): QMainWindow () {
00025     setObjectName("A QTMWindow");
00026     setProperty ("texmacs_tm_widget", QVariant::fromValue ((void*) _wid));
00027   }
00028 
00029   inline qt_tm_widget_rep *
00030   tm_widget() {
00031     QVariant v= property("texmacs_tm_widget");
00032     return (qt_tm_widget_rep *)
00033       (v.canConvert<void*> ()? v.value<void*> (): NULL);
00034   }
00035 
00036 protected:
00037   virtual void closeEvent (QCloseEvent *event);
00038 };
00039 
00040 class QTMPlainWindow: public QWidget {
00041   Q_OBJECT
00042   
00043 protected:
00044   virtual void closeEvent (QCloseEvent *event);
00045 signals:
00046   void closed();
00047 };
00048 
00049 
00050 
00051 #endif // QTMWINDOW_HPP