Logo ROOT  
Reference Guide
 
Loading...
Searching...
No Matches
RGeomViewerWidget.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 <ROOT/RGeomViewer.hxx>
13#include "RGeomViewerWidget.h"
14
16{
17 setObjectName( "RGeomViewerWidget");
18
19 setSizeIncrement( QSize( 100, 100 ) );
20
21 setUpdatesEnabled( true );
22 setMouseTracking(true);
23
24 setFocusPolicy( Qt::TabFocus );
25 setCursor( Qt::CrossCursor );
26
27 setAcceptDrops(true);
28
29 fGeomViewer = std::make_shared<ROOT::RGeomViewer>();
30
31 fGeomViewer->SetShowHierarchy(false);
32
33 auto where = ROOT::RWebDisplayArgs::GetQt5EmbedQualifier(this, "", QT_VERSION);
34
35 fGeomViewer->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());
44}
45
47{
48}
49
50void RGeomViewerWidget::resizeEvent(QResizeEvent *event)
51{
52 fView->resize(width(), height());
53}
Option_t Option_t width
Option_t Option_t TPoint TPoint const char GetTextMagnitude GetFillStyle GetLineColor GetLineWidth GetMarkerStyle GetTextAlign GetTextColor GetTextSize void char Point_t Rectangle_t height
void resizeEvent(QResizeEvent *event) override
QWebEngineView * fView
qt webwidget to show
RGeomViewerWidget(QWidget *parent=nullptr)
std::shared_ptr< ROOT::RGeomViewer > fGeomViewer
static std::string GetQt5EmbedQualifier(const void *qparent, const std::string &urlopt="", unsigned qtversion=0x50000)
Returns string which can be used as argument in RWebWindow::Show() method to display web window in pr...