(Improved "Is this the right control" section) |
(→Appearance) |
||
Line 21: | Line 21: | ||
=== Appearance === | === Appearance === | ||
* Alternate row color (use theme settings). Use different keys (e.g. page up/down) when more lists should be accessible. | * Alternate row color (use theme settings). Use different keys (e.g. page up/down) when more lists should be accessible. | ||
− | |||
* Make the list control large enough that it can show at least four items at a time without scrolling. | * Make the list control large enough that it can show at least four items at a time without scrolling. | ||
* If the list appears in a dialog or utility window, consider making the window and the list within it resizeable so that the user can choose how many list items are visible at a time without scrolling. Each time the user opens this dialog, set its dimensions to those that the user last resized it to. | * If the list appears in a dialog or utility window, consider making the window and the list within it resizeable so that the user can choose how many list items are visible at a time without scrolling. Each time the user opens this dialog, set its dimensions to those that the user last resized it to. | ||
+ | * If activating a choice affects the appearance or the enabled state of other controls, place them next to the list view. | ||
+ | * If certain controls in a dialog are only relevant if a certain item is selected (i.e. they are dependent controls), disable them instead of hiding. | ||
+ | * Label the list view with a descriptive caption to the top left (cf. [[Projects/Usability/HIG/Form_Label_Alignment| alignment]]). | ||
+ | * Create a buddy relation so access keys are assigned. | ||
+ | * Do not use ending punctuation (neither dot nor colon) for caption. | ||
+ | * Use [[Projects/Usability/HIG/Capitalization|sentence style capitalization]] for list view items. | ||
== Implementation == | == Implementation == | ||
* [http://qt-project.org/doc/qt-4.8/qlistview.html QListView], for single-column lists. | * [http://qt-project.org/doc/qt-4.8/qlistview.html QListView], for single-column lists. | ||
* [http://qt-project.org/doc/qt-4.8/qtreeview.html QTreeView], for multi-column lists. Be sure to set the [http://qt-project.org/doc/qt-4.8/qtreeview.html#rootIsDecorated-prop rootIsDecorated property] to false if the items in your list do not have children. | * [http://qt-project.org/doc/qt-4.8/qtreeview.html QTreeView], for multi-column lists. Be sure to set the [http://qt-project.org/doc/qt-4.8/qtreeview.html#rootIsDecorated-prop rootIsDecorated property] to false if the items in your list do not have children. |
A list view is basically used to show some items. It offers orientation thereby and allows navigation without the need of other controls. Additionally, a list view may be used for single selection (users select one item from a list of mutually exclusive values) or multiple selection (selections in combination with the Shift key or Control key). However, because there is no common visual clue whether a list box’ mode is single or multiple and since other controls are more efficient for single selection, a list box should be used for single selection only.