Results 1 to 7 of 7

Thread: line numbering in textedit

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    Join Date
    Nov 2013
    Location
    Chandigarh, India
    Posts
    62
    Thanks
    8
    Thanked 11 Times in 7 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default line numbering in textedit

    I wish to introduce line numbering in my textedit. I have a Ui containing a textedit and some other components.
    I followed this link http://qt-project.org/doc/qt-4.8/wid...odeeditor.html
    But this contains only single component i.e textedit only. I tried to use the set of code to my text edit but didn't help.
    Can anyone suggest me some easy way of doing this or how should I maneuver this code to get my job done.

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


  3. #2
    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 in textedit

    You put the subclassed QTextEdit from the example in a layout with your other widgets. It doesn't really get much easier than this.

    BTW: Are you operating several accounts here? Between this question and slew of regular expression questions...

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


  5. #3
    Join Date
    Nov 2013
    Location
    Chandigarh, India
    Posts
    62
    Thanks
    8
    Thanked 11 Times in 7 Posts
    Qt products
    Qt4 Qt5
    Platforms
    Windows

    Default Re: line numbering in textedit

    No I am not operating on multiple accounts. Just posed number of questions in small amount of time, and I tried modifying the Code Editor class in the mentioned example with my gui textedit but it doesn't work i.e. why I posed this thread again. if you can help me with any changes in the mainwindow.cpp file, would be very helpful for me..

  6. #4
    Join Date
    Apr 2013
    Location
    Prague
    Posts
    258
    Thanks
    3
    Thanked 65 Times in 59 Posts
    Qt products
    Qt4
    Platforms
    Unix/X11

    Default Re: line numbering in textedit

    Another possibility around: There exists QScintilla plugin. Scintilla is a specialized programmer's editor for writing source code. Line numbering is only one of its many built-in abilities. Download QScintilla and it will appear among widgets in your Designer. Inserting QScintilla in your GUI is therefore trivial.

Similar Threads

  1. line numbering in text editor.
    By parulkalra in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2013, 20:21
  2. Line Numbering in textedit
    By aaditya190 in forum Newbie
    Replies: 2
    Last Post: 15th November 2013, 08:58
  3. TextEdit with one line
    By alizadeh91 in forum Qt Quick
    Replies: 4
    Last Post: 3rd November 2012, 21:53
  4. Insert line to textedit
    By wirasto in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2009, 15:59

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.