anatomist  5.1.2
3D neuroimaging data viewer
qWinTree.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 ANAQT_CONTROL_QWINTREE_H
36 #define ANAQT_CONTROL_QWINTREE_H
37 
38 
39 #include <qwidget.h>
40 #include <map>
41 #include <string>
42 #include <set>
43 #include <qglobal.h>
44 
45 class QPixmap;
46 class QTreeWidgetItem;
47 class QTreeWidget;
48 
49 
50 namespace anatomist
51 {
52  class AWindow;
53 }
54 
55 
58 class QWindowTree : public QWidget
59 {
60  Q_OBJECT
61 
62 public:
63  QWindowTree( QWidget* parent, const char *name );
64  virtual ~QWindowTree();
65 
66  virtual void registerWindow( anatomist::AWindow* obj );
67  virtual void unregisterWindow( anatomist::AWindow* obj );
68  virtual void NotifyWindowChange( anatomist::AWindow* obj );
69 
70  virtual std::set<anatomist::AWindow *> *SelectedWindows() const;
71  std::set<int> SelectedGroups() const;
72  virtual void SelectWindow( anatomist::AWindow *obj );
73  virtual bool isWindowSelected( anatomist::AWindow* obj ) const;
74  virtual void UnselectAll();
75  void SelectGroup( int group );
76 
78  virtual bool ViewingRefColors() const;
79  virtual void ToggleRefColorsView();
80  virtual void DisplayRefColors();
81  virtual void UndisplayRefColors();
82 
83  static unsigned RefPixSize;
84  static QPixmap *LinkIcon;
85 
86 signals:
89 
90 protected:
91  virtual QTreeWidgetItem* insertWindow( QTreeWidgetItem* item,
92  anatomist::AWindow* obj );
93  virtual QTreeWidgetItem* insertWindow( QTreeWidget* lview,
94  anatomist::AWindow* obj );
95  virtual void decorateItem( QTreeWidgetItem* item, anatomist::AWindow* obj );
96  virtual void dragEnterEvent( QDragEnterEvent* );
97  virtual void dragMoveEvent( QDragMoveEvent* );
98  bool dragMoveEventFromObject( QDragMoveEvent* );
99  bool dragMoveEventFromWindow( QDragMoveEvent* );
100  virtual void dragLeaveEvent( QDragLeaveEvent* );
101  virtual void dropEvent( QDropEvent* );
102  void dropEventFromObject( QDropEvent* );
103  void dropEventFromWindow( QDropEvent* );
104  void highlightWindow( anatomist::AWindow *win, bool state );
106 
107 public slots:
108  virtual void startDragging( QTreeWidgetItem*, Qt::MouseButtons,
109  Qt::KeyboardModifiers );
110  void sortIndicatorChanged( int, Qt::SortOrder );
111 
112 protected slots:
113  void doubleClickedSlot( QTreeWidgetItem *, int );
115  void itemChanged( QTreeWidgetItem *, int );
117 
118 private:
119  struct Private;
120  Private *d;
121 };
122 
123 
124 #endif
#define slots
Qt window tree widget for the control wondow.
Definition: qWinTree.h:59
void clearWindowsHighlights()
void sortIndicatorChanged(int, Qt::SortOrder)
virtual void NotifyWindowChange(anatomist::AWindow *obj)
virtual QTreeWidgetItem * insertWindow(QTreeWidget *lview, anatomist::AWindow *obj)
QWindowTree(QWidget *parent, const char *name)
void SelectGroup(int group)
virtual void DisplayRefColors()
static unsigned RefPixSize
Definition: qWinTree.h:83
virtual std::set< anatomist::AWindow * > * SelectedWindows() const
virtual void registerWindow(anatomist::AWindow *obj)
virtual ~QWindowTree()
virtual QTreeWidgetItem * insertWindow(QTreeWidgetItem *item, anatomist::AWindow *obj)
void raiseDropWindows()
virtual void dragLeaveEvent(QDragLeaveEvent *)
void dropEventFromObject(QDropEvent *)
virtual void dragMoveEvent(QDragMoveEvent *)
void unselectInvisibleItems()
void doubleClicked(anatomist::AWindow *)
virtual void UndisplayRefColors()
virtual void ToggleRefColorsView()
virtual void SelectWindow(anatomist::AWindow *obj)
std::set< int > SelectedGroups() const
void itemChanged(QTreeWidgetItem *, int)
void dropEventFromWindow(QDropEvent *)
virtual void dropEvent(QDropEvent *)
virtual void startDragging(QTreeWidgetItem *, Qt::MouseButtons, Qt::KeyboardModifiers)
virtual void UnselectAll()
void selectionChanged()
void highlightWindow(anatomist::AWindow *win, bool state)
virtual bool isWindowSelected(anatomist::AWindow *obj) const
virtual void dragEnterEvent(QDragEnterEvent *)
static QPixmap * LinkIcon
Definition: qWinTree.h:84
bool dragMoveEventFromObject(QDragMoveEvent *)
bool dragMoveEventFromWindow(QDragMoveEvent *)
void doubleClickedSlot(QTreeWidgetItem *, int)
virtual void decorateItem(QTreeWidgetItem *item, anatomist::AWindow *obj)
virtual bool ViewingRefColors() const
Are reference colors markers visible ?
virtual void unregisterWindow(anatomist::AWindow *obj)
Abstract base class Anatomist window.
Definition: Window.h:58