[solved]Can I use QPainter to draw a code editor?
-
I want to program an IDE and wonder if I could use QPainter to draw a code editor myself. I know it will be troublesome to draw a code editor, but I don't know other solution. Any other solution?
-
Hi and welcome to devnet,
Are you thinking of an editor like the one from QtCreator ?
-
[quote author="SGaist" date="1377517002"]Hi and welcome to devnet,
Are you thinking of an editor like the one from QtCreator ?[/quote]
Exactly...How can I code that? Do I have to use QPainter to draw it myself?
-
No you don't. Have a look at QSyntaxHighlighter and the associated examples.
You can also check the implementation of QtCreator.
-
[quote author="SGaist" date="1377517628"]No you don't. Have a look at QSyntaxHighlighter and the associated examples.
You can also check the implementation of QtCreator.[/quote]
Thank you, you helped a lot.
-
You're welcome
If this answers your question, you can update the thread's title to solved so other forum user will know that a solution has been found :)
-
[quote author="SGaist" date="1377519054"]You're welcome
If this answers your question, you can update the thread's title to solved so other forum user will know that a solution has been found :)[/quote]
One more question..Do I have to draw the line number myself?
!http://mx.bbs.duoyi.com/upfile/20130827/2EA3D21C88DE45D380B7C8A3156B7EAF.png(Draw the line number)! -
-
[quote author="1+1=2" date="1377574305"]http://qt-project.org/doc/qt-5.0/qtwidgets/widgets-codeeditor.html[/quote]
Thank you ^_^