Results 1 to 7 of 7

Thread: line numbering in textedit

  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.

  7. #5
    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

    Thank You very much.. But Can you post a link from where I can download this? I am very new to plugins and I am not able to find a suitable link to download this.. If you could post some link would be very helpful to me...


    Added after 43 minutes:


    I got the plugin downloaded.. But I am unable to install it. Can you suggest me some way to install the plugin?
    Last edited by aaditya190; 5th December 2013 at 08:56.

  8. #6
    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

    I downloaded the qscintilla plugin but I am unable to install it. I used the following commands...

    qmake qscintilla.pro
    make
    make install
    But the command prompt gives the error as make is an unknown command. Can anyone suggest me the right way to do this?

  9. #7
    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

    http://www.riverbankcomputing.co.uk/...cintilla/intro

    I have noticed that you are on winblows. Downloading the .zip for winblows, I have seen that it contains source files so that you need to compile. The "Qt4Qt5" and "designer-Qt4Qt5" folders seem to contain Qt projects (including the .pro files) for the library and the plugin. Looking at the .pro files, they seem to place the plugin and the library where it should be.

    Unpack the zip (including subdirectories) into your project folder, "Open New Project" and choose qscintilla.pro from Qt4Qt5 folder, compile. Then "Open New Project" and choose designer.pro from designer-Qt4Qt5 (you need to compile the library first), compile. You should pass and the both the plugin and the library should be where they belong.

    "We" in Debian have both the plugin and the library available in the repository so that we click "install" and are done

  10. The following user says thank you to Radek for this useful post:

    aaditya190 (6th December 2013)

Similar Threads

  1. line numbering in text editor.
    By parulkalra in forum Qt Programming
    Replies: 1
    Last Post: 26th November 2013, 21:21
  2. Line Numbering in textedit
    By aaditya190 in forum Newbie
    Replies: 2
    Last Post: 15th November 2013, 09:58
  3. TextEdit with one line
    By alizadeh91 in forum Qt Quick
    Replies: 4
    Last Post: 3rd November 2012, 22:53
  4. Insert line to textedit
    By wirasto in forum Qt Programming
    Replies: 1
    Last Post: 18th December 2009, 16: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.