20 #include <QMessageBox>
28 setAttribute(Qt::WA_DeleteOnClose);
32 fxQCanvas->setObjectName(
"example");
33 fxQCanvas->getCanvas()->SetName(
"example");
34 fxQCanvas->setEditorFrame(EditorFrame);
35 fxQCanvas->buildEditorWindow();
37 fHisto =
new TH1F(
"h1",
"title", 100, -5, 5);
38 fHisto->FillRandom(
"gaus", 10000);
39 fHisto->SetDirectory(
nullptr);
41 fxQCanvas->getCanvas()->cd();
52 QMessageBox::information(
this,
"QtRoot standalone example",
"Demo how QRootCanvas can be inserted into the QWidget");
57 fxQCanvas->toggleEditor();
60 if (fxQCanvas->isEditorVisible()) {
61 fxQCanvas->activateEditor(fxQCanvas->getCanvas(),
fHisto);
62 fxQCanvas->resizeEditor();
68 fxQCanvas->resizeEditor();