CycloBranch
cModificationsWidget.h
Go to the documentation of this file.
1
7#ifndef _CMODIFICATIONSWIDGET_H
8#define _CMODIFICATIONSWIDGET_H
9
10#include <QWidget>
11#include <QDesktopServices>
12#include <QUrl>
13#include <QFileInfo>
14#include <QMainWindow>
15#include <QToolBar>
16#include <QAction>
17#include <QTableView>
18#include <QStandardItemModel>
19#include <QStandardItem>
20#include <QComboBox>
21#include <fstream>
22#include "core/utilities.h"
24#include "core/cFragmentIons.h"
28
29
30// forward declaration
31class QHBoxLayout;
32class QVBoxLayout;
33class QPushButton;
34class QLineEdit;
35class QMenuBar;
36class QMenu;
37
38
42class cModificationsWidget : public QMainWindow
43{
44 Q_OBJECT
45
46public:
47
48
54 cModificationsWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0);
55
56
61
62
67 void closeEvent(QCloseEvent *event);
68
69
74 void applyGlobalPreferences(cGlobalPreferences* globalpreferences);
75
76
77private:
78
79 QString editorname;
80
81 QWidget* parent;
82
83 cGlobalPreferences* globalpreferences;
84
85 QMenuBar* menuBar;
86 QMenu* menuFile;
87 QMenu* menuEdit;
88 QMenu* menuHelp;
89
90 QToolBar* toolbarFile;
91 QAction* actionNewDatabase;
92 QAction* actionOpenDatabase;
93 QAction* actionSaveDatabase;
94 QAction* actionSaveDatabaseAs;
95 QAction* actionImportDatabase;
96 QAction* actionCloseWindow;
97
98 QToolBar* toolbarEdit;
99 QAction* actionAddRow;
100 QAction* actionRemoveSelectedRows;
101 QAction* actionSelectAll;
102 QAction* actionUnselectAll;
103
104 QToolBar* toolbarHelp;
105 QAction* actionHTMLDocumentation;
106
107 QToolBar* toolbarFilter;
108 QWidget* rowsfilterwidget;
109 QHBoxLayout* rowsfilterhbox;
110 QComboBox* rowsfilteroperator;
111 QComboBox* rowsfiltercombobox1;
112 QComboBox* rowsfiltercomparatorcombobox1;
113 QLineEdit* rowsfilterline1;
114 QComboBox* rowsfiltercombobox2;
115 QComboBox* rowsfiltercomparatorcombobox2;
116 QLineEdit* rowsfilterline2;
117 QCheckBox* rowsfiltercasesensitive;
118 QCheckBox* rowsfilterwholeword;
119 QPushButton* rowsfilterbutton;
120 QPushButton* rowsfilterclearbutton;
121
122 QTableView* database;
123 QStandardItemModel* databasemodel;
124 cModificationsProxyModel* proxymodel;
125 QVBoxLayout* mainlayout;
126 QWidget* mainwidget;
127
128 QString databasefile;
129 QString lastdir;
130 ifstream inputstream;
131 ofstream outputstream;
132 vector<cFragmentIonType> modifications;
133
134 bool datamodified;
135
136 void deleteTable();
137
138 void resetHeader();
139
140 bool checkTable();
141
142 bool checkFormula(int row, const string& summary);
143
144 void setDataModified(bool datamodified);
145
146protected:
147
148
153 void keyPressEvent(QKeyEvent *event);
154
155
156private slots:
157
158 void closeWindow();
159
160 void openDatabase();
161
162 bool saveDatabase();
163
164 bool saveDatabaseAs();
165
166 void saveDatabaseCheck();
167
168 void addRow();
169
170 void removeSelectedRows();
171
172 void itemChanged(QStandardItem* item);
173
174 void headerItemClicked(int index);
175
176 void filterRows();
177
178 void resetFilter();
179
180 void createNewDatabase();
181
182 void importDatabase();
183
184 void selectAll();
185
186 void unselectAll();
187
188 void showHTMLDocumentation();
189
190};
191
192#endif
A checkbox item delegate.
Basic definitions of fragment ions occurring in the mass spectra.
The representation of a set of peptide sequence candidates.
A proxy model for editor of database of modifications.
The representation of a summary formula.
The class storing global preferences.
Definition: cGlobalPreferences.h:104
A proxy model for editor of database of modifications.
Definition: cModificationsProxyModel.h:21
An editor of N-/C-terminal modifications database.
Definition: cModificationsWidget.h:43
void applyGlobalPreferences(cGlobalPreferences *globalpreferences)
Apply new global preferences.
Definition: cModificationsWidget.cpp:304
cModificationsWidget(cGlobalPreferences *globalpreferences, QWidget *parent=(QWidget *) 0)
The constructor.
Definition: cModificationsWidget.cpp:21
void closeEvent(QCloseEvent *event)
Handle the window close event.
Definition: cModificationsWidget.cpp:298
void keyPressEvent(QKeyEvent *event)
Handle a key press event.
Definition: cModificationsWidget.cpp:406
~cModificationsWidget()
The destructor.
Definition: cModificationsWidget.cpp:254
Auxiliary funtions and structures.