text - How to work with Qml Fonttype in javascript? -


that I have the following problem, which pop up when using the blanket and work with fonts.

I use and then dynamically, the following code to select the fonts of different sizes (

  function getValueFontDefault (valueAreaHeight, valueAreaWidth) {var font = [ for font0, font1, font2, font3] (termination fonts var font) {if (fontCandidate.pixelSize & lt; = valueAreaHeight) {checkTextDummy.font = fontCandidate; If (checkTextDummy.paintedWidth & lt; = valueAreaWidth) { break;}}} return Fontkhandi;} text {id: checkTextDummy visible: the incorrect text: "the longest example text thinking"}  

fonts type "font" in QML Are My problem is that JavaScript can not put them in "var" It is always said that fontCandidate.pixelSize was undefined. Do not use loops on various fonts, but use them explicitly (i.e., font0 .pixelSize), it works.

so I behave the Kyuemel fonts JavaScript?

Thank you very much for your help!

Greetings from Germany

That is, I went to find the problem it had nothing to do with the Kyuemel and JavaScript, but with my lack of knowledge with JS.

Actually there is no one to take for me for loop. They are simple to loop it is applied correctly:

  for (var idx in fonts) {var fontCandidate = fonts [idx] checkTextDummy.font = fontCandidate  

And then it works as intended, thanks for your help anyway.


Comments

Popular posts from this blog

apache - 504 Gateway Time-out The server didn't respond in time. How to fix it? -

c# - .net WebSocket: CloseOutputAsync vs CloseAsync -

c++ - How to properly scale qgroupbox title with stylesheet for high resolution display? -