anatomist 6.0.4
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
43namespace anatomist
44{
45 struct QAWindow_PrivateData;
46}
47
49class QAWindow : public QMainWindow, public anatomist::AWindow,
51{
52 Q_OBJECT
53
54public:
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 virtual 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
98 virtual void update( const anatomist::Observable* observable, void* arg )
99 { anatomist::AWindow::update( observable, arg ); }
101 virtual void dropEvent( QDropEvent* );
102
103public slots:
107 virtual void refreshNow();
108 virtual bool needsRedraw() const;
110 virtual void detach();
111 virtual void toggleToolBars();
112 virtual void toggleFullScreen();
115
116protected:
117 virtual void createTitle();
118 virtual void dragEnterEvent( QDragEnterEvent* );
119 virtual void dragMoveEvent( QDragMoveEvent* );
120 virtual void mouseMoveEvent( QMouseEvent * e );
121 /* in qt4 we have to find a way to catch close events and prevent deletion
122 if ref-counting doesn't allow it */
123 virtual void closeEvent( QCloseEvent * event );
124
125private:
126 struct Private;
127 Private *d;
128
129};
130
131
132#endif
#define slots
virtual void setTitle(const std::string &name)
virtual void dragMoveEvent(QDragMoveEvent *)
virtual void setGeometry(int x, int y, unsigned w, unsigned h)
virtual QToolBar * removeToolBar(const QString &name)
void setFullScreen(int state=2)
virtual void show()
virtual void dragEnterEvent(QDragEnterEvent *)
virtual void update(const anatomist::Observable *observable, void *arg)
overloaded to avoid a problem in sip bindings
Definition qwindow.h:98
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 * addToolBar(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 void toggleFullScreen()
virtual void closeEvent(QCloseEvent *event)
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 Refresh()
In QAWindows, Refresh() doesn't redraw right now.
virtual QToolBar * insertToolBar(int pos, Qt::ToolBarArea area, const QString &title, const QString &name)
virtual void addToolBar(Qt::ToolBarArea area, QToolBar *toolbar, 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 detachingFromParent() const
virtual QToolBar * addToolBar(const QString &title, const QString &name)
bool isFullScreen() const
QToolBar * toolBar(const QString &name)
virtual ~QAWindow()
virtual void detach()
detach view from a block
Abstract base class Anatomist window.
Definition Window.h:59
virtual void update(const Observable *observable, void *arg)
This method is called whenever the observed object is changed.
This class can be subclassed to represent an object that the programmer wants to have observed.
Definition Observable.h:68
Object none()