OpenMS
SequenceVisualizer.h
Go to the documentation of this file.
1 // Copyright (c) 2002-2023, The OpenMS Team -- EKU Tuebingen, ETH Zurich, and FU Berlin
2 // SPDX-License-Identifier: BSD-3-Clause
3 //
4 // --------------------------------------------------------------------------
5 // $Maintainer: Julianus Pfeuffer $
6 // $Authors: Dhanmoni Nath, Julianus Pfeuffer $
7 // --------------------------------------------------------------------------
8 
9 #ifdef QT_WEBENGINEWIDGETS_LIB
10 #pragma once
11 
12 // OpenMS_GUI config
13 #include <OpenMS/VISUAL/OpenMS_GUIConfig.h>
14 
15 #include <QWidget>
16 #include <QJsonObject>
17 
18 class QWebEngineView;
19 class QWebChannel;
20 
21 namespace Ui
22 {
23  class SequenceVisualizer;
24 }
25 
26 namespace OpenMS
27 {
28  class OPENMS_GUI_DLLAPI Backend : public QObject
29  {
30  Q_OBJECT
31 
32  // We can access the protein and peptide data using SequenceVisualizer.json_data_obj inside JS/HTML resource file
33  Q_PROPERTY(QJsonObject json_data_obj MEMBER m_json_data_obj_ NOTIFY dataChanged_)
34  signals:
35  void dataChanged_();
36 
37  public:
38  QJsonObject m_json_data_obj_;
39  };
40 
41  class OPENMS_GUI_DLLAPI SequenceVisualizer : public QWidget
42  {
43  Q_OBJECT
44 
45  public:
46  explicit SequenceVisualizer(QWidget* parent = nullptr);
47  ~SequenceVisualizer() override;
48 
49 
50  public slots:
51  // this method sets protein and peptide data to m_json_data_obj_.
52  void setProteinPeptideDataToJsonObj(
53  const QString& accession_num,
54  const QString& pro_seq,
55  const QJsonArray& peptides_data);
56 
57  private:
58 
59  Ui::SequenceVisualizer* ui_;
60  Backend backend_;
61  QWebEngineView* view_;
62  QWebChannel* channel_;
63  };
64 }// namespace OpenMS
65 #endif
Main OpenMS namespace.
Definition: FeatureDeconvolution.h:22
Definition: FLASHDeconvWizardBase.h:37