A dialog used for general-purpose text and code editing.
More...
#include <CodeEditorDialog.h>
A dialog used for general-purpose text and code editing.
Syntax highlighting is provided using the QSourceHighlite library.
◆ CodeEditorDialog()
CodeEditorDialog::CodeEditorDialog |
( |
std::string |
contents = "" , |
|
|
QWidget * |
parent = Q_NULLPTR |
|
) |
| |
Initializes a new code editor dialog.
- Parameters
-
contents | - The initial contents of the file. Defaults to a blank string. |
parent | - The parent of this dialog. Defaults to nullptr . |
◆ ~CodeEditorDialog()
CodeEditorDialog::~CodeEditorDialog |
( |
| ) |
|
◆ GetDatarefValueHintType()
BlamDatarefValueHintType CodeEditorDialog::GetDatarefValueHintType |
( |
| ) |
|
◆ GetText()
std::string CodeEditorDialog::GetText |
( |
| ) |
|
Retrieves the updated text.
- Returns
- The modified text if the save button was clicked, otherwise this returns the original contents provided when the dialog was constructed. If no contents were provided and the dialog was cancelled, then this will return an empty string.
◆ IsCancelled()
bool CodeEditorDialog::IsCancelled |
( |
| ) |
|
Checks if the dialog was cancelled.
- Returns
true
if the user closed without saving, otherwise returns false
.
◆ SetLanguage() [1/2]
Sets the language used for syntax highlighting.
- Parameters
-
language | - The new language to use for syntax highlighting. |
◆ SetLanguage() [2/2]
void CodeEditorDialog::SetLanguage |
( |
std::string |
language_name | ) |
|
Sets the language used for syntax highlighting.
- Parameters
-
language_name | - The string representing the language name. If no matching language was found, then the language is left unchanged. |
The documentation for this class was generated from the following files: