PDA

View Full Version : line numbering in textedit



aaditya190
2nd December 2013, 11:30
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.

ChrisW67
4th December 2013, 13:00
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...

aaditya190
5th December 2013, 07:50
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..

Radek
5th December 2013, 07:53
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.

aaditya190
5th December 2013, 08:56
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?

aaditya190
6th December 2013, 07:31
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?

Radek
6th December 2013, 07:38
http://www.riverbankcomputing.co.uk/software/qscintilla/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 :cool: