HOWTO display Label text with different text styles

Moderator: Rathinagiri

Post Reply
Ricci
Posts: 255
Joined: Thu Nov 19, 2009 2:23 pm

HOWTO display Label text with different text styles

Post by Ricci »

You like to diplay one LABEL with different text styles (normal, bold, italic, diff. colors, etc.) ?
This is very simle in HMG4.

LABEL is based on QLabel() and this widget understand XHTML. The only thing you need to know are CSS commands.

Code: Select all

DEFINE LABEL oLabel
		 ROW 10; COL  10
		 WIDTH 100; HEIGHT 20
		 VALUE "Normal <em>italic</em> <span style='color:red;'>Red</span> Normal"
END LABEL
Will display: Normal italic Red Normal


Ricci
User avatar
Pablo César
Posts: 4059
Joined: Wed Sep 08, 2010 1:18 pm
Location: Curitiba - Brasil

Re: HOWTO display Label text with different text styles

Post by Pablo César »

Very very interesting ! Thanks for your info.
HMGing a better world
"Matter tells space how to curve, space tells matter how to move."
Albert Einstein
Rossine
Posts: 87
Joined: Thu Jun 30, 2011 10:04 pm

Re: HOWTO display Label text with different text styles

Post by Rossine »

Ricci wrote:You like to diplay one LABEL with different text styles (normal, bold, italic, diff. colors, etc.) ?
This is very simle in HMG4.

LABEL is based on QLabel() and this widget understand XHTML. The only thing you need to know are CSS commands.

Code: Select all

DEFINE LABEL oLabel
		 ROW 10; COL  10
		 WIDTH 100; HEIGHT 20
		 VALUE "Normal <em>italic</em> <span style='color:red;'>Red</span> Normal"
END LABEL
Will display: Normal italic Red Normal


Ricci
Hi Ricci,

I'm really amazed with the possibilities HMG.4 + QT is giving us.

Thanks to all who are making this possible :shock:

Rossine
Post Reply