Debian Codegraph @

avogadro/qtplugins/propertytables/propertyview.h

raw
1 /******************************************************************************
2 This source file is part of the Avogadro project.
3 This source code is released under the 3-Clause BSD License, (see "LICENSE").
4 ******************************************************************************/
5
6 #ifndef AVOGADRO_QTPLUGINS_PROPERTYVIEW_H
7 #define AVOGADRO_QTPLUGINS_PROPERTYVIEW_H
8
9 #include "propertymodel.h"
10
11 #include <QtWidgets/QTableView>
12
13 class QProgressDialog;
14 namespace Avogadro {
15
16 namespace QtGui {
17 class Molecule;
18 }
19
20 class PropertyView : public QTableView
21 {
22 Q_OBJECT
23 public:
24 explicit PropertyView(PropertyType type, QWidget* parent = nullptr);
25
26 void selectionChanged(const QItemSelection& selected,
27 const QItemSelection& previous) override;
28 void setMolecule(QtGui::Molecule* molecule);
29 void setSourceModel(PropertyModel* model) { m_model = model; }
30 void hideEvent(QHideEvent* event) override;
31 void contextMenuEvent(QContextMenuEvent* event) override;
32
33 protected:
34 // copy the selected properties to the clipboard
35 void keyPressEvent(QKeyEvent* event) override;
36 bool edit(const QModelIndex& index, EditTrigger trigger,
37 QEvent* event) override;
38
39 private:
40 PropertyType m_type;
41 QtGui::Molecule* m_molecule;
42 PropertyModel* m_model;
43 bool m_updatingSelection = false;
44 bool m_inColorEdit = false;
45 void copySelectedRowsToClipboard();
46 void openExportDialogBox();
47 void constrainSelectedRows();
48 void unconstrainSelectedRows();
49
50 void setFrozen(bool frozen);
51 void freezeAtom();
52 void unfreezeAtom();
53 void freezeX();
54 void freezeY();
55 void freezeZ();
56 void freezeAxis(int axis);
57 void changeChargeType();
58 };
59
60 } // end namespace Avogadro
61
62 #endif