[kde-guidelines] Styleguide: Unconstrained input

Heiko Tietze heiko.tietze at user-prompt.com
Fri Jun 21 14:10:47 UTC 2013


With 'unconstrained' I have a differentiation between numerical only vs. free 
input for instance in mind. I know single line controls (edit or text field) 
and multiline edits (memo or text area). Further unconstrained controls are 
lists and tables/grids that can be modified directly. Constrained controls are 
spinner, slider, picker etc.

Now I started to read about edit and I see a lot of options for Qt programers:  
TextInput, QLineEdit, QTextEdit and probably several other controls. What 
should we do?

My text for edits would be something like this:

Purpose

''Edit'' controls display a single line of text to the user and allow the user 
to enter unconstrained text. Edits are limited to short strings. If more than 
one line is required a ''text box'' is the right control. Text boxes can 
handle multiple lines of text. Because edits are unconstrained and don’t 
accept valid data only, input validation and problem handling is needed.

Guidelines

* Use edits for input of unconstrained text. If only a specific type of data is 
valid, use other controls.
* Mask letters if edit is used to enter passwords.
* Consider to use auto-complete feature to help users when entering data that 
is likely to be used repeatedly.
* Don't make users scroll unnecessarily; size text boxes to eliminate the need 
for scrolling.
* Don't put horizontal scroll bars on multi-line text boxes.
* When disabling edit or text box, also disable any associated labels and 
buttons.
* If the user enters a character that is known to be invalid, ignore the 
character and display an input problem hint that explains the valid characters 
(e.g. numbers vs. characters). 
* If the input data has a value or format that is known to be invalid, display 
an input problem hint when the text box loses input focus (e.g. wrong zip code 
format).
* If the input data is inconsistent with other controls on the window, give an 
error message when the entire input is complete, such as when users click OK 
for a modal dialog box.
* Don't clear invalid input data unless users aren't able to correct errors 
easily. Doing so allows users to correct mistakes without starting over. 



More information about the kde-guidelines mailing list