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. Text Qml overflow

Text Qml overflow

Scheduled Pinned Locked Moved QML and Qt Quick
7 Posts 3 Posters 6.3k Views
  • 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.
  • Malek_KhlifM Offline
    Malek_KhlifM Offline
    Malek_Khlif
    wrote on last edited by
    #1

    Hello everybody

    how can i make Text overflow hidden in Qml ?

    I Love Qt <3

    p3c0P T 2 Replies Last reply
    0
    • Malek_KhlifM Malek_Khlif

      Hello everybody

      how can i make Text overflow hidden in Qml ?

      p3c0P Offline
      p3c0P Offline
      p3c0
      Moderators
      wrote on last edited by
      #2

      @Malek_Khlif Do you mean text wrap ?

      157

      1 Reply Last reply
      1
      • Malek_KhlifM Malek_Khlif

        Hello everybody

        how can i make Text overflow hidden in Qml ?

        T Offline
        T Offline
        tarod.net
        wrote on last edited by tarod.net
        #3

        @Malek_Khlif For example, using this code, you'll see "very long" instead of the complete text.

        Text {
            id: text_field
            height: 40
            width: 40
            text: "very long text"
            color: "red"
            clip: true
        }
        

        You have to use the clip property.

        "Individually, we are one drop. Together, we are an ocean."

        p3c0P Malek_KhlifM 2 Replies Last reply
        1
        • T tarod.net

          @Malek_Khlif For example, using this code, you'll see "very long" instead of the complete text.

          Text {
              id: text_field
              height: 40
              width: 40
              text: "very long text"
              color: "red"
              clip: true
          }
          

          You have to use the clip property.

          p3c0P Offline
          p3c0P Offline
          p3c0
          Moderators
          wrote on last edited by
          #4

          @tarod.net clipping is not always a good idea. It should be avoided wherever possible. Here is some more info.
          Here elide can also be used instead.

          157

          T 1 Reply Last reply
          1
          • p3c0P p3c0

            @tarod.net clipping is not always a good idea. It should be avoided wherever possible. Here is some more info.
            Here elide can also be used instead.

            T Offline
            T Offline
            tarod.net
            wrote on last edited by
            #5

            @p3c0 Yeah, I know, but I think @Malek_Khlif is looking for something like clipping rather than eliding.

            Anyway, I agree with you.

            "Individually, we are one drop. Together, we are an ocean."

            1 Reply Last reply
            1
            • T tarod.net

              @Malek_Khlif For example, using this code, you'll see "very long" instead of the complete text.

              Text {
                  id: text_field
                  height: 40
                  width: 40
                  text: "very long text"
                  color: "red"
                  clip: true
              }
              

              You have to use the clip property.

              Malek_KhlifM Offline
              Malek_KhlifM Offline
              Malek_Khlif
              wrote on last edited by
              #6

              @tarod.net Thank you very much :))))) this is what i want

              I Love Qt <3

              T 1 Reply Last reply
              0
              • Malek_KhlifM Malek_Khlif

                @tarod.net Thank you very much :))))) this is what i want

                T Offline
                T Offline
                tarod.net
                wrote on last edited by tarod.net
                #7

                @Malek_Khlif Wonderful! You're welcome! :)

                Oh, by the way, please mark the post as solved.

                "Individually, we are one drop. Together, we are an ocean."

                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