maemo.org - Talk

maemo.org - Talk (https://talk.maemo.org/index.php)
-   SailfishOS (https://talk.maemo.org/forumdisplay.php?f=52)
-   -   Output data in bold font (https://talk.maemo.org/showthread.php?t=99739)

Markkyboy 2017-08-20 11:37

Output data in bold font
 
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,

coderus 2017-08-20 13:04

Re: Output data in bold font
 
wtf is this ...
Code:

text: 'Platform <b>%1</b>'.arg(model.platform || '-')

Markkyboy 2017-08-20 14:07

Re: Output data in bold font
 
Quote:

Originally Posted by coderus (Post 1532919)
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.


All times are GMT. The time now is 00:00.

vBulletin® Version 3.8.8