Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RCanvasWidget.cpp
Go to the documentation of this file.
1// Author: Sergey Linev, GSI 13/01/2021
2
3/*************************************************************************
4 * Copyright (C) 1995-2021, Rene Brun and Fons Rademakers. *
5 * All rights reserved. *
6 * *
7 * For the licensing terms see $ROOTSYS/LICENSE. *
8 * For the list of contributors see $ROOTSYS/README/CREDITS. *
9 *************************************************************************/
10
11#include "RCanvasWidget.h"
12
13#include <ROOT/RCanvas.hxx>
15
17{
18
19 setObjectName( "RCanvasWidget");
20
21 setSizeIncrement( QSize( 100, 100 ) );
22
23 setUpdatesEnabled( true );
24 setMouseTracking(true);
25
26 setFocusPolicy( Qt::TabFocus );
27 setCursor( Qt::CrossCursor );
28
29 setAcceptDrops(true);
30
32
34
35 fCanvas->Show(where);
36
37 fView = findChild<QWebEngineView*>("RootWebView");
38 if (!fView) {
39 printf("FAIL TO FIND QWebEngineView - ROOT Qt5Web plugin does not work properly !!!!!\n");
40 exit(11);
41 }
42
43 fView->resize(width(), height());
45}
46
48{
49 // remove canvas from global lists
50 fCanvas->Remove();
51}
52
53void RCanvasWidget::resizeEvent(QResizeEvent *event)
54{
55 fView->resize(width(), height());
57}
include TDocParser_001 C image html pict1_TDocParser_001 png width
QWebEngineView * fView
qt webwidget to show
virtual ~RCanvasWidget()
RCanvasWidget(QWidget *parent=nullptr)
void resizeEvent(QResizeEvent *event) override
std::shared_ptr< ROOT::Experimental::RCanvas > fCanvas
static std::shared_ptr< RCanvas > Create(const std::string &title)
Create new canvas instance.
Definition RCanvas.cxx:103
static std::string GetQt5EmbedQualifier(const void *qparent, const std::string &urlopt="")
returns string which can be used as argument in RWebWindow::Show() method to display web window in pr...