Results 1 to 6 of 6

Thread: Line numbering of a plaintextedit

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Mar 2009
    Location
    Brisbane, Australia
    Posts
    7,729
    Thanks
    13
    Thanked 1,610 Times in 1,537 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Unix/X11 Windows
    Wiki edits
    17

    Default Re: Line numbering of a plaintextedit

    All the code to do this is in the codeeditor.h and codeeditor.cpp that make up the example. I cannot provide a simpler set of code.

    The LineNumberArea class paints numbers onto itself when its paintEvent() is called by Qt. It uses the code in the function CodeEditor::lineNumberAreaPaintEvent() in its parent CodeEditor object to do this. The logic for setting the size, position and content of the line number area is in the CodeEditor.

    We have no idea what role your class frameclass is supposed to have, but it currently makes no attempt to draw anything other than a blank background.

  2. The following user says thank you to ChrisW67 for this useful post:

    aaditya190 (10th December 2013)

Similar Threads

  1. line numbering in textedit
    By aaditya190 in forum Newbie
    Replies: 6
    Last Post: 6th December 2013, 06:38
  2. line numbering in text editor.
    By parulkalra in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2013, 20:21
  3. Line Numbering in textedit
    By aaditya190 in forum Newbie
    Replies: 2
    Last Post: 15th November 2013, 08:58
  4. Replies: 2
    Last Post: 13th August 2010, 10:08

Tags for this Thread

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.