Diaries of Learning Qt (1.4) QTextEdit & QPlainTextEdit

In the example the main area is the QPlainTextEdit widget, where users can deal with the text.

In a notepad, all we need is just some basic operations on text like copy, cut and paste. QPlainTextEdit provides these slots directly. In fact, it almost provides

every slot you may need, including undo, redo, clear, selectall etc. So if you want to write a notepad, using these slots is all you need.

But if more functions are required,like the Word, or more exactly, to deal with Rich Text, which QPlainTextEdit can't handle, QTextEdit will be what you need.

QTextEdit provides more method and slots to imple more function, but since we are faced with a plain notepad now, let's put it off.

 

posted @ 2017-08-28 10:49  Dolviet  阅读(159)  评论(0编辑  收藏  举报