source: src/UIElements/Views/Qt4/MoleculeList/SpecificItems/QtMoleculeItem_visibility.hpp

Candidate_v1.7.1 stable v1.7.1
Last change on this file was 3054f4a, checked in by Frederik Heber <heber@…>, 10 years ago

QtObserved...Observed now get index on ...Removed() signal.

  • Property mode set to 100644
File size: 1.4 KB
RevLine 
[6d1e0a]1/*
2 * QtMoleculeItem_visibility.hpp
3 *
4 * Created on: Jan 18, 2015
5 * Author: heber
6 */
7
8#ifndef QTMOLECULEITEM_VISIBILITY_HPP_
9#define QTMOLECULEITEM_VISIBILITY_HPP_
10
11// include config.h
12#ifdef HAVE_CONFIG_H
13#include <config.h>
14#endif
15
16#include "UIElements/Views/Qt4/MoleculeList/QtMoleculeItem.hpp"
17
18class QtMoleculeItemFactory;
19
20/** This class contains the visibility of a molecule and keeps it up to date.
21 *
22 */
23class QtMoleculeItem_visibility : public QtMoleculeItem
24{
25 //!> only allow factory to instantiate items
26 friend class QtMoleculeItemFactory;
27
28 QtMoleculeItem_visibility(
[7993fe]29 QtObservedMolecule::ptr &_ObservedMolecule) :
[3054f4a]30 id(_ObservedMolecule->getIndex())
[b9680b]31 {
[6d1e0a]32 setFlags(flags() | Qt::ItemIsUserCheckable);
33 setCheckState(Qt::Unchecked);
34 // cannot call pure virtual function in QtMoleculeItem's cstor
[b65879]35 updateState(_ObservedMolecule);
[6d1e0a]36 }
37
38 /** Performs the update of the molecule's visibility.
39 *
[b65879]40 * \param _ObservedMolecule object to update state from
[6d1e0a]41 */
[b65879]42 void updateState(const QtObservedMolecule::ptr &_ObservedMolecule)
[6d1e0a]43 {}
44
[fcdf05]45 QtMoleculeItem::COLUMNTYPES getType() const
46 { return QtMoleculeItem::VISIBILITY; }
[b65879]47
48 /** Getter for the id of the observed molecule for this item.
49 *
50 * \return id of the observed molecule
51 */
[3054f4a]52 ObservedValue_Index_t getMoleculeIndex() const
[b65879]53 { return id; }
54
55private:
[3054f4a]56 const ObservedValue_Index_t id;
[6d1e0a]57};
58
59
60
61#endif /* QTMOLECULEITEM_VISIBILITY_HPP_ */
Note: See TracBrowser for help on using the repository browser.