aimsgui  5.1.2
labelselector_p.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 license version 2 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 license version 2 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 license version 2 and that you accept its terms.
32  */
33 
34 #ifndef AIMS_SELECTION_LABELSELECTOR_P_H
35 #define AIMS_SELECTION_LABELSELECTOR_P_H
36 
37 
40 #include <QListWidget>
41 
42 namespace aims
43 {
44  namespace gui
45  {
46  class LabelSelector;
47  }
48 }
49 
50 
51 class QTreeWidgetItem;
52 
53 
55 {
56  Q_OBJECT
57 
58 public:
59  SelectBox( aims::gui::LabelSelector* ls, QWidget * parent=0,
60  const char * name=0 );
61  virtual ~SelectBox();
62 
65  void addSelection( const aims::SelectionSet &, const std::string & parent );
67 
68 public slots:
69  void clearAll();
70 
71 protected:
72  virtual void dragEnterEvent( QDragEnterEvent* event );
73  virtual void dragMoveEvent( QDragMoveEvent* event );
74  virtual void dropEvent( QDropEvent* event );
75  void insertUniqueItem( QTreeWidgetItem* parent, const QString & text );
76 
77 protected slots:
79  void rightButtonPressed( QTreeWidgetItem*, const QPoint & pos );
80 
81 private:
82  aims::gui::LabelSelector *_labelsel;
83 };
84 
85 
86 class aims::gui::LabelSelector::ModelBox : public QListWidget
87 {
88  Q_OBJECT
89 
90 public:
91  ModelBox( QWidget* parent = 0 );
92  virtual ~ModelBox();
93 
94 signals:
95 // void itemRightPressed( QTreeWidgetItem *item, const QPoint & pos );
96  void dragStart( QListWidgetItem*, Qt::MouseButtons state,
97  Qt::KeyboardModifiers mod );
98 
99 protected:
100  virtual void mousePressEvent( QMouseEvent* event );
101  virtual void mouseMoveEvent( QMouseEvent* event );
102  virtual void mouseReleaseEvent( QMouseEvent* event );
103 
104 private:
105  struct Private;
106  Private *d;
107 };
108 
109 #endif
110 
#define slots
void mergeSelection(const aims::SelectionSet &)
void deleteSelection()
aims::SelectionSet selection() const
void rightButtonPressed(QTreeWidgetItem *, const QPoint &pos)
virtual void dragEnterEvent(QDragEnterEvent *event)
void addSelection(const aims::SelectionSet &, const std::string &parent)
virtual void dragMoveEvent(QDragMoveEvent *event)
virtual ~SelectBox()
void clearAll()
void insertUniqueItem(QTreeWidgetItem *parent, const QString &text)
SelectBox(aims::gui::LabelSelector *ls, QWidget *parent=0, const char *name=0)
virtual void dropEvent(QDropEvent *event)
void addSelection(const aims::SelectionSet &)
virtual void mousePressEvent(QMouseEvent *event)
virtual void mouseMoveEvent(QMouseEvent *event)
void dragStart(QListWidgetItem *, Qt::MouseButtons state, Qt::KeyboardModifiers mod)
virtual void mouseReleaseEvent(QMouseEvent *event)
Improved QTreeWidget with better selection handling.
Definition: qatreewidget.h:51