[EXPERIMENTAL] Introduce Qt6-based implementation for TCanvasImp [skip-ci]#22736
Draft
linev wants to merge 20 commits into
Draft
[EXPERIMENTAL] Introduce Qt6-based implementation for TCanvasImp [skip-ci]#22736linev wants to merge 20 commits into
linev wants to merge 20 commits into
Conversation
These will be core classes to provide Qt6 graphics independent from TVirtualX
Up to now only TRootCanvas and TWebCanvas are supported - all other classes were ignored. Now try to load plugin when something different from TRootCanvas is specified. Also in batch mode use of external canvas should be possible
It implements Qt6 widget with menu, status line and canvas paint area. Details to be implemented
It is specialized QWidget which will handle paint area for the canvas. Start with resize handler to track changes in canvas width and height.
In the Qt one cannot start painting on the canvas in the arbitrary moment - one only can do this inside paintEvent() handler. Therefore only there call pad->Paint method which will invoke correct painting inside Because of this canvas->Update() does not call directly Paint() but uses QWidget::update() which invalidates paint area and invokes paintEvent then. Start implementation of TQt6PadPainter with text drawing. One can use TTF directly with Qt without need to extra handle of fonts ourselfs. Handle color and rotation as well
While text painting done with QFont, also text metrics implement with QFont functionality
Handle TAttLine with custom colors, width and style Create QPen which contains such properties
Support special fill patterns 3000..3025 reusing X11 pixmaps Implement box and fillarea painting
Once generic API exists to paint markers - use it here instead. There are 5 different places in ROOT which repeats again and again all markers implementation
It is not equivalent with TTF font and must be about 0.75
Use QString::toLatin1() method, otherwise special characters like used in symbols.ttf, are handled as utf-8 as displayed wrongly
Like press, move, release mouse button. On the right mouse button actiate context menu. For methods with arguments provide special dialog. Code partially copied from Go4 project and originally was developed in 2002 by Denis Bertini and improved later by Sergey Linev
It fully dismiss standard GUI classes and only allows to create Qt6canvas. Aim to provide specialized implementation for application and context menu
It is implementation for context menu used inside qt6_canvas Idea to let handle right mouse button click in the canvas handler which will invoke implementation class
This is default place where all normal or custom items for the class are collected. By large copy code from TRootContextMenu.
Reuse several methods from TContextMenu to create labels for arguments and afterwards execute selected method with provided list of arguments.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
It is early prototype, please DO NOT MERGE yet.
After setting
Gui.Factory: qt6Qt6-based canvas will be used in ROOT.Painting with
TQt6PadPainterredirected toQPainterclass where all ROOT primitives - polyline, fillarea, polymarkers, line, box, text - are implemented.Different mouse click/move/release events are processed.
Menu implemented with
QMenuBar, status line withQStatusBar.Also context menu is implemented providing TContextMenuImp class.
It includes special dialog for input of method parameters.
Also toggle menu item with checked states should work.
Provided implementation fully avoids
gVirtualXusage - pure Qt graphics is used.TQt6Canvasworks now with basic primitives likeTLatex,TLine,TBoxand with
TH1/TH2classes in 2D and 3D plots.Some ROOT classes may crash while they internally use gVirtualX for event handling.
This is first (but not the only) new graphical backend which can fully replace
gVirtualX-based implementation.After finalizing of API some other - more simpler (like raylib) or more advanced (like Vilkan) - can be exercised.