CycloBranch
cSequenceDatabaseWidget.h
Go to the documentation of this file.
1
7#ifndef _CSEQUENCEDATABASEWIDGET_H
8#define _CSEQUENCEDATABASEWIDGET_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"
29
30
31// forward declaration
32class QHBoxLayout;
33class QVBoxLayout;
34class QPushButton;
35class QLineEdit;
36class QMenuBar;
37class QMenu;
38
39
43class cSequenceDatabaseWidget : public QMainWindow
44{
45 Q_OBJECT
46
47public:
48
49
55 cSequenceDatabaseWidget(cGlobalPreferences* globalpreferences, QWidget* parent = (QWidget *)0);
56
57
62
63
68 void closeEvent(QCloseEvent *event);
69
70
76 void importSequence(int peptidetypeindex, QString sequence);
77
78
83 void applyGlobalPreferences(cGlobalPreferences* globalpreferences);
84
85
86private:
87
88 QString editorname;
89
90 QWidget* parent;
91
92 cGlobalPreferences* globalpreferences;
93
94 QMenuBar* menuBar;
95 QMenu* menuFile;
96 QMenu* menuEdit;
97 QMenu* menuHelp;
98
99 QToolBar* toolbarFile;
100 QAction* actionNewDatabase;
101 QAction* actionOpenDatabase;
102 QAction* actionSaveDatabase;
103 QAction* actionSaveDatabaseAs;
104 QAction* actionImportDatabase;
105 QAction* actionCloseWindow;
106
107 QToolBar* toolbarEdit;
108 QAction* actionAddRow;
109 QAction* actionRemoveSelectedRows;
110 QAction* actionSelectAll;
111 QAction* actionUnselectAll;
112 QAction* actionRemoveDuplicateRows;
113
114 QToolBar* toolbarHelp;
115 QAction* actionHTMLDocumentation;
116
117 QToolBar* toolbarFilter;
118 QWidget* rowsfilterwidget;
119 QHBoxLayout* rowsfilterhbox;
120 QComboBox* rowsfilteroperator;
121 QComboBox* rowsfiltercombobox1;
122 QComboBox* rowsfiltercomparatorcombobox1;
123 QLineEdit* rowsfilterline1;
124 QComboBox* rowsfiltercombobox2;
125 QComboBox* rowsfiltercomparatorcombobox2;
126 QLineEdit* rowsfilterline2;
127 QCheckBox* rowsfiltercasesensitive;
128 QCheckBox* rowsfilterwholeword;
129 QPushButton* rowsfilterbutton;
130 QPushButton* rowsfilterclearbutton;
131
132 QTableView* database;
133 QStandardItemModel* databasemodel;
134 cSequenceDatabaseProxyModel* proxymodel;
135 QVBoxLayout* mainlayout;
136 QWidget* mainwidget;
137
138 QString databasefile;
139 QString lastdir;
140 ifstream inputstream;
141 ofstream outputstream;
142 cSequenceDatabase sequences;
143
144 bool datamodified;
145
146 void deleteTable();
147
148 void resetHeader();
149
150 bool checkTable();
151
152 bool checkFormula(int row, const string& summary);
153
154 bool checkSequence(int row);
155
156 void setDataModified(bool datamodified);
157
158
159protected:
160
161
166 void keyPressEvent(QKeyEvent *event);
167
168
169private slots:
170
171 void closeWindow();
172
173 void openDatabase();
174
175 bool saveDatabase();
176
177 bool saveDatabaseAs();
178
179 void saveDatabaseCheck();
180
181 void addRow();
182
183 void removeSelectedRows();
184
185 void itemChanged(QStandardItem* item);
186
187 void headerItemClicked(int index);
188
189 void filterRows();
190
191 void resetFilter();
192
193 void createNewDatabase();
194
195 void importDatabase();
196
197 void selectAll();
198
199 void unselectAll();
200
201 void showHTMLDocumentation();
202
203 void editItem(const QModelIndex& index);
204
205 void removeDuplicateRows();
206
207};
208
209#endif
A checkbox item delegate.
A combobox item delegate.
The representation of a set of peptide sequence candidates.
The database of sequences.
A proxy model for editor of database of sequences.
A delegate to create a reference view button.
The class storing global preferences.
Definition: cGlobalPreferences.h:104
The class representing a database of sequences.
Definition: cSequenceDatabase.h:27
A proxy model for editor of database of sequences.
Definition: cSequenceDatabaseProxyModel.h:21
An editor of sequences database.
Definition: cSequenceDatabaseWidget.h:44
cSequenceDatabaseWidget(cGlobalPreferences *globalpreferences, QWidget *parent=(QWidget *) 0)
The constructor.
Definition: cSequenceDatabaseWidget.cpp:23
void applyGlobalPreferences(cGlobalPreferences *globalpreferences)
Apply new global preferences.
Definition: cSequenceDatabaseWidget.cpp:332
~cSequenceDatabaseWidget()
The destructor.
Definition: cSequenceDatabaseWidget.cpp:267
void importSequence(int peptidetypeindex, QString sequence)
Import a new sequence.
Definition: cSequenceDatabaseWidget.cpp:318
void keyPressEvent(QKeyEvent *event)
Handle a key press event.
Definition: cSequenceDatabaseWidget.cpp:509
void closeEvent(QCloseEvent *event)
Handle the window close event.
Definition: cSequenceDatabaseWidget.cpp:312
Auxiliary funtions and structures.