Results 1 to 3 of 3

Thread: Line Number - QTextEdit...???

  1. #1
    Join Date
    Jan 2007
    Posts
    29
    Thanks
    6
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Question Line Number - QTextEdit...???

    Hello everyone,

    I am using QTextEdit in my application. I want to display the line number at the status bar or on a label below textedit box. How can i get the line number. I have searched through the documentation. They have provided a function to get the total number of lines, i haven't seen a function which will provide us the line number where there is a cursor.

    For this i think there are two possibility:

    1. To display the line number as we see in editing someproject.ui.h(at the statusbar)

    2. To display the line number as in the kwrite(left side)

    can anyone please tell me the solution to any one of the possibility. A code snippet is helpful

  2. #2
    Join Date
    Feb 2006
    Location
    Oslo, Norway
    Posts
    6,264
    Thanks
    36
    Thanked 1,519 Times in 1,389 Posts
    Qt products
    Qt4
    Platforms
    MacOS X Unix/X11 Windows Symbian S60 Maemo/MeeGo

    Default Re: Line Number - QTextEdit...???

    The current block number can be retrieved via following methods (since Qt 4.2):
    J-P Nurmi

  3. #3
    Join Date
    Jan 2007
    Posts
    29
    Thanks
    6
    Qt products
    Qt3
    Platforms
    Unix/X11 Windows

    Default Re: Line Number - QTextEdit...???

    Can any one please provide me a code sample. I dont know what to do with the above said class links.

    Please explain me the procedure to get the exact line number in the textedit box where the cursor is present. If the cursor moves up n down, line number should change.

    please give me the code, if any one have done that.

    Thanks in advance

Similar Threads

  1. KDE/QWT doubt on debian sarge
    By hildebrand in forum KDE Forum
    Replies: 13
    Last Post: 25th April 2007, 06:13
  2. How to get column number in a line
    By showhand in forum Qt Programming
    Replies: 1
    Last Post: 30th August 2006, 09:42
  3. count line number in text
    By Alina in forum Qt Programming
    Replies: 2
    Last Post: 18th August 2006, 08:29
  4. QTableView paints too much
    By Jimmy2775 in forum Qt Programming
    Replies: 2
    Last Post: 26th July 2006, 18:42
  5. How to get text of last line only in QTextEdit?
    By rajesh in forum Qt Programming
    Replies: 2
    Last Post: 12th June 2006, 13:37

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Digia, Qt and their respective logos are trademarks of Digia Plc in Finland and/or other countries worldwide.