Safari Books Online is a digital library providing on-demand subscription access to thousands of learning resources.
Write a text editor application, with a QTextEdit as its central widget.
Show the filename and whether there are changes to be saved in the window title.
File Menu: Add actions for Open, Save as, and Quit.
Help Menu: Add actions for About and About Qt
If there are changes to be saved, ask the user to confirm the quit.
Write an application that lets the user select and Open a text (or rich text) file from the disk and view the contents by scrolling through it. The scrolling view should expose at least ten lines at a time.
It should also permit the user to search for a string in that file. If the string is found, the line that contains it should appear in the scrolling view so that the user can see its context within the file. If it is not found, an appropriate message should appear in the status bar.
The user should click a button to search for the Next occurrence or the Previous occurrence of the search string.
There should also be a Close button that removes the file from the display and invites the user to select another file or Quit.
Figure 10.11 is a screenshot of one possible solution. The two menus contain actions that duplicate all of the pushbuttons except for Clear Search (which just clears the search text).
QTextEdit provides methods for undo and redo. Investigate these features and discuss the operations that can be undone or redone.