Reply
Thread Tools
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#1
Hi,

I would like the output of 'model.platform' to be displayed in bold font for easier viewing at a glance.

The code snippet as it stands;

Code:
            Label {
                id: platformLabel
                text: {
                    if  (model.platform ==="") platformLabel.text ="Platform -"
                    else platformLabel.text="Platform " + model.platform
                }
'model.platform' simply displays a number for the particular platform but how can I make it so the platform number is bold?

I found it easy enough to make the label 'Platform' show in bold by simply adding "<b>Platform</b>", but this doesn't apply with 'model.platform', how to proceed?

Thanks,
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following User Says Thank You to Markkyboy For This Useful Post:
coderus's Avatar
Posts: 6,436 | Thanked: 12,699 times | Joined on Nov 2011 @ Ängelholm, Sweden
#2
wtf is this ...
Code:
text: 'Platform <b>%1</b>'.arg(model.platform || '-')
__________________
Telegram | Openrepos | GitHub | Revolut donations
 

The Following User Says Thank You to coderus For This Useful Post:
Markkyboy's Avatar
Posts: 433 | Thanked: 727 times | Joined on Oct 2012 @ Costa Blanca, Espaņa
#3
Originally Posted by coderus View Post
wtf is this ...
Code:
text: 'Platform <b>%1</b>'.arg(model.platform || '-')
lol, well, it's a line of f**king code from someone else's application (https://openrepos.net/content/mgrover/nationalrail-uk).
I'm not sure why you have to be so coarse with your responses but your answer is spot on; thank you.
__________________
..oO(Don't just sit there standing around, pick up a shovel and sweep up!)Oo..
 

The Following 2 Users Say Thank You to Markkyboy For This Useful Post:
Reply

Thread Tools

 
Forum Jump


All times are GMT. The time now is 17:09.