-1

I am just learning Qt. I want to show line number of QPlainTextEdit. I found this link http://doc.qt.io/qt-5/qtwidgets-widgets-codeeditor-example.html and it worked. But now I want QPlainTextEdit to show line number with other controls on the form as in the image below.

How to show line number on QT

Thanks!

Jiri Tousek
  • 12,211
  • 5
  • 29
  • 43
Temp Tam
  • 21
  • 5

1 Answers1

0

The example from doc.qt.io that you've cited does exactly what you are asking. They subclassed QPlainTextEdit and extended it accordingly. If you just need line numbers, simply delete extra functionality from that example.

Sergei Kulik
  • 344
  • 2
  • 9