anatomist  5.1.2
3D neuroimaging data viewer
labeledit.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_BROWSER_LABELEDIT_H
36 #define ANAQT_BROWSER_LABELEDIT_H
37 
40 #include <qdialog.h>
41 
42 class QCancelLineEdit;
43 class QObjectBrowser;
44 class QTreeWidgetItem;
45 
46 
48 class QLabelEdit : public QDialog
49 {
50  Q_OBJECT
51 
52 public:
53  QLabelEdit( const std::string & text, int x, int y, unsigned w, unsigned h,
55  const std::string & att, QTreeWidgetItem* item,
56  QWidget* parent = theAnatomist->getQWidgetAncestor(), const char* name = 0, Qt::WindowFlags f = Qt::WindowFlags() );
57  QLabelEdit( const std::string & text, int x, int y, unsigned w, unsigned h,
58  QObjectBrowser* br, const std::set<carto::GenericObject*> & ao,
59  const std::string & att, const std::set<QTreeWidgetItem*> & item,
60  QWidget* parent = theAnatomist->getQWidgetAncestor(), const char* name = 0, Qt::WindowFlags f = Qt::WindowFlags() );
62 
63  std::string text() const;
65  std::set<carto::GenericObject*> attributedObjects() const;
66  std::string attrib() const { return( _att ); }
67  QTreeWidgetItem* item() const;
68  std::set<QTreeWidgetItem*> items() const;
69 
71  void receiveValue( const std::string & val );
72 
73 public slots:
74  void accept();
75  void reject();
76 
77 protected:
78  void drawContents( const std::string & text, int x, int y, unsigned w,
79  unsigned h, const char* name );
80 
83  std::string _att;
84 
85 private:
86  struct Private;
87  Private *d;
88 };
89 
90 
91 #endif
anatomist::Anatomist *ANATOMIST_API theAnatomist
Pointer to the Anatomist application.
#define slots
A "cancelable" line edit: hitting 'esc' sends the "cancel()" signal.
Definition: stringEdit.h:47
Editor window for labels (interaction with hierarchies)
Definition: labeledit.h:49
void reject()
carto::GenericObject * attributed() const
std::set< QTreeWidgetItem * > items() const
void drawContents(const std::string &text, int x, int y, unsigned w, unsigned h, const char *name)
std::string text() const
std::set< carto::GenericObject * > attributedObjects() const
QLabelEdit(const std::string &text, int x, int y, unsigned w, unsigned h, QObjectBrowser *br, const std::set< carto::GenericObject * > &ao, const std::string &att, const std::set< QTreeWidgetItem * > &item, QWidget *parent=theAnatomist->getQWidgetAncestor(), const char *name=0, Qt::WindowFlags f=Qt::WindowFlags())
void accept()
std::string attrib() const
Definition: labeledit.h:66
QTreeWidgetItem * item() const
QCancelLineEdit * _le
Definition: labeledit.h:82
std::string _att
Definition: labeledit.h:83
void receiveValue(const std::string &val)
Receive input from a browser (click on a hierarchy)
QObjectBrowser * _browser
Definition: labeledit.h:81
QLabelEdit(const std::string &text, int x, int y, unsigned w, unsigned h, QObjectBrowser *br, carto::GenericObject *ao, const std::string &att, QTreeWidgetItem *item, QWidget *parent=theAnatomist->getQWidgetAncestor(), const char *name=0, Qt::WindowFlags f=Qt::WindowFlags())
Objects browser window.
QWidget * getQWidgetAncestor() const
Gets an empty QWidget that is created in Anatomist application to become a default parent for all Ana...