GSI Object Oriented Online Offline (Go4)  GO4-6.3.0
QRootWindow.h
Go to the documentation of this file.
1 // $Id$
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 QROOTWINDOW_H
15 #define QROOTWINDOW_H
16 
17 #include <QWidget>
18 
19 #include "RtypesCore.h"
20 
21 class QMouseEvent;
22 class QPaintEvent;
23 class TGLayoutHints;
24 class Event_t;
25 class TQRootFrame;
26 class TGFrame;
27 class TGCompositeFrame;
28 
32 class QRootWindow : public QWidget {
33  Q_OBJECT
34 
35  public:
37  QRootWindow( QWidget *parent = nullptr, const char *name = nullptr, bool designermode = false);
38 
39  virtual ~QRootWindow();
40 
41  TGCompositeFrame* GetRootFrame();
42  int GetRootWid() const { return fiWinid; }
43 
45  void AddSubFrame(TGFrame* f, TGLayoutHints* l = nullptr);
46 
48  void SetEditable(bool on=true);
49 
52  void SetResizeOnPaint(bool on = true) { fbResizeOnPaint = on; }
53 
55  double ScaledWidth();
56 
58  double ScaledHeight();
59 
60  protected:
61 
66  bool eventFilter(QObject *, QEvent *) override;
67  void paintEvent(QPaintEvent *e) override;
68  void closeEvent(QCloseEvent *e) override;
69 
70  //virtual QPaintEngine * paintEngine() const { return nullptr; }
71 
73  Bool_t MapQMouseEvent(QMouseEvent *e, Event_t* rev);
74 
78 
80  Int_t fiWinid{0};
82  WId fQtWinId;
83 
87  Bool_t fbResizeOnPaint{kFALSE};
88 
89  double fQtScalingfactor{0};
90 };
91 
92 #endif
double ScaledHeight()
int GetRootWid() const
Definition: QRootWindow.h:42
Int_t fiWinid
Definition: QRootWindow.h:80
bool eventFilter(QObject *, QEvent *) override
double ScaledWidth()
virtual ~QRootWindow()
void SetEditable(bool on=true)
int l
Definition: f_mbs_status.c:31
Bool_t fbResizeOnPaint
Definition: QRootWindow.h:87
void AddSubFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Definition: QRootWindow.cpp:90
void SetResizeOnPaint(bool on=true)
Definition: QRootWindow.h:52
double fQtScalingfactor
Definition: QRootWindow.h:89
void closeEvent(QCloseEvent *e) override
TGCompositeFrame * GetRootFrame()
TQRootFrame * fxRootwindow
Definition: QRootWindow.h:77
void paintEvent(QPaintEvent *e) override
QRootWindow(QWidget *parent=nullptr, const char *name=nullptr, bool designermode=false)
Definition: QRootWindow.cpp:64
Bool_t MapQMouseEvent(QMouseEvent *e, Event_t *rev)