Qt Forum

    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Unsolved

    Qml problem with font size

    QML and Qt Quick
    2
    4
    1423
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • G
      Galbarad last edited by

      Hi all
      I have problem with font in my application for Android
      I am use this code
      @
      font.pixelSize: 46 * gameField.height / 800
      @
      for scaling font size on different screens
      but I have a problem with at list one device
      !http://gm1.ggpht.com/mJEs2w50CoMkNhdZnF9pT4p16S9FwzgIEJbckd6SdqvKYlPnAwIU62m1ufP3ZThGduz8jA24V3J4Eal1ndpDvNp0JlZalxZGAdWMSDAaGZUte1rihFC4toZsqLQ5cgVFQK7sdcHBrnrw_BNYhs3xs1zbsElpnXy7-YI4Uokv76wb-VnEZohlXklLK3Hz4BmltsSIQoM4F4QwOyJgdtTNRBbbctX0hmo8UdgTTmC1DFp8w6duxoDcq_yDOx_qgr7-G8CEtju9sd7Tc_KDy29pLWDnljCh-qE_hSiN8j77EGTQayE60aEiIxkgG-SvCSxCZb5QG8XlhPCmXxlsKII_zNNlh-Yu-d6evek85gG0C2kaFh6NJgtoHHDwxow5QytQD-pafbLc_wfzXs_eIB5s-aeXTNq_1kwXr-w2GsREjDTPXKdPiwXoPN7nhprDNIlwbC2Oz4vhVlsYEhns7YuJzRE_a4uSn3VybX_DANAOFS1cepCT51ltz2iuEm54a-tgY1rLPmAmCKCPcGyPSXnfigsHZfRwPf7f5XiWemgVPXHEO4LuFgHiQA4MTzVGbVvmUNezxbRYPw=w1886-h849-l75(problem with font qml + android)!

      maybe I should use font.pointSize instead of font.pixelSize ??
      thanks for help

      1 Reply Last reply Reply Quote 0
      • dheerendra
        dheerendra Qt Champions 2022 last edited by

        Better to use the pointSize. Also you can calculate 46/800 only once and use it everywhere. It may little bit performance impact with propertybindings every time.

        Dheerendra
        @Community Service
        Certified Qt Specialist
        http://www.pthinks.com

        1 Reply Last reply Reply Quote 0
        • G
          Galbarad last edited by

          thank you for reply
          I try to use pointSize, but found in log
          @
          QFont::setPointSizeF: Point size <= 0 (0.000000), must be greater than 0
          @

          1 Reply Last reply Reply Quote 0
          • G
            Galbarad last edited by

            switching to pointSize do not help, the same problem
            !https://lh3.googleusercontent.com/-bv71O37AKeo/U8Iwagd8XJI/AAAAAAAAG_Q/wdfXHMnbnBg/w549-h878-no/Screenshot_2014-06-27-18-20-56.png(qml problem)!

            1 Reply Last reply Reply Quote 0
            • First post
              Last post