GSI Object Oriented Online Offline (Go4) GO4-6.4.0
Loading...
Searching...
No Matches
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
21class QMouseEvent;
22class QPaintEvent;
23class TGLayoutHints;
24struct Event_t;
25class TQRootFrame;
26class TGFrame;
27class TGCompositeFrame;
28
31
32class 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};
83
87 Bool_t fbResizeOnPaint{kFALSE};
88
90};
91
92#endif
TQRootFrame * fxRootwindow
this is the pseudo root window embedded into this widget.
Definition QRootWindow.h:77
double ScaledHeight()
deliver Height scaled with Qt5 screen scaling factor
void SetEditable(bool on=true)
make this frame to current root master frame.
int GetRootWid() const
Definition QRootWindow.h:42
Int_t fiWinid
ROOT internal window index.
Definition QRootWindow.h:80
bool eventFilter(QObject *, QEvent *) override
Event filter is used to pass Qt mouse events root, after translating them in MapQMouseEvent.
void closeEvent(QCloseEvent *e) override
void SetResizeOnPaint(bool on=true)
switch root frame resize mode on paint event: true=explicit resize, false=no resize of TQRootFrame
Definition QRootWindow.h:52
Bool_t fbResizeOnPaint
switch if paint event does explicit resize of ROOT frame (default) for embedded TGedEditor,...
Definition QRootWindow.h:87
void paintEvent(QPaintEvent *e) override
TGCompositeFrame * GetRootFrame()
WId fQtWinId
Qt window id as received from Qt (may change during runtime?)
Definition QRootWindow.h:82
double ScaledWidth()
deliver width scaled with Qt5 screen scaling factor
double fQtScalingfactor
Definition QRootWindow.h:89
void AddSubFrame(TGFrame *f, TGLayoutHints *l=nullptr)
Add root subframe into this widget.
Bool_t MapQMouseEvent(QMouseEvent *e, Event_t *rev)
translate Qt mouse event into root event structure.
QRootWindow(QWidget *parent=nullptr, const char *name=nullptr, bool designermode=false)
real ctor
virtual ~QRootWindow()
Pseudo root mainframe to wrap root composite frames like TGedEditor.
int l