anatomist  5.0.5
3D neuroimaging data viewer
qwindow.h
Go to the documentation of this file.
1 /* This software and supporting documentation are distributed by
2  * Institut Federatif de Recherche 49
3  * CEA/NeuroSpin, Batiment 145,
4  * 91191 Gif-sur-Yvette cedex
5  * France
6  *
7  * This software is governed by the CeCILL-B license under
8  * French law and abiding by the rules of distribution of free software.
9  * You can use, modify and/or redistribute the software under the
10  * terms of the CeCILL-B license as circulated by CEA, CNRS
11  * and INRIA at the following URL "http://www.cecill.info".
12  *
13  * As a counterpart to the access to the source code and rights to copy,
14  * modify and redistribute granted by the license, users are provided only
15  * with a limited warranty and the software's author, the holder of the
16  * economic rights, and the successive licensors have only limited
17  * liability.
18  *
19  * In this respect, the user's attention is drawn to the risks associated
20  * with loading, using, modifying and/or developing or reproducing the
21  * software by the user in light of its specific status of free software,
22  * that may mean that it is complicated to manipulate, and that also
23  * therefore means that it is reserved for developers and experienced
24  * professionals having in-depth computer knowledge. Users are therefore
25  * encouraged to load and test the software's suitability as regards their
26  * requirements in conditions enabling the security of their systems and/or
27  * data to be ensured and, more generally, to use and operate it in the
28  * same conditions as regards security.
29  *
30  * The fact that you are presently reading this means that you have had
31  * knowledge of the CeCILL-B license and that you accept its terms.
32  */
33 
34 
35 #ifndef ANATOMIST_WINDOW_QWINDOW_H
36 #define ANATOMIST_WINDOW_QWINDOW_H
37 
38 #include <qmainwindow.h>
41 
42 
43 namespace anatomist
44 {
45  struct QAWindow_PrivateData;
46 }
47 
49 class QAWindow : public QMainWindow, public anatomist::AWindow,
51 {
52  Q_OBJECT
53 
54 public:
55 
56  QAWindow( QWidget* parent = 0, const char* name = 0,
57  carto::Object params = carto::none(),
58  Qt::WindowFlags f = 0 );
59  virtual ~QAWindow();
60 
61  virtual void setGeometry( int x, int y, unsigned w, unsigned h );
62  virtual void geometry( int *x, int *y, unsigned *w, unsigned *h );
63 
64  virtual void show();
65  virtual void hide();
66  virtual void iconify();
67  virtual void unIconify();
68  virtual bool close();
69  virtual void showToolBars( int state = 2 );
70  void setFullScreen( int state = 2 );
71  bool isFullScreen() const;
72  virtual void setTitle( const std::string & name );
73  virtual void enableDetachMenu( bool x );
74 
82  void Refresh();
83  virtual QToolBar* addToolBar( const QString & title, const QString & name );
84  virtual void addToolBar( QToolBar*, const QString & name );
85  virtual void addToolBar( Qt::ToolBarArea area, QToolBar* toolbar,
86  const QString & name );
87  virtual void removeToolBar( QToolBar * toolbar );
88  virtual QToolBar* removeToolBar( const QString & name );
89  QToolBar* toolBar( const QString & name );
90  void setDetachMenuAction( QAction* );
91 
92 public slots:
96  virtual void refreshNow();
97  virtual bool needsRedraw() const;
99  virtual void detach();
100  virtual void toggleToolBars();
101  virtual void toggleFullScreen();
103  void triggeredRefresh();
104 
105 protected:
106  virtual void createTitle();
107  virtual void dragEnterEvent( QDragEnterEvent* );
108  virtual void dragMoveEvent( QDragMoveEvent* );
109  virtual void dropEvent( QDropEvent* );
110  virtual void mouseMoveEvent( QMouseEvent * e );
111  /* in qt4 we have to find a way to catch close events and prevent deletion
112  if ref-counting doesn't allow it */
113  virtual void closeEvent( QCloseEvent * event );
114 
115 private:
116  struct Private;
117  Private *d;
118 
119 };
120 
121 
122 #endif
Anatomist window with Qt.
Definition: qwindow.h:49
Abstract base class Anatomist window.
Definition: Window.h:57
#define slots
Object none()