Download video-‐monitorization system for a realistic driving simulator

Transcript
 Video-­‐monitorization system for a realistic driving simulator To open the document, was added in the open() function a part for the text edit. Proceeding like with the video files, was created a QString concatenating the name of the directory and the txt file. (Example: folderName + “/FileText.txt”). For this, and as said when open() was explained, the text file must be named FileText.txt in the directory where the videos and the text file are. In other case, this file will never be open in the application. For DriS application, was only needed the text widget to display and read the text, not to edit it. For this, was set the option ReadOnly, which allows the user only navigate through the text and select text, not being possible modify the text. To display the .txt in the text widget was created a QFile object with the QString concatenated before. The QFile class is an I/O device that provides an interface for reading from and writing to files. The text file is opened using the open() function of the QFile class and reading using the readAll() function of the same class. After, was set some options to allow display the text file in the text widget: 1.
setPlainText(): this property gets and sets the text editor’s contents as plain text. 2.
setLineWrapMode(): this function is used to specify the kind of line wrap wanted. It exists four types: NoWrap, WidgetWidth, FixedPixelWidth and FixedColumWidth. To implement this application, was chosen the FixedPixedWidth mode. 3.
setLineWrapColumnOrWidth(): this property holds the position (in pixels or columns depending on the wrap mode) where the text will be wrapped. For DriS application, was set the FixedPixelWidth mode (as said above), so the value will be the number of pixels from the left edge of the text edit at which text should be wrapped. After all this implementation, the application has the following aspect: 48