[ fromfile: ex-mainwindows.xml id: ex-mainwindows ]
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
, , and .Help Menu: Add actions for
andIf there are changes to be saved, ask the user to confirm the quit.
Write an application that lets the user select and
a text (or rich text) file from the disk and view the contents by scrolling through it. The scrolling view should expose several lines at a time (at least ten).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
occurrence or the occurrence of the search string.There should also be a
button that removes the file from the display and invites the user to select another file or .Figure 10.10 is a screenshot of one possible solution. The two menus contain actions that duplicate all of the pushbuttons except for (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.
Generated: 2012-03-02 | © 2012 Alan Ezust and Paul Ezust. |