Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. QML and Qt Quick
  4. QML doesn't show enough space between space characters

QML doesn't show enough space between space characters

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 2 Posters 2.3k Views 1 Watching
  • 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.
  • K Offline
    K Offline
    koliva
    wrote on last edited by A Former User
    #1

    Hi all,
    My qml works generally fine but I have an issue with texts which contains more than one spaces next to each other. For example,
    ThisTextIs                   aText.

    Above text is shown something like
    ThisTextIs aText.

    So the spaces seem to be ignored somehow. Does anyone know why would that be?

    Btw: After submitting this question, I realized that this form does exactly the same behavior. First text has some more spaces in between ThisTextIs and aText. but not shown for some reason.

    Edited: - p3c0

    1 Reply Last reply
    0
    • K Offline
      K Offline
      koliva
      wrote on last edited by
      #2

      Well, apparently it is in HTML specification to have a compact text, therefore ignore multiple spaces. Is this the same in QML? Is there any way to show the text as is (with multiple of spaces).

      1 Reply Last reply
      0
      • p3c0P Offline
        p3c0P Offline
        p3c0
        Moderators
        wrote on last edited by
        #3

        @koliva I edited the post to add space. The forum uses HTML type syntax so it seems to ignore spaces between text unless explicitly we add &nbsp between them.
        Now coming to the actual question. How are you displaying the text in QML ?

        157

        K 1 Reply Last reply
        0
        • p3c0P p3c0

          @koliva I edited the post to add space. The forum uses HTML type syntax so it seems to ignore spaces between text unless explicitly we add &nbsp between them.
          Now coming to the actual question. How are you displaying the text in QML ?

          K Offline
          K Offline
          koliva
          wrote on last edited by
          #4

          @p3c0

          Like this:

          http://paste.ofcode.org/PLR2iRn8F7jHXXBZnTFV8D

          1 Reply Last reply
          0
          • p3c0P Offline
            p3c0P Offline
            p3c0
            Moderators
            wrote on last edited by
            #5

            @koliva You have not set text for Text Item.

            157

            K 1 Reply Last reply
            0
            • p3c0P p3c0

              @koliva You have not set text for Text Item.

              K Offline
              K Offline
              koliva
              wrote on last edited by
              #6

              @p3c0

              I see, but set to what?

              1 Reply Last reply
              0
              • p3c0P Offline
                p3c0P Offline
                p3c0
                Moderators
                wrote on last edited by
                #7

                @koliva TextMetrics's text ?

                Text {
                    text: messageMetrics.text
                }
                

                157

                K 1 Reply Last reply
                0
                • p3c0P p3c0

                  @koliva TextMetrics's text ?

                  Text {
                      text: messageMetrics.text
                  }
                  
                  K Offline
                  K Offline
                  koliva
                  wrote on last edited by
                  #8

                  @p3c0

                  Hi,

                  I added this change but it seems it doesn't still work.

                  1 Reply Last reply
                  0
                  • p3c0P Offline
                    p3c0P Offline
                    p3c0
                    Moderators
                    wrote on last edited by
                    #9

                    @koliva Can you post a complete minimal sample code which can reproduce the problem ?

                    157

                    1 Reply Last reply
                    0

                    • Login

                    • Login or register to search.
                    • First post
                      Last post
                    0
                    • Categories
                    • Recent
                    • Tags
                    • Popular
                    • Users
                    • Groups
                    • Search
                    • Get Qt Extensions
                    • Unsolved