![]() ![]() Use type instead of var or variant to improve performance See also: Expected an identifier and instead saw ') for empty object literal For more information about JSLint errors, see JSLint Error Explanations. Many of the error messages are similar to the ones in Douglas Crockford's JSLint tool. The results are shown in the QML and QML Analysis filters in Issues. To run the checks, select Tools > QML/JS > Run Checks or press Ctrl+Shift+C. You can run static checks on the QML and JavaScript code in your project to find common problems. If you hide the annotations by deselecting the check box, you can move the mouse pointer over an icon to view them. ![]() Showing annotations between lines can be useful if there is usually not enough space to display annotations next to the text. To specify the position where the annotations are displayed, select Edit > Preferences > Text Editor > Display > Line annotations, and then select whether to display the annotations directly next to the code, aligned to the right of the code, or in the right margin. When writing QML or JavaScript code, the annotations may have error codes listed in JavaScript and QML Error Codes. To modify the colors used for underlining errors and warnings, select Edit > Preferences > Text Editor > Font & Colors > Copy, and select new colors for Error and Warning. Select the Annotation Settings link to specify the position of the line annotations. You can use the icons in the tooltip popup to copy the error or warning message to the clipboard, to hide messages of a particular type, or to change the diagnostics settings. In the following screenshot, a Qt class name has a typo: In the following screenshot, Qt Creator issues a warning because the variable is not used: In the following screenshot, Qt Creator annotates an error because a semicolon is missing at the end of the line: Similarly, when you are working on an instance of a JavaScript object notation (JSON) entity, Qt Creator underlines errors in the JSON data structure. If a fix is available, you can apply it by clicking. When Qt Creator spots a syntax error in your code, it underlines it, displays an icon, and shows error details when you move the mouse pointer over the error or the icon. As you write code, Qt Creator checks code syntax. ![]()
0 Comments
Leave a Reply. |