Print with fraction format in qLabel
-
Hello!, I want to print a fraction with a qlabel , for example
44
__
22Here is my code
ui->lb_fraction->setText(QString::number(44) + "/" + "QString::number(2) ");How Can I do for print as a fraction format that operation??????
-
Hi,
Do you mean something like:
"44\n--\n22"
?
-
Exactly, but I need to print something like that
What I mean is one number multiplied by a fraction. I would prefer to show a html label or CSS styles, but I dont know how to do it.
-
Exactly, but I need to print something like that
What I mean is one number multiplied by a fraction. I would prefer to show a html label or CSS styles, but I dont know how to do it.
@Isidro-Perla
Hi
Could you not just use 3 labels and the line widget?You can make it a reusable widget so you can easily have more if needed.
-
Exactly, but I need to print something like that
What I mean is one number multiplied by a fraction. I would prefer to show a html label or CSS styles, but I dont know how to do it.
@Isidro-Perla said in Print with fraction format in qLabel:
I would prefer to show a html label or CSS styles
You could try some of these: https://stackoverflow.com/questions/7525977/how-to-write-fraction-value-using-html
...but HTML and CSS don't have very good support for displaying fractions like that.
-
@Isidro-Perla said in Print with fraction format in qLabel:
I would prefer to show a html label or CSS styles
You could try some of these: https://stackoverflow.com/questions/7525977/how-to-write-fraction-value-using-html
...but HTML and CSS don't have very good support for displaying fractions like that.
-
You should take a look at Qwt's MathML renderer.