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. paragraph in TextEdit
QtWS25 Last Chance

paragraph in TextEdit

Scheduled Pinned Locked Moved Unsolved QML and Qt Quick
9 Posts 4 Posters 1.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.
  • S Offline
    S Offline
    ShiroExorcist
    wrote on last edited by
    #1

    Good day! There was a problem in the program using Qt Quick 2 show large chunks of text with specific formatting.
    I tried to use for this and Text and TextEdit, but in the example below, there is no indent of the start paragraph. What properties need to be added to make <p> work?
    TextEdit{
    id:l1TextCaption
    width: parent.width
    height: parent.height
    anchors.fill: parent
    text: "<p><font color = 'red'> input text </font> another text"
    font.pixelSize: 29
    wrapMode:TextEdit.Wrap
    verticalAlignment: Text.AlignJustify
    textFormat: TextEdit.RichText
    readOnly: true
    }

    J 1 Reply Last reply
    0
    • S ShiroExorcist

      Good day! There was a problem in the program using Qt Quick 2 show large chunks of text with specific formatting.
      I tried to use for this and Text and TextEdit, but in the example below, there is no indent of the start paragraph. What properties need to be added to make <p> work?
      TextEdit{
      id:l1TextCaption
      width: parent.width
      height: parent.height
      anchors.fill: parent
      text: "<p><font color = 'red'> input text </font> another text"
      font.pixelSize: 29
      wrapMode:TextEdit.Wrap
      verticalAlignment: Text.AlignJustify
      textFormat: TextEdit.RichText
      readOnly: true
      }

      J Offline
      J Offline
      JasmineSethi
      wrote on last edited by JasmineSethi
      #2

      @ShiroExorcist can u explain a bit more what exactly u want?

      S 1 Reply Last reply
      0
      • J JasmineSethi

        @ShiroExorcist can u explain a bit more what exactly u want?

        S Offline
        S Offline
        ShiroExorcist
        wrote on last edited by ShiroExorcist
        #3

        @JasmineSethi I want to display the text as follows:
        (/TAB/) "A simple large text containing any information about the form that will be read."
        And it turns out:
        "A simple large text containing any information about the form that will be read."
        I can not indent at the beginning of a paragraph
        Styling markup <p> dose not work.

        ODБOïO JonBJ 2 Replies Last reply
        0
        • S ShiroExorcist

          @JasmineSethi I want to display the text as follows:
          (/TAB/) "A simple large text containing any information about the form that will be read."
          And it turns out:
          "A simple large text containing any information about the form that will be read."
          I can not indent at the beginning of a paragraph
          Styling markup <p> dose not work.

          ODБOïO Offline
          ODБOïO Offline
          ODБOï
          wrote on last edited by ODБOï
          #4

          hi
          @ShiroExorcist
          the html pre tag makes spaces visibles

           text: '<pre><p>   spaced text</p></pre>  long text .... !'
          
          1 Reply Last reply
          1
          • S ShiroExorcist

            @JasmineSethi I want to display the text as follows:
            (/TAB/) "A simple large text containing any information about the form that will be read."
            And it turns out:
            "A simple large text containing any information about the form that will be read."
            I can not indent at the beginning of a paragraph
            Styling markup <p> dose not work.

            JonBJ Offline
            JonBJ Offline
            JonB
            wrote on last edited by
            #5

            @ShiroExorcist
            If you intend, or have, text starting with spaces you can use @LeLev 's <pre> tag.

            If you mean you want to style a first-line-only indent as a style on the <p> there is text-indent: 30pt;, or margin-left: 40px; if you mean all lines.

            S 1 Reply Last reply
            1
            • JonBJ JonB

              @ShiroExorcist
              If you intend, or have, text starting with spaces you can use @LeLev 's <pre> tag.

              If you mean you want to style a first-line-only indent as a style on the <p> there is text-indent: 30pt;, or margin-left: 40px; if you mean all lines.

              S Offline
              S Offline
              ShiroExorcist
              wrote on last edited by
              #6

              @JonB textEdit dose't have property indent. Can you show simple example?

              ODБOïO 1 Reply Last reply
              0
              • S ShiroExorcist

                @JonB textEdit dose't have property indent. Can you show simple example?

                ODБOïO Offline
                ODБOïO Offline
                ODБOï
                wrote on last edited by
                #7

                hi,
                @ShiroExorcist said in paragraph in TextEdit:

                textEdit dose't have property indent

                JonB said "style on the <p>"

                '<p text-indent="30pt">spaced text</p>  long text .... !'
                or
                '<p margin-left="40px">spaced text</p>  long text .... !'
                
                

                but this dont work for me, there is no margin

                JonBJ 1 Reply Last reply
                0
                • ODБOïO ODБOï

                  hi,
                  @ShiroExorcist said in paragraph in TextEdit:

                  textEdit dose't have property indent

                  JonB said "style on the <p>"

                  '<p text-indent="30pt">spaced text</p>  long text .... !'
                  or
                  '<p margin-left="40px">spaced text</p>  long text .... !'
                  
                  

                  but this dont work for me, there is no margin

                  JonBJ Offline
                  JonBJ Offline
                  JonB
                  wrote on last edited by JonB
                  #8

                  @LeLev , @ShiroExorcist
                  Not that I've tried it, but that's because what you've tried is wrong! These are styles, not HTML attributes! So try:

                  <p style="text-indent: 30pt">
                  <p style="margin-left: 40px">
                  

                  ?

                  ODБOïO 1 Reply Last reply
                  2
                  • JonBJ JonB

                    @LeLev , @ShiroExorcist
                    Not that I've tried it, but that's because what you've tried is wrong! These are styles, not HTML attributes! So try:

                    <p style="text-indent: 30pt">
                    <p style="margin-left: 40px">
                    

                    ?

                    ODБOïO Offline
                    ODБOïO Offline
                    ODБOï
                    wrote on last edited by ODБOï
                    #9

                    @JonB said in paragraph in TextEdit:

                    wrong!

                    yes, my bad

                    this works

                    text : '<p style="margin-left: 40px">spaced text</p>  long text .... !'
                    or
                     text: '<p style="text-indent: 30px">spaced text</p>  long text dfs.... !'
                    
                    1 Reply Last reply
                    3

                    • Login

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