An input editor that displays a line edit and, if the text is outside the bounds of its suggested minimum and maximum length, a warning message.
This input editor recognizes the following keys in the JSON details object:
- "suggestedMinLength" and "suggestedMaxLength" define the range of recommended lengths for the text entered. If the text has fewer or more characters, a warning message is displayed below the line edit.
- Example:
{
"suggestedMinLength" : 7,
"suggestedMaxLength" : 15
}
|
void | setUpDialog (QDialog &dialog, json_object *originalValue, json_object *details) |
| Sets up a dialog containing a line edit and a (possibly empty) warning message.
|
|
QString | convertToLineEditFormat (json_object *value) |
| Removes quotation marks from the value to display in the line edit.
|
|
json_object * | convertFromLineEditFormat (const QString &valueAsString) |
| Adds quotation marks around the value from the line edit.
|
|
bool | eventFilter (QObject *object, QEvent *event) |
| Filters events on watched objects.
|
|
bool | event (QEvent *event) |
| Handles events for the input editor.
|
|
void | setUpLineEdit (QLineEdit *existingLineEdit, json_object *originalValue) |
| Configures the provided line edit to display the dialog's initial value.
|
|
void | setFirstWidgetInTabOrder (QWidget *widget) |
| Makes the given widget the first in this input editor's tab order.
|
|
void | setLastWidgetInTabOrder (QWidget *widget) |
| Makes the given widget the last in this input editor's tab order.
|
|
json_object * | getAcceptedValue (void) |
| Returns the current text in the line edit.
|
|
bool | eventFilter (QObject *object, QEvent *event) |
| Filters events on watched objects.
|
|
QDialog * | getDialog (void) |
| Returns a pointer to the dialog displayed by show().
|
|
QFont | getDefaultFont (void) |
| Returns the font that input editors are recommended to use.
|
|