GSI Object Oriented Online Offline (Go4)  GO4-6.1.4
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
QWebCanvas.h
Go to the documentation of this file.
1 // $Id: QWebCanvas.h 2743 2020-04-16 07:38:21Z linev $
2 //-----------------------------------------------------------------------
3 // The GSI Online Offline Object Oriented (Go4) Project
4 // Experiment Data Processing at EE department, GSI
5 //-----------------------------------------------------------------------
6 // Copyright (C) 2000- GSI Helmholtzzentrum fuer Schwerionenforschung GmbH
7 // Planckstr. 1, 64291 Darmstadt, Germany
8 // Contact: http://go4.gsi.de
9 //-----------------------------------------------------------------------
10 // This software can be used under the license agreements as stated
11 // in Go4License.txt file which is part of the distribution.
12 //-----------------------------------------------------------------------
13 
14 #ifndef QWEBCANVAS_H
15 #define QWEBCANVAS_H
16 
17 #include <QWidget>
18 #include <QWebEngineView>
19 
20 class TCanvas;
21 class TPad;
22 class TObject;
23 class QTimer;
24 
25 class QWebCanvas : public QWidget {
26 
27  Q_OBJECT
28 
29 public:
30  QWebCanvas(QWidget *parent = 0);
31  virtual ~QWebCanvas();
32 
34  TCanvas *getCanvas() { return fCanvas; }
35 
36  bool isStatusBarVisible();
37  bool isEditorVisible();
38 
39  void Modified();
40  void Update();
41 
42 signals:
43 
44  void CanvasDropEvent(QDropEvent*, TPad*);
45 
46  void CanvasUpdated();
47 
48  void SelectedPadChanged(TPad*);
49 
50  void PadClicked(TPad*,int,int);
51 
52  void PadDblClicked(TPad*,int,int);
53 
54 public slots:
55 
56  void activateEditor(TPad *pad = 0, TObject *obj = 0);
57  void activateStatusLine();
58 
59  void setStatusBarVisible(bool flag = true);
60 
61  void setEditorVisible(bool flag = true);
62 
63 protected slots:
64 
65  void dropView(QDropEvent* event);
66 
67  void processRepaintTimer();
68 
69 protected:
70 
71  virtual void resizeEvent(QResizeEvent *event);
72 
73  virtual void dropEvent(QDropEvent* event);
74 
75  double scaledPosition(int p)
76  {
77  return (double) p * fQtScalingfactor;
78  }
79 
80  void SetPrivateCanvasFields(bool on_init);
81 
83 
84  void ProcessActivePadChanged(TPad *pad) { emit SelectedPadChanged(pad); }
85 
86  void ProcessPadClicked(TPad *pad, int x, int y) { emit PadClicked(pad,x,y); }
87 
88  void ProcessPadDblClicked(TPad *pad, int x, int y) { emit PadDblClicked(pad,x,y); }
89 
90  QWebEngineView *fView;
91 
92  TCanvas *fCanvas;
93 
94  QTimer *fRepaintTimer;
95 
97 };
98 
99 #endif
QTimer * fRepaintTimer
Definition: QWebCanvas.h:94
void activateStatusLine()
Definition: QWebCanvas.cpp:260
bool isStatusBarVisible()
Definition: QWebCanvas.cpp:238
void SelectedPadChanged(TPad *)
void ProcessPadDblClicked(TPad *pad, int x, int y)
Definition: QWebCanvas.h:88
virtual void dropEvent(QDropEvent *event)
Definition: QWebCanvas.cpp:205
void Update()
Definition: QWebCanvas.cpp:276
void CanvasUpdated()
QWebEngineView * fView
qt webwidget to show
Definition: QWebCanvas.h:90
void activateEditor(TPad *pad=0, TObject *obj=0)
Definition: QWebCanvas.cpp:229
QWebCanvas(QWidget *parent=0)
Definition: QWebCanvas.cpp:41
void ProcessCanvasUpdated()
Definition: QWebCanvas.h:82
void ProcessActivePadChanged(TPad *pad)
Definition: QWebCanvas.h:84
void PadClicked(TPad *, int, int)
virtual ~QWebCanvas()
Definition: QWebCanvas.cpp:156
TCanvas * fCanvas
Definition: QWebCanvas.h:92
bool isEditorVisible()
Definition: QWebCanvas.cpp:243
void dropView(QDropEvent *event)
Definition: QWebCanvas.cpp:218
void setEditorVisible(bool flag=true)
Definition: QWebCanvas.cpp:254
void PadDblClicked(TPad *, int, int)
TCanvas * getCanvas()
returns canvas shown in the widget
Definition: QWebCanvas.h:34
virtual void resizeEvent(QResizeEvent *event)
Definition: QWebCanvas.cpp:198
double fQtScalingfactor
Definition: QWebCanvas.h:96
void Modified()
Definition: QWebCanvas.cpp:271
void CanvasDropEvent(QDropEvent *, TPad *)
double scaledPosition(int p)
Definition: QWebCanvas.h:75
void processRepaintTimer()
Definition: QWebCanvas.cpp:266
void setStatusBarVisible(bool flag=true)
Definition: QWebCanvas.cpp:248
void SetPrivateCanvasFields(bool on_init)
Definition: QWebCanvas.cpp:169
void ProcessPadClicked(TPad *pad, int x, int y)
Definition: QWebCanvas.h:86