Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. String from sign
Forum Updated to NodeBB v4.3 + New Features

String from sign

Scheduled Pinned Locked Moved General and Desktop
10 Posts 4 Posters 3.0k 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.
  • R Offline
    R Offline
    Ruzik
    wrote on last edited by
    #1

    Hello, I have QPlainTextEdit there is any position, for example 12, how to know which line (block) is a position of
    Thanks in advance
    Except counting signs \ in - this method is very long

    1 Reply Last reply
    0
    • S Offline
      S Offline
      Scylla
      wrote on last edited by
      #2

      You can everytime you append text to the QPlainTextEdit count the "\n" characters. So you know always how many lines you have! So you don't have to count the lines again!

      1 Reply Last reply
      0
      • R Offline
        R Offline
        Ruzik
        wrote on last edited by
        #3

        Yes, but i need find string from sign, no count of string

        1 Reply Last reply
        0
        • Z Offline
          Z Offline
          ZapB
          wrote on last edited by
          #4

          Could you please explain more clearly what you are trying to do? I am not clear from your original post.

          Nokia Certified Qt Specialist
          Interested in hearing about Qt related work

          1 Reply Last reply
          0
          • R Offline
            R Offline
            Ruzik
            wrote on last edited by
            #5

            I have somi position, for example 125
            I have a text in the QPlainTextEdit
            QPlainTextEdit have a strings(text from start to \n)
            I need find string where situated sign number 125

            1 Reply Last reply
            0
            • S Offline
              S Offline
              Scylla
              wrote on last edited by
              #6

              I don't get it. What does it mean position 125? Is it the number of words in t a special line or is it the column of this line?

              1 Reply Last reply
              0
              • Z Offline
                Z Offline
                ZapB
                wrote on last edited by
                #7

                Please post a small sample of the data and explain clearly what you wish to do with it.

                Nokia Certified Qt Specialist
                Interested in hearing about Qt related work

                1 Reply Last reply
                0
                • R Offline
                  R Offline
                  Ruzik
                  wrote on last edited by
                  #8

                  http://hostingkartinok.com/image/01201106/a78462eb23699b873f41a07a84794da1.png
                  @ QTextCursor c1 = plainTextEdit->document()->find(QRegExp("\{ *\}"));
                  if (!c1.isNull())
                  listWidget->addItem("empty stylesheet {it's empty!} in " + /number of string/ + " string");@

                  1 Reply Last reply
                  0
                  • L Offline
                    L Offline
                    loladiro
                    wrote on last edited by
                    #9

                    Are you looking for:
                    @c1.blockNumber()@

                    1 Reply Last reply
                    0
                    • R Offline
                      R Offline
                      Ruzik
                      wrote on last edited by
                      #10

                      Thank you, this is that I was searching

                      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