New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Sub/super-script formatting isn't working for titles in 3D plots #9101
Comments
Keith Brown (2014-06-26T13:07:51): @eXeC64 (2014-07-14T14:15:26): Firstly:
For 3D plots it's specifically choosing to use TeX style superscript and subscript syntax. Now, this could either suggest that it did somehow work once, or it could be to cover up a bug. The bug: Create a 3D plot. Open its properties and set the title to " I've investigated both the 2D and 3D plots, and they both just pass a QString into either QwtPlot or QwtPlot3D. So I went digging into QwtPlot and QwtPlot3D's code to try and figure out why it works for one but not the other. QwtPlot3D uses QPainter::drawText(int x, int y, QString text) to draw onto a QPixmap and then pass the pixel data to OpenGL for drawing. QwtPlot uses QwtTextLabel (based off of QFrame) which then uses QwtText to draw its plot titles. Internally QwtText uses QwtTextEngine, which uses QwtPainter::drawText, which uses QPainter::drawText to draw pixels in a QPixmap. So after all that indirection, they both use QPainter to draw text into a QPixmap. Why one works and not the other remains a mystery, but it looks like to fix this issue would require debugging and modification of QwtPlot3D itself. I've managed to resolve the bug I described above, but actually enabling superscript and subscript in the 3D plot title is going to be an extremely involved affair it seems. @eXeC64 (2014-07-14T14:15:44): Using Refs http://trac.mantidproject.org/mantid/ticket/8256 @eXeC64 (2014-07-14T14:55:41): However, since a smaller, but related, defect (described and fixed above) has been discovered and fixed. This ticket will be marked as 'fixed' and the corrections merged. '''Testing:''' To reproduce the bug described above: Load any data set and create a 3D plot of it. Change one of the labels or the title to " '''Fixed behaviour:''' The text will not be super/subscript when you re-open the label/axis title dialogue, but will still be the markup to represent such formatting. Pressing "Ok" will not cause the title/axis label to disappear. @mantid-roman (2014-07-25T15:20:45): |
Not worth fixing as this will be replaced in M4 |
This issue was originally TRAC 8256
Issue details are blank in trac
Keywords: student
The text was updated successfully, but these errors were encountered: