anatomist  5.1.2
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 = Qt::WindowFlags() );
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 QToolBar* addToolBar( Qt::ToolBarArea area, const QString & title,
85  const QString & name );
86  virtual void addToolBar( QToolBar*, const QString & name );
87  virtual void addToolBar( Qt::ToolBarArea area, QToolBar* toolbar,
88  const QString & name );
89  virtual QToolBar* insertToolBar( int pos, Qt::ToolBarArea area,
90  const QString & title,
91  const QString & name );
92  virtual void removeToolBar( QToolBar * toolbar );
93  virtual QToolBar* removeToolBar( const QString & name );
94  QToolBar* toolBar( const QString & name );
95  void setDetachMenuAction( QAction* );
96 
97 public slots:
101  virtual void refreshNow();
102  virtual bool needsRedraw() const;
104  virtual void detach();
105  virtual void toggleToolBars();
106  virtual void toggleFullScreen();
109 
110 protected:
111  virtual void createTitle();
112  virtual void dragEnterEvent( QDragEnterEvent* );
113  virtual void dragMoveEvent( QDragMoveEvent* );
114  virtual void dropEvent( QDropEvent* );
115  virtual void mouseMoveEvent( QMouseEvent * e );
116  /* in qt4 we have to find a way to catch close events and prevent deletion
117  if ref-counting doesn't allow it */
118  virtual void closeEvent( QCloseEvent * event );
119 
120 private:
121  struct Private;
122  Private *d;
123 
124 };
125 
126 
127 #endif
#define slots
Anatomist window with Qt.
Definition: qwindow.h:51
virtual void setTitle(const std::string &name)
virtual void dragMoveEvent(QDragMoveEvent *)
virtual void setGeometry(int x, int y, unsigned w, unsigned h)
void setFullScreen(int state=2)
virtual void show()
virtual void dragEnterEvent(QDragEnterEvent *)
virtual void enableDetachMenu(bool x)
virtual void dropEvent(QDropEvent *)
virtual void addToolBar(QToolBar *, const QString &name)
virtual void refreshNow()
Real drawing function, replacing AWindow::Refresh in subclasses of QAWindow - Don't forget to call QA...
virtual void hide()
virtual QToolBar * insertToolBar(int pos, Qt::ToolBarArea area, const QString &title, const QString &name)
void triggeredRefresh()
calls refreshNow() and cleanup
virtual void showToolBars(int state=2)
Shows or hides all tools (menu, toolbars) around the main view area.
virtual void toggleToolBars()
virtual QToolBar * removeToolBar(const QString &name)
QToolBar * toolBar(const QString &name)
virtual void toggleFullScreen()
virtual void closeEvent(QCloseEvent *event)
void Refresh()
In QAWindows, Refresh() doesn't redraw right now.
QAWindow(QWidget *parent=0, const char *name=0, carto::Object params=carto::none(), Qt::WindowFlags f=Qt::WindowFlags())
virtual void geometry(int *x, int *y, unsigned *w, unsigned *h)
Get position and dimensions of the window.
virtual void unIconify()
void setDetachMenuAction(QAction *)
virtual void iconify()
virtual void mouseMoveEvent(QMouseEvent *e)
virtual void addToolBar(Qt::ToolBarArea area, QToolBar *toolbar, const QString &name)
virtual QToolBar * addToolBar(Qt::ToolBarArea area, const QString &title, const QString &name)
virtual bool needsRedraw() const
virtual void removeToolBar(QToolBar *toolbar)
virtual bool close()
virtual void createTitle()
Creates a new title for the window.
bool isFullScreen() const
virtual ~QAWindow()
virtual void detach()
detach view from a block
virtual QToolBar * addToolBar(const QString &title, const QString &name)
Abstract base class Anatomist window.
Definition: Window.h:58
Object none()