Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
30 commits
Select commit Hold shift + click to select a range
53e3ba5
[qt6canv] introduce qt6canv build option to ROOT
linev Jun 26, 2026
97ecaf9
[qt6canv] add TQt6Canvas and TQt6PadPainter classes
linev Jun 26, 2026
4f230fe
[qt6canv] add plugin fot TQt6Canvas
linev Jun 26, 2026
0ad09ae
[qt6canv] introduce QCanvasWidget
linev Jun 26, 2026
db48d81
[qt6canv] instroduce special widget for paint area
linev Jun 26, 2026
f82881a
[qt6canv] introduce QPaintWidget
linev Jun 29, 2026
99480fc
[qt6canv] use paintEvent for canvas paint
linev Jun 29, 2026
7428fef
[qt6canv] implement text metrics with QFont
linev Jun 29, 2026
558fc75
[qt6canv] implement lines and polylines drawing
linev Jun 29, 2026
18cfa90
[qt6canv] implement fill styles
linev Jun 30, 2026
bca6427
[qt6canv] simple marker painting
linev Jun 30, 2026
2712746
[qt6canv] use scaling factor for the QFont size
linev Jun 30, 2026
9b26716
[qt6canv] correctly convert const char * to QString
linev Jun 30, 2026
3057fc4
[qt6canv] provide mouse events handling
linev Jul 1, 2026
1570b0a
[qt6canv] provide cursors and window title and size
linev Jul 1, 2026
c2ecc9f
[qt6canv] introduce TQt6GuiFactory
linev Jul 2, 2026
9dfe218
[qt6canv] introduce QRootContextMenu
linev Jul 2, 2026
d2995d4
[qt6canv] use list of TContextMenuItem from TClass
linev Jul 2, 2026
6c2e5f6
[qt6canv] implement arguments dialog for context menu
linev Jul 2, 2026
7d5a229
[qt6canv] implement File menu commands
linev Jul 28, 2026
a15645f
[qt6canv] add View menu items
linev Jul 28, 2026
0ffff3a
[qt6canv] implement most buttons in toolbar
linev Jul 28, 2026
e6fc2de
[qt6canv] provide basic attributes editors
linev Jul 28, 2026
4d63bdb
[qt6canv] add enter/leave/wheel handlers
linev Jul 29, 2026
816a872
[qt6canv] provide more documentation
linev Jul 30, 2026
38edab6
[qt6canv] introduce specialized TApplicationImp class
linev Jul 30, 2026
df6388b
[qt6canvas] move QApplication initialization to TQt6Application class
linev Jul 30, 2026
93c95b5
[qt6canvas] return false in TQt6GuiFactory::UseVirtualX()
linev Jul 30, 2026
9d38d41
[qt6canvas] implement markers painting
linev Aug 5, 2026
a7fecce
[qt6canvas] add several checks and missing includes
linev Aug 6, 2026
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .github/CODEOWNERS
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,7 @@
/gui/webdisplay/ @linev
/gui/cefdisplay/ @linev
/gui/qt6webdisplay/ @linev
/gui/qt6canvas/ @linev
/gui/webgui6/ @linev
/gui/fitpanelv7/ @linev
/gui/browsable/ @bellenot @linev
Expand Down
1 change: 1 addition & 0 deletions .github/workflows/root-ci-config/buildconfig/global.txt
Original file line number Diff line number Diff line change
Expand Up @@ -64,6 +64,7 @@ opengl=ON
pyroot=ON
pythia8=OFF
qt6web=OFF
qt6canv=OFF
roofit=ON
roofit_multiprocess=OFF
root7=ON
Expand Down
2 changes: 2 additions & 0 deletions cmake/modules/RootBuildOptions.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -149,6 +149,7 @@ ROOT_BUILD_OPTION(mpi OFF "Enable support for Message Passing Interface (MPI)")
ROOT_BUILD_OPTION(opengl ON "Enable support for OpenGL (requires libGL and libGLU)")
ROOT_BUILD_OPTION(pyroot ON "Enable support for automatic Python bindings (PyROOT)")
ROOT_BUILD_OPTION(pythia8 OFF "Enable support for Pythia 8.x [GPL]")
ROOT_BUILD_OPTION(qt6canv OFF "Enable Qt6 canvas (requires Qt6::Gui)")
ROOT_BUILD_OPTION(qt6web OFF "Enable support for Qt6 web-based display (requires Qt6::WebEngineCore and Qt6::WebEngineWidgets)")
ROOT_BUILD_OPTION(roofit ON "Build the advanced fitting package RooFit, and RooStats for statistical tests. If xml is available, also build HistFactory.")
ROOT_BUILD_OPTION(roofit_multiprocess OFF "Build RooFit::MultiProcess and multi-process RooFit::TestStatistics classes (requires ZeroMQ >= 4.3.5 built with -DENABLE_DRAFTS and cppzmq).")
Expand Down Expand Up @@ -224,6 +225,7 @@ if(all)
set(opengl_defvalue ON)
set(pythia8_defvalue ON)
set(pyroot_defvalue ON)
set(qt6canv_defvalue ON)
set(qt6web_defvalue ON)
set(r_defvalue ON)
set(roofit_defvalue ON)
Expand Down
5 changes: 5 additions & 0 deletions etc/plugins/TCanvasImp/P020_TQt6Canvas.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void P020_TQt6Canvas()
{
gPluginMgr->AddHandler("TCanvasImp", "TQt6Canvas", "ROOT::Experimental::TQt6Canvas",
"ROOTQt6Canvas", "NewCanvas(TCanvas *, const char *, Int_t, Int_t, UInt_t, UInt_t)");
}
5 changes: 5 additions & 0 deletions etc/plugins/TGuiFactory/P020_TQt6GuiFactory.C
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
void P020_TQt6GuiFactory()
{
gPluginMgr->AddHandler("TGuiFactory", "qt6", "ROOT::Experimental::TQt6GuiFactory",
"ROOTQt6Canvas", "TQt6GuiFactory()");
}
4 changes: 4 additions & 0 deletions gui/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,10 @@ add_subdirectory(guihtml)
add_subdirectory(recorder)
add_subdirectory(treemap)

if(qt6canv)
add_subdirectory(qt6canvas)
endif()

if(webgui)
if(cefweb)
add_subdirectory(cefdisplay)
Expand Down
52 changes: 52 additions & 0 deletions gui/qt6canvas/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
# Copyright (C) 1995-2026, Rene Brun and Fons Rademakers.
# All rights reserved.
#
# For the licensing terms see $ROOTSYS/LICENSE.
# For the list of contributors see $ROOTSYS/README/CREDITS.

############################################################################
# CMakeLists.txt file for building ROOT gui/qt6canvas package
############################################################################

find_package(Qt6 COMPONENTS Core Widgets CONFIG)

if(NOT Qt6_FOUND)
if(fail-on-missing)
message(FATAL_ERROR "Could NOT find Qt6 with Gui components")
else()
message(WARNING "Qt6 (Gui) not found, disabling option 'qt6canvas'")
set(qt6canv OFF CACHE BOOL "Disabled because Qt6 Gui not found" FORCE)
return()
endif()
endif()


set(CMAKE_AUTOMOC ON)
set(CMAKE_AUTORCC ON)
set(CMAKE_AUTOUIC ON)
set(CMAKE_INCLUDE_CURRENT_DIR ON)

ROOT_STANDARD_LIBRARY_PACKAGE(ROOTQt6Canvas
HEADERS
TQt6Application.h
TQt6Canvas.h
TQt6PadPainter.h
TQt6GuiFactory.h
SOURCES
src/QCanvasWidget.cpp
src/QPaintWidget.cpp
src/QRootMethodDialog.cpp
src/QRootContextMenu.cpp
src/TQt6Application.cxx
src/TQt6Canvas.cxx
src/TQt6PadPainter.cxx
src/TQt6GuiFactory.cxx
LIBRARIES
Qt6::Core
Qt6::Widgets
DEPENDENCIES
Core
Gpad
)

target_include_directories(ROOTQt6Canvas PRIVATE ${CMAKE_CURRENT_SOURCE_DIR}/src)
Comment thread
linev marked this conversation as resolved.
22 changes: 22 additions & 0 deletions gui/qt6canvas/inc/LinkDef.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
// Author: Sergey Linev, GSI 26/06/2026

/*************************************************************************
* Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

#ifdef __CLING__

#pragma link off all globals;
#pragma link off all classes;
#pragma link off all functions;
Comment thread
linev marked this conversation as resolved.

#pragma link C++ class ROOT::Experimental::TQt6Canvas+;
#pragma link C++ class ROOT::Experimental::TQt6PadPainter+;
#pragma link C++ class ROOT::Experimental::TQt6GuiFactory+;
#pragma link C++ class ROOT::Experimental::TQt6Application+;

#endif
45 changes: 45 additions & 0 deletions gui/qt6canvas/inc/TQt6Application.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
// Author: Sergey Linev 30/07/2026

/*************************************************************************
* Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/


#ifndef ROOT_TQt6Application
#define ROOT_TQt6Application


#include "TApplicationImp.h"

namespace ROOT {
namespace Experimental {

class TQt6Application : public TApplicationImp {
public:
TQt6Application() = delete;
TQt6Application(const char *appClassName, Int_t *argc, char **argv);
~TQt6Application() override;

void Show() override {}
void Hide() override {}
void Iconify() override {}
Bool_t IsCmdThread() override { return kTRUE; }
void Init() override {}
void Open() override {}
void Raise() override {}
void Lower() override {}

static void CreateQApplication(int argc = 0, char **argv = nullptr);

ClassDefOverride(TQt6Application,0) // ROOT Qt6 GUI application environment
};

} // namespace Experimental
} // namespace ROOT


#endif
84 changes: 84 additions & 0 deletions gui/qt6canvas/inc/TQt6Canvas.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,84 @@
// Author: Sergey Linev, GSI 26/06/2026

/*************************************************************************
* Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/

#ifndef ROOT_TQt6Canvas
#define ROOT_TQt6Canvas

#include "TCanvasImp.h"

class QWidget;
class QCanvasWidget;
class QPaintWidget;

namespace ROOT {
namespace Experimental {


class TQt6Canvas : public TCanvasImp {

protected:

QCanvasWidget *fCanvasWidget = nullptr;
QPaintWidget *fPaintWidget = nullptr;

Bool_t fFixedSize = kFALSE; ///<! true when fixed-size canvas is configured
UInt_t fClientBits = 0; ///<! latest status bits from client like editor visible or not

Bool_t PerformUpdate(Bool_t async) override;
TVirtualPadPainter *CreatePadPainter() override;

void AssignStatusBits(UInt_t bits);


public:
TQt6Canvas(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height);
~TQt6Canvas() override;

QPaintWidget *GetPaintWidget() const { return fPaintWidget; }

Int_t InitWindow() override;
void Close() override;
void Show() override;

UInt_t GetWindowGeometry(Int_t &x, Int_t &y, UInt_t &w, UInt_t &h) override;
void GetCanvasGeometry(Int_t wid, UInt_t &w, UInt_t &h) override;
void ResizeCanvasWindow(Int_t) override {}
void UpdateDisplay(Int_t = 0, Bool_t = kFALSE) override {}

void ShowMenuBar(Bool_t = kTRUE) override { }
void ShowStatusBar(Bool_t = kTRUE) override { }
void ShowEditor(Bool_t = kTRUE) override { }
void ShowToolBar(Bool_t = kTRUE) override { }
void ShowToolTips(Bool_t = kTRUE) override { }

void ForceUpdate() override;

void SetWindowPosition(Int_t x, Int_t y) override;
void SetWindowSize(UInt_t w, UInt_t h) override;
void SetWindowTitle(const char *newTitle) override;
void SetCanvasSize(UInt_t w, UInt_t h) override;
void Iconify() override;
void RaiseWindow() override;

Bool_t HasEditor() const override;
Bool_t HasMenuBar() const override;
Bool_t HasStatusBar() const override;
Bool_t HasToolBar() const override { return kFALSE; }
Bool_t HasToolTips() const override;

static TCanvasImp *NewCanvas(TCanvas *c, const char *name, Int_t x, Int_t y, UInt_t width, UInt_t height);

ClassDefOverride(TQt6Canvas, 0) // Qt6 implementation for TCanvasImp
};

} // namespace Experimental
} // namespace ROOT

#endif
43 changes: 43 additions & 0 deletions gui/qt6canvas/inc/TQt6GuiFactory.h
Original file line number Diff line number Diff line change
@@ -0,0 +1,43 @@
// Author: Sergey Linev 2/07/2026

/*************************************************************************
* Copyright (C) 1995-2026, Rene Brun and Fons Rademakers. *
* All rights reserved. *
* *
* For the licensing terms see $ROOTSYS/LICENSE. *
* For the list of contributors see $ROOTSYS/README/CREDITS. *
*************************************************************************/


#ifndef ROOT_TQt6GuiFactory
#define ROOT_TQt6GuiFactory


#include "TGuiFactory.h"

namespace ROOT {
namespace Experimental {

class TQt6GuiFactory : public TGuiFactory {

public:
TQt6GuiFactory(const char *name = "RootQt6", const char *title = "ROOT Qt6 GUI Factory");
~TQt6GuiFactory() override {}

Bool_t UseVirtualX() const override { return kFALSE; }

TApplicationImp *CreateApplicationImp(const char *classname, int *argc, char **argv) override;

TCanvasImp *CreateCanvasImp(TCanvas *c, const char *title, UInt_t width, UInt_t height) override;
TCanvasImp *CreateCanvasImp(TCanvas *c, const char *title, Int_t x, Int_t y, UInt_t width, UInt_t height) override;

TContextMenuImp *CreateContextMenuImp(TContextMenu *c, const char *name, const char *title) override;

ClassDefOverride(TQt6GuiFactory,0) //Factory for Qt6 GUI components
};

} // namespace Experimental
} // namespace ROOT


#endif
Loading
Loading